Rebase `python setup.py test` on invocation of pytest
See original GitHub issueI know setup.py test
is not in vogue anymore, but it is a no-op on Python 2.7, and a ugly error on Python 3.7
[ 101s] + /usr/bin/python2 setup.py test
[ 101s] running test
[ 101s] running egg_info
[ 101s] writing requirements to tabulator.egg-info/requires.txt
[ 101s] writing tabulator.egg-info/PKG-INFO
[ 101s] writing top-level names to tabulator.egg-info/top_level.txt
[ 101s] writing dependency_links to tabulator.egg-info/dependency_links.txt
[ 101s] writing entry points to tabulator.egg-info/entry_points.txt
[ 101s] reading manifest file 'tabulator.egg-info/SOURCES.txt'
[ 101s] reading manifest template 'MANIFEST.in'
[ 101s] writing manifest file 'tabulator.egg-info/SOURCES.txt'
[ 101s] running build_ext
[ 102s]
[ 102s] ----------------------------------------------------------------------
[ 102s] Ran 0 tests in 0.000s
[ 102s]
[ 102s] OK
[ 102s] + /usr/bin/python3 setup.py test
[ 102s] running test
[ 102s] running egg_info
[ 102s] writing tabulator.egg-info/PKG-INFO
[ 102s] writing dependency_links to tabulator.egg-info/dependency_links.txt
[ 102s] writing entry points to tabulator.egg-info/entry_points.txt
[ 102s] writing requirements to tabulator.egg-info/requires.txt
[ 102s] writing top-level names to tabulator.egg-info/top_level.txt
[ 102s] reading manifest file 'tabulator.egg-info/SOURCES.txt'
[ 102s] reading manifest template 'MANIFEST.in'
[ 102s] writing manifest file 'tabulator.egg-info/SOURCES.txt'
[ 102s] running build_ext
[ 104s] Traceback (most recent call last):
[ 104s] File "setup.py", line 105, in <module>
[ 104s] 'Topic :: Software Development :: Libraries :: Python Modules'
[ 104s] File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
[ 104s] return distutils.core.setup(**attrs)
[ 104s] File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
[ 104s] dist.run_commands()
[ 104s] File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
[ 104s] self.run_command(cmd)
[ 104s] File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
[ 104s] cmd_obj.run()
[ 104s] File "/usr/lib/python3.7/site-packages/setuptools/command/test.py", line 229, in run
[ 104s] self.run_tests()
[ 104s] File "/usr/lib/python3.7/site-packages/setuptools/command/test.py", line 251, in run_tests
[ 104s] exit=False,
[ 104s] File "/usr/lib/python3.7/unittest/main.py", line 100, in __init__
[ 104s] self.parseArgs(argv)
[ 104s] File "/usr/lib/python3.7/unittest/main.py", line 124, in parseArgs
[ 104s] self._do_discovery(argv[2:])
[ 104s] File "/usr/lib/python3.7/unittest/main.py", line 244, in _do_discovery
[ 104s] self.createTests(from_discovery=True, Loader=Loader)
[ 104s] File "/usr/lib/python3.7/unittest/main.py", line 154, in createTests
[ 104s] self.test = loader.discover(self.start, self.pattern, self.top)
[ 104s] File "/usr/lib/python3.7/unittest/loader.py", line 349, in discover
[ 104s] tests = list(self._find_tests(start_dir, pattern))
[ 104s] File "/usr/lib/python3.7/unittest/loader.py", line 406, in _find_tests
[ 104s] full_path, pattern, namespace)
[ 104s] File "/usr/lib/python3.7/unittest/loader.py", line 483, in _find_test_path
[ 104s] tests = self.loadTestsFromModule(package, pattern=pattern)
[ 104s] File "/usr/lib/python3.7/site-packages/setuptools/command/test.py", line 55, in loadTestsFromModule
[ 104s] tests.append(self.loadTestsFromName(submodule))
[ 104s] File "/usr/lib/python3.7/unittest/loader.py", line 205, in loadTestsFromName
[ 104s] test = obj()
[ 104s] TypeError: validate() missing 1 required positional argument: 'source'
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Branching With Git And Testing With Pytest: A Comprehensive ...
Use git rebase to keep our change history tidy. Use tagging to mark new versions of our application. Setup. Make sure you've got...
Read more >python - pytest with setup.py test
The recommended approach is to call python -m pytest directly, as in your first command.
Read more >Usage and Invocations — pytest documentation
This will run tests which contain names that match the given string expression (case-insensitive), which can include Python operators that use filenames, class ......
Read more >Changelog — PyScaffold unknown documentation
Allow different py.test options when invoking with py.test or python setup.py test · Check if Sphinx is needed and add it to setup_requires...
Read more >Setup — Pytest Alembic 0.4.0 documentation
This is fine, but pytest-alembic needs to provide alembic with a connection at runtime. ... Given that alembic tests invoke the env.py ,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sadielbartholomew Hi, sure!
Please go ahead and thanks for the help in advance.
python setup.py test
is deprecated now - https://github.com/pypa/setuptools/issues/1684