diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-11 22:15:31 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-11 22:15:31 -0500 |
| commit | ce8e3ee174ed9dee84aa08a461fb174ac1e53535 (patch) | |
| tree | da78c024b4491210e61b73e9e2f755d46c8bc1ff /setuptools/command/test.py | |
| parent | 53b8523fdfa19173d2e6b11d6b4d175f54b9dfea (diff) | |
| parent | a5dec2f14e3414e4ee5dd146bff9c289d573de9a (diff) | |
| download | python-setuptools-git-ce8e3ee174ed9dee84aa08a461fb174ac1e53535.tar.gz | |
Merge branch 'master' into fix/1557
Diffstat (limited to 'setuptools/command/test.py')
| -rw-r--r-- | setuptools/command/test.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index 973e4eb2..2d83967d 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -74,7 +74,7 @@ class NonDataProperty: class test(Command): """Command to run unit tests after in-place build""" - description = "run unit tests after in-place build" + description = "run unit tests after in-place build (deprecated)" user_options = [ ('test-module=', 'm', "Run 'test_suite' in specified module"), @@ -129,7 +129,8 @@ class test(Command): @contextlib.contextmanager def project_on_sys_path(self, include_dists=[]): - with_2to3 = six.PY3 and getattr(self.distribution, 'use_2to3', False) + with_2to3 = not six.PY2 and getattr( + self.distribution, 'use_2to3', False) if with_2to3: # If we run 2to3 we can not do this inplace: @@ -214,6 +215,14 @@ class test(Command): return itertools.chain(ir_d, tr_d, er_d) def run(self): + self.announce( + "WARNING: Testing via this command is deprecated and will be " + "removed in a future version. Users looking for a generic test " + "entry point independent of test runner are encouraged to use " + "tox.", + log.WARN, + ) + installed_dists = self.install_dists(self.distribution) cmd = ' '.join(self._argv) @@ -232,7 +241,7 @@ class test(Command): # Purge modules under test from sys.modules. The test loader will # re-import them from the build location. Required when 2to3 is used # with namespace packages. - if six.PY3 and getattr(self.distribution, 'use_2to3', False): + if not six.PY2 and getattr(self.distribution, 'use_2to3', False): module = self.test_suite.split('.')[0] if module in _namespace_packages: del_modules = [] |
