[issue6514] python -m unittest testmodule does not run any tests
anatoly techtonik added the comment: The documentation should be fixed then: http://docs.python.org/2/library/unittest#command-line-interface -- nosy: +techtonik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
Berker Peksag added the comment: The documentation should be fixed then: http://docs.python.org/2/library/unittest#command-line-interface The documentation already covers that python -m unittest test_module usage works only in 2.7+. Changed in version 2.7: In earlier versions it was only possible to run individual test methods and not modules or classes. -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
anatoly techtonik added the comment: The documentation already covers that python -m unittest test_module usage works only in 2.7+. Changed in version 2.7: In earlier versions it was only possible to run individual test methods and not modules or classes. But the command line help says otherwise: $ python -m unittest -h Usage: unittest.py [options] [test] [...] Options: -h, --help Show this message -v, --verboseVerbose output -q, --quiet Minimal output Examples: unittest.py - run default set of tests unittest.py MyTestSuite - run suite 'MyTestSuite' unittest.py MyTestCase.testSomething - run MyTestCase.testSomething unittest.py MyTestCase- run all 'test*' test methods in MyTestCase $ python --version Python 2.6.6 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
Changes by Georg Brandl ge...@python.org: -- assignee: - michael.foord nosy: +michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
Michael Foord mich...@voidspace.org.uk added the comment: I can duplicate the problem - I wonder if this has to do with the refactoring into a package? Anyway, thanks for catching this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
Michael Foord mich...@voidspace.org.uk added the comment: Ha - no I can't reproduce it on trunk. The python -m features are new in trunk and neither documented nor working in 2.4-2.6. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
Michael Foord mich...@voidspace.org.uk added the comment: This isn't a bug - the command line message if you run python -m unittest on Python 2.4-2.6 is just confusing. It has never worked. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6514] python -m unittest testmodule does not run any tests
New submission from Jean-Paul Calderone exar...@divmod.com: exar...@boson:~$ cat test_foo.py from unittest import TestCase class SomeTests(TestCase): def test_foo(self): pass exar...@boson:~$ python -m unittest test_foo -- Ran 0 tests in 0.000s OK exar...@boson:~$ python -m unittest test_foo.SomeTests 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 553, in loadTestsFromName test = obj() File /usr/lib/python2.5/unittest.py, line 209, in __init__ (self.__class__, methodName) ValueError: no such test method in class 'test_foo.SomeTests': runTest exar...@boson:~$ python -m unittest test_foo.SomeTests.test_foo . -- Ran 1 test in 0.000s OK exar...@boson:~$ I don't really know what's happening in the middle case. The first case seems to fail because the test loader goes around looking for subclasses of __main__.TestCase. It only finds subclasses of unittest.TestCase, though, which it rejects. -- components: Library (Lib) messages: 90681 nosy: exarkun severity: normal status: open title: python -m unittest testmodule does not run any tests type: behavior versions: Python 2.4, Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com