summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-11-27 22:41:52 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-11-27 22:41:52 -0500
commitcbf82b63a3f98ebe0690ded2989f922625b86c7e (patch)
tree9fc7f6eaf24054d5e820cfefff30f94500041772
parent247603516e53f1e7be388cbbb6f40a9725331550 (diff)
downloadpython-setuptools-bitbucket-cbf82b63a3f98ebe0690ded2989f922625b86c7e.tar.gz
Make test.test_args a non-data property per Pull Request #155.
-rw-r--r--CHANGES.txt2
-rw-r--r--setuptools/command/test.py13
2 files changed, 14 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 73855d1c..f399636f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,8 @@ CHANGES
* Update dependency on certify.
* Pull Request #160: Improve detection of gui script in
``easy_install._adjust_header``.
+* Made ``test.test_args`` a non-data property; alternate fix
+ for the issue reported in Pull Request #155.
------
18.6.1
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index 160e21c9..c26f5fc9 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -41,6 +41,17 @@ class ScanningLoader(TestLoader):
return tests[0] # don't create a nested suite for only one return
+# adapted from jaraco.classes.properties:NonDataProperty
+class NonDataProperty(object):
+ def __init__(self, fget):
+ self.fget = fget
+
+ def __get__(self, obj, objtype=None):
+ if obj is None:
+ return self
+ return self.fget(obj)
+
+
class test(Command):
"""Command to run unit tests after in-place build"""
@@ -78,7 +89,7 @@ class test(Command):
if self.test_runner is None:
self.test_runner = getattr(self.distribution, 'test_runner', None)
- @property
+ @NonDataProperty
def test_args(self):
return list(self._test_args())