From 6c8c52dabf065c4accd0796c9b242426fe0c31a0 Mon Sep 17 00:00:00 2001 From: DrSlump Date: Tue, 14 Nov 2017 15:24:30 +0100 Subject: [PATCH] fix test execution for Python 3.3 and 3.4 --- setup.cfg | 2 +- tests/{di_tests.py => test_di.py} | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) rename tests/{di_tests.py => test_di.py} (99%) diff --git a/setup.cfg b/setup.cfg index 0d89aba..3fdf3d3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,4 +8,4 @@ test=pytest [tool:pytest] # Make sure we only include those files suffixed with -tests -python_files = tests/*_tests.py +python_files = tests/test_*.py diff --git a/tests/di_tests.py b/tests/test_di.py similarity index 99% rename from tests/di_tests.py rename to tests/test_di.py index 18a7ae4..6815d8a 100644 --- a/tests/di_tests.py +++ b/tests/test_di.py @@ -12,10 +12,11 @@ from di import injector, Key, DependencyMap, ContextualDependencyMap, PatchedDependencyMap, MetaInject -PY3 = sys.version_info[0] >= 3 +PY3 = sys.hexversion >= 0x03000000 +PY35 = sys.hexversion >= 0x03050000 -# Import tests using Python3 syntax -if PY3: +# Import tests using Python3 syntax when >=3.5 +if PY35: from .py3 import *