From 1a8e992fcc87b2d15911b60cc9220ec50a70a4ff Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 3 Dec 2017 18:47:19 -0800 Subject: Use relative imports throughout tests The tests relied on Python2 relative import semantics. Python3 changed import semantics to always search sys.path by default. To import using a relative path it must have a leading dot. Forward compatible with newer Pythons. Works towards the goal of moving tests outside of the installed package. For more information, see PEP-328: https://www.python.org/dev/peps/pep-0328/ --- tests/testutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/testutils.py') diff --git a/tests/testutils.py b/tests/testutils.py index 2ee07af..e1744c8 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -29,7 +29,7 @@ import select import platform import unittest from functools import wraps -from testconfig import dsn, repl_dsn +from .testconfig import dsn, repl_dsn # Silence warnings caused by the stubbornness of the Python unittest @@ -338,7 +338,7 @@ def skip_if_green(reason): def skip_if_green_(f): @wraps(f) def skip_if_green__(self): - from testconfig import green + from .testconfig import green if green: return self.skipTest(reason) else: -- cgit v1.2.1