diff options
author | Wyatt Hepler <hepler@google.com> | 2020-06-19 12:05:54 -0700 |
---|---|---|
committer | CQ Bot Account <commit-bot@chromium.org> | 2020-06-22 20:16:43 +0000 |
commit | 01197109b206cfbc4557237485457263fb2fac76 (patch) | |
tree | c0d78794ef39454b5f4efb8079d55db133befb0f /pw_cli | |
parent | a4dc8112ed8b6252dcf15cf77e949e7da9c56e35 (diff) | |
download | pigweed-01197109b206cfbc4557237485457263fb2fac76.tar.gz |
pw_presubmit: Don't use setup.py test
Previously, Python tests were executed using setup.py test. There are a
few issues with this. First, with the current setup, tests are executed
twice for some reason. Occasionally other odd errors occur. Also,
setuptools has deprecated the test command for setup.py and states that
it will be removed in a future version.
This change discovers tests by finding the package directories of
affected files and searching for tests with customizable patterns
('*_test.py' by default). This approach is simpler, faster, and no
longer relies on setuptools or unittest.
Since setup.py test is no longer used, this change removes test suite
discovery from Pigweed's setup.py files.
Change-Id: I3de6c5d05ea5e38eea27b0e3aca956fe468035be
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12662
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Diffstat (limited to 'pw_cli')
-rw-r--r-- | pw_cli/py/setup.py | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/pw_cli/py/setup.py b/pw_cli/py/setup.py index 699a33c6b..94df754cf 100644 --- a/pw_cli/py/setup.py +++ b/pw_cli/py/setup.py @@ -13,15 +13,8 @@ # the License. """pw_cli""" -import unittest import setuptools - -def test_suite(): - """Test suite for pw_cli module.""" - return unittest.TestLoader().discover('./', pattern='*_test.py') - - setuptools.setup( name='pw_cli', version='0.0.1', @@ -29,6 +22,5 @@ setuptools.setup( author_email='pigweed-developers@googlegroups.com', description='Pigweed swiss-army knife', packages=setuptools.find_packages(), - test_suite='setup.test_suite', entry_points={'console_scripts': ['pw = pw_cli.__main__:main']}, ) |