aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-03-30 17:20:36 +0100
committerJason R. Coombs <jaraco@jaraco.com>2014-03-30 17:20:36 +0100
commit628b5278a174d94907a25d065403feed1d2cd1d8 (patch)
tree364ca50a16c00520c666271e4f9dff772574827f
parent9cd58f5b62a43b50bbf01a41a9f6ad18002bcdd1 (diff)
downloadexternal_python_setuptools-628b5278a174d94907a25d065403feed1d2cd1d8.tar.gz
external_python_setuptools-628b5278a174d94907a25d065403feed1d2cd1d8.tar.bz2
external_python_setuptools-628b5278a174d94907a25d065403feed1d2cd1d8.zip
Extract the resolution of loader/runner classes. Allows None value to pass-through to unittest.main. Fixes #180.
-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)()