diff options
| author | Virgil Dupras <hsoft@hardcoded.net> | 2018-08-14 09:09:13 -0400 |
|---|---|---|
| committer | Virgil Dupras <hsoft@hardcoded.net> | 2018-08-14 09:09:13 -0400 |
| commit | 31706fd222edc7e75cb051012dab644e88537ea9 (patch) | |
| tree | 7f2a8eff9241a50396415c917d9a85c5cff39af6 /setup.py | |
| parent | bb585671418fa51682a7e1dbfef5914e26261adf (diff) | |
| download | gentoolkit-31706fd222edc7e75cb051012dab644e88537ea9.tar.gz | |
Fix broken test suite
The test suite (python setup.py test) was depending on a broken
interface from dev-python/snakeoil. This indicates that tests weren't
run in a while.
We don't actually need snakeoil to run tests. Replaced the test command
with a plain distutils Command.
Moreover, one of test Query tests wasn't in sync with the code. Changed
it to reflect current code.
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 36 |
1 files changed, 15 insertions, 21 deletions
@@ -5,8 +5,9 @@ from __future__ import print_function import re import sys -import distutils -from distutils import core #, log +import subprocess +from distutils import core +from distutils.cmd import Command from glob import glob import os @@ -98,26 +99,19 @@ class set_version(core.Command): sub(manpages, man_re) -def load_test(): - """Only return the real test class if it's actually being run so that we - don't depend on snakeoil just to install.""" +class TestCommand(Command): + user_options = [] - desc = "run the test suite" - if 'test' in sys.argv[1:]: - try: - from snakeoil import distutils_extensions - except ImportError: - sys.stderr.write("Error: We depend on dev-python/snakeoil ") - sys.stderr.write("to run tests.\n") - sys.exit(1) - class test(distutils_extensions.test): - description = desc - default_test_namespace = 'gentoolkit.test' - else: - class test(core.Command): - description = desc + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + args = [sys.executable, '-m', 'unittest', 'discover', 'pym'] + raise SystemExit(subprocess.call(args)) - return test packages = [ str('.'.join(root.split(os.sep)[1:])) @@ -156,7 +150,7 @@ core.setup( (os.path.join(os.sep, EPREFIX.lstrip(os.sep), 'usr/lib/tmpfiles.d'), ['data/tmpfiles.d/revdep-rebuild.conf']), ), cmdclass={ - 'test': load_test(), + 'test': TestCommand, 'set_version': set_version, }, ) |
