diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-05-24 16:40:40 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-05-24 16:40:40 -0400 |
| commit | 7306811598b51bfe726850ce4b061a6e389d5b80 (patch) | |
| tree | 907882aecc017d26f925f70d003371124a507d0f /setuptools/command/test.py | |
| parent | 8f1f09b7f93f2fa86bafcd6502ec51d4680b4499 (diff) | |
| parent | 52c394c1e87b863aec92949e4b494ab01a7cd234 (diff) | |
| download | python-setuptools-git-7306811598b51bfe726850ce4b061a6e389d5b80.tar.gz | |
Merge branch 'master' into docs_ci
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 = [] |
