Modify ↓
#13262 closed defect (fixed)
test command has been deprecated since setuptools 41.5.0
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.20 |
Component: | general | Version: | 1.0.19 |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Invoke directly |
Description
1.0-stable and 1.2-stable use test
command of setuptools.
%.py : status python setup.py -q test -s $(subst /,.,$(@:.py=)).suite $(testopts) ifdef test all: status python setup.py -q test -s $(subst /,.,$(test:.py=)).suite $(testopts) else all: help endif
The test
command has been deprecated since setuptools 41.5.0.
python setup.py -q test -s trac.versioncontrol.tests.functional.suite 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.
See also:
Attachments (0)
Change History (6)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
I've tried python -m unittest <test-suite>
but ValueError
is raised due to not a test
with Python 2.5 and 2.6.
$ PYTHONPATH=. ~/venv/py25/bin/python -m unittest trac.tests.core.suite Traceback (most recent call last): File "/usr/lib/python2.5/runpy.py", line 95, in run_module filename, loader, alter_sys) File "/usr/lib/python2.5/runpy.py", line 52, in _run_module_code mod_name, mod_fname, mod_loader) File "/usr/lib/python2.5/runpy.py", line 32, in _run_code exec code in run_globals File "/usr/lib/python2.5/unittest.py", line 816, in <module> main(module=None) File "/usr/lib/python2.5/unittest.py", line 767, in __init__ self.parseArgs(argv) File "/usr/lib/python2.5/unittest.py", line 794, in parseArgs self.createTests() File "/usr/lib/python2.5/unittest.py", line 800, in createTests self.module) File "/usr/lib/python2.5/unittest.py", line 565, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python2.5/unittest.py", line 556, in loadTestsFromName "calling %s returned %s, not a test" % (obj,test) ValueError: calling <function suite at 0x33f2848> returned <unittest.TestSuite tests=[<unittest.TestSuite tests=[<trac.tests.core.TracErrorTestCase testMethod=test_init>, <trac.tests.core.TracErrorTestCase testMethod=test_unicode>]>, <unittest.TestSuite tests=[<trac.tests.core.ComponentTestCase testMethod=test_abstract_component_not_registered>, <trac.tests.core.ComponentTestCase testMethod=test_attribute_access>, <trac.tests.core.ComponentTestCase testMethod=test_base_class_not_registered>, <trac.tests.core.ComponentTestCase testMethod=test_component_identity>, <trac.tests.core.ComponentTestCase testMethod=test_component_initializer>, <trac.tests.core.ComponentTestCase testMethod=test_component_manager_component>, <trac.tests.core.ComponentTestCase testMethod=test_component_manager_component_isolation>, <trac.tests.core.ComponentTestCase testMethod=test_component_registration>, <trac.tests.core.ComponentTestCase testMethod=test_extension_point_with_no_extension>, <trac.tests.core.ComponentTestCase testMethod=test_extension_point_with_one_extension>, <trac.tests.core.ComponentTestCase testMethod=test_extension_point_with_two_extensions>, <trac.tests.core.ComponentTestCase testMethod=test_implements_called_outside_classdef>, <trac.tests.core.ComponentTestCase testMethod=test_implements_multiple>, <trac.tests.core.ComponentTestCase testMethod=test_inherited_component_initializer>, <trac.tests.core.ComponentTestCase testMethod=test_inherited_extension_point>, <trac.tests.core.ComponentTestCase testMethod=test_inherited_implements>, <trac.tests.core.ComponentTestCase testMethod=test_inherited_implements_multilevel>, <trac.tests.core.ComponentTestCase testMethod=test_instantiation_doesnt_enable>, <trac.tests.core.ComponentTestCase testMethod=test_invalid_argument_raises>, <trac.tests.core.ComponentTestCase testMethod=test_nonconforming_extender>, <trac.tests.core.ComponentTestCase testMethod=test_unregistered_component>]>]>, not a test
Another idea, we could invoke directly unitest.main
via -c
option with Python 2.5 and 2.6.
-
Makefile
diff --git a/Makefile b/Makefile index 55d4be4c2..b5c9d83e7 100644
a b export HELP_CFG 61 61 62 62 .PHONY: all help help-all status clean clean-bytecode clean-mo 63 63 64 define unittest-main 65 python -c 'import unittest; from $1 import suite; unittest.main(defaultTest="suite")' $(testopts) 66 endef 67 64 68 %.py : status 65 python setup.py -q test -s $(subst /,.,$(@:.py=)).suite $(testopts)69 $(call unittest-main,$(subst /,.,$(@:.py=))) 66 70 67 71 ifdef test 68 72 all: status 69 python setup.py -q test -s $(subst /,.,$(test:.py=)).suite $(testopts)73 $(call unittest-main,$(subst /,.,$(test:.py=))) 70 74 else 71 75 all: help 72 76 endif
$ make python=25 trac/tests/core.py Python: /home/jun66j5/venv/py25/bin/python Package Version --------------------------------------------------------- Python : 2.5.6 (r256:88840, Oct 21 2014, 22:49:55) : [GCC 4.8.2] Setuptools : 0.6c11 Pip : 1.3.1 Wheel : not installed Genshi : 0.7 (with speedups) Babel : 0.9.6 sqlite3 : 2.3.2 (3.11.0) PySqlite : 2.7.0 (3.11.0) MySQLdb : 1.2.5 Psycopg2 : 2.5.2 (dt dec pq3 ext) SVN bindings : 1.9.3 (r1718519) Mercurial : 3.4.2 Pygments : 1.6 Textile : not installed Pytz : 2018.9 ConfigObj : 4.7.2 Docutils : 0.14 Twill : 0.9 LXML : 3.3.6 coverage : 3.7.1 figleaf : not installed Variables: PATH=/home/jun66j5/venv/py25/bin:/home/jun66j5/bin:/home/jun66j5/.gem/ruby/2.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PYTHONPATH=. TRAC_TEST_DB_URI= server-options= -p 3000 -a '*,/home/jun66j5/src/trac-htdigest.txt,auth' -e External dependencies: Git version: git version 2.26.0 Subversion version: 1.9.3 python -c 'import unittest; from trac.tests.core import suite; unittest.main(defaultTest="suite")' ....................... ---------------------------------------------------------------------- Ran 23 tests in 0.002s OK $ make python=25 testopts=-v trac/tests/core.py Python: /home/jun66j5/venv/py25/bin/python Package Version --------------------------------------------------------- Python : 2.5.6 (r256:88840, Oct 21 2014, 22:49:55) : [GCC 4.8.2] Setuptools : 0.6c11 Pip : 1.3.1 Wheel : not installed Genshi : 0.7 (with speedups) Babel : 0.9.6 sqlite3 : 2.3.2 (3.11.0) PySqlite : 2.7.0 (3.11.0) MySQLdb : 1.2.5 Psycopg2 : 2.5.2 (dt dec pq3 ext) SVN bindings : 1.9.3 (r1718519) Mercurial : 3.4.2 Pygments : 1.6 Textile : not installed Pytz : 2018.9 ConfigObj : 4.7.2 Docutils : 0.14 Twill : 0.9 LXML : 3.3.6 coverage : 3.7.1 figleaf : not installed Variables: PATH=/home/jun66j5/venv/py25/bin:/home/jun66j5/bin:/home/jun66j5/.gem/ruby/2.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PYTHONPATH=. TRAC_TEST_DB_URI= server-options= -p 3000 -a '*,/home/jun66j5/src/trac-htdigest.txt,auth' -e External dependencies: Git version: git version 2.26.0 Subversion version: 1.9.3 python -c 'import unittest; from trac.tests.core import suite; unittest.main(defaultTest="suite")' -v test_init (trac.tests.core.TracErrorTestCase) ... ok test_unicode (trac.tests.core.TracErrorTestCase) ... ok test_abstract_component_not_registered (trac.tests.core.ComponentTestCase) ... ok test_attribute_access (trac.tests.core.ComponentTestCase) ... ok test_base_class_not_registered (trac.tests.core.ComponentTestCase) ... ok test_component_identity (trac.tests.core.ComponentTestCase) ... ok test_component_initializer (trac.tests.core.ComponentTestCase) ... ok test_component_manager_component (trac.tests.core.ComponentTestCase) ... ok test_component_manager_component_isolation (trac.tests.core.ComponentTestCase) ... ok test_component_registration (trac.tests.core.ComponentTestCase) ... ok test_extension_point_with_no_extension (trac.tests.core.ComponentTestCase) ... ok test_extension_point_with_one_extension (trac.tests.core.ComponentTestCase) ... ok test_extension_point_with_two_extensions (trac.tests.core.ComponentTestCase) ... ok test_implements_called_outside_classdef (trac.tests.core.ComponentTestCase) ... ok test_implements_multiple (trac.tests.core.ComponentTestCase) ... ok test_inherited_component_initializer (trac.tests.core.ComponentTestCase) ... ok test_inherited_extension_point (trac.tests.core.ComponentTestCase) ... ok test_inherited_implements (trac.tests.core.ComponentTestCase) ... ok test_inherited_implements_multilevel (trac.tests.core.ComponentTestCase) ... ok test_instantiation_doesnt_enable (trac.tests.core.ComponentTestCase) ... ok test_invalid_argument_raises (trac.tests.core.ComponentTestCase) ... ok test_nonconforming_extender (trac.tests.core.ComponentTestCase) ... ok test_unregistered_component (trac.tests.core.ComponentTestCase) ... ok ---------------------------------------------------------------------- Ran 23 tests in 0.006s OK
comment:4 by , 5 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Thanks for the reviewing. I'll push the changes.
comment:5 by , 5 years ago
Milestone: | next-stable-1.2.x → 1.0.20 |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
comment:6 by , 4 years ago
Note:
See TracTickets
for help on using tickets.
Not sure if we can use unittest module like in r17088: