commit 14a26f666e9515c2c36b0d6adb7a96b89ba3a5ce Author: Damian Johnson atagar@torproject.org Date: Mon Mar 30 18:56:57 2020 -0700
Drop test_installs_all_modules
This test checks that our setup.py includes all our modules within its packages line. The test no longer passes, but now that we're using setuptools it's unnecessary.
====================================================================== ERROR: test_installs_all_modules ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/atagar/Desktop/stem/test/unit/installation.py", line 30, in test_installs_all_modules modules = json.loads(re.search('packages = (\[.*\])', self.setup_contents).group(1).replace("'", '"')) AttributeError: 'NoneType' object has no attribute 'group' --- setup.py | 2 +- test/unit/installation.py | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-)
diff --git a/setup.py b/setup.py index 968e42c0..eccd29eb 100644 --- a/setup.py +++ b/setup.py @@ -137,7 +137,7 @@ try: author = stem.__author__, author_email = stem.__contact__, url = stem.__url__, - packages = setuptools.find_packages(exclude=["test*"]), + packages = setuptools.find_packages(exclude=['test*']), keywords = 'tor onion controller', scripts = ['tor-prompt'], package_data = { diff --git a/test/unit/installation.py b/test/unit/installation.py index 4b2a795c..91b2a232 100644 --- a/test/unit/installation.py +++ b/test/unit/installation.py @@ -1,6 +1,4 @@ -import json import os -import re import unittest
import test @@ -19,29 +17,6 @@ class TestInstallation(unittest.TestCase): else: self.skip_reason = '(only for git checkout)'
- def test_installs_all_modules(self): - if self.skip_reason: - self.skipTest(self.skip_reason) - - # Modules cited my our setup.py looks like... - # - # packages = ['stem', 'stem.descriptor', 'stem.util'], - - modules = json.loads(re.search('packages = (\[.*\])', self.setup_contents).group(1).replace("'", '"')) - module_paths = dict([(m, os.path.join(test.STEM_BASE, m.replace('.', os.path.sep))) for m in modules]) - - for module, path in module_paths.items(): - if not os.path.exists(path): - self.fail("setup.py's module %s doesn't exist at %s" % (module, path)) - - for entry in os.walk(os.path.join(test.STEM_BASE, 'stem')): - directory = entry[0] - - if directory.endswith('__pycache__'): - continue - elif directory not in module_paths.values(): - self.fail("setup.py doesn't install %s" % directory) - def test_installs_all_data_files(self): if self.skip_reason: self.skipTest(self.skip_reason)
tor-commits@lists.torproject.org