aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt6
-rw-r--r--setuptools/command/test.py19
2 files changed, 19 insertions, 6 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index f7340776..fbfb4885 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,12 @@
CHANGES
=======
+-----
+3.4.1
+-----
+
+* Issue #180: Fix regression in test command not caught by py.test-run tests.
+
---
3.4
---
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index c46efc0f..e377a781 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -158,12 +158,19 @@ class test(Command):
del_modules.append(name)
list(map(sys.modules.__delitem__, del_modules))
- loader_ep = EntryPoint.parse("x="+self.test_loader)
- loader_class = loader_ep.load(require=False)
- runner_ep = EntryPoint.parse("x=" + self.test_runner)
- runner_class = runner_ep.load(require=False)
unittest.main(
None, None, [unittest.__file__]+self.test_args,
- testLoader=loader_class(),
- testRunner=runner_class(),
+ testLoader=self._resolve_as_ep(self.test_loader),
+ testRunner=self._resolve_as_ep(self.test_runner),
)
+
+ @staticmethod
+ def _resolve_as_ep(val):
+ """
+ Load the indicated attribute value, called, as a as if it were
+ specified as an entry point.
+ """
+ if val is None:
+ return
+ parsed = EntryPoint.parse("x=" + val)
+ return parsed.load(require=False)()