Michael Foord mich...@voidspace.org.uk added the comment:
Well, it was misdiagnosed yes - but asking for python -m unittest ... support
in Python 2.6 is still a feature request and not a bug report. (So
unfortunately it can't be fixed in 2.6 which is bugfix only. The solution is to
use
James Westby jw+deb...@jameswestby.net added the comment:
Hi,
I think this was misdiagnosed:
from unittest.py in 2.6, loadTestFromName:
elif hasattr(obj, '__call__'):
test = obj()
if isinstance(test, TestSuite):
return test
elif
Michael Foord mich...@voidspace.org.uk added the comment:
Use load_tests instead.
--
resolution: - rejected
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7501
Michael Foord mich...@voidspace.org.uk added the comment:
Is this needed as well as the load_tests protocol?
If a test module defines a load_tests function that returns a test suite then
the following creates the test suite from load_tests and executes that:
python -m unittest modulename
Michael Foord mich...@voidspace.org.uk added the comment:
What made you think that would work? In your example foo.test_suite is neither
a test nor a suite but a function.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7501
Robert Collins robe...@robertcollins.net added the comment:
Its a common convention in zope.testing, trial, testtools, bzr, ...
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7501
___
Michael Foord mich...@voidspace.org.uk added the comment:
So it's a feature request then...
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7501
___
Jean-Paul Calderone exar...@divmod.com added the comment:
Sounds like one.
As far as the trial behavior goes, trial foo.test_suite won't work, but
trial foo will call foo.test_suite, if one is defined.
--
nosy: +exarkun
___
Python tracker
New submission from Robert Collins robe...@robertcollins.net:
:!python -m unittest foo.test_suite
Traceback (most recent call last):
File /usr/lib/python2.6/runpy.py, line 122, in _run_module_as_main
__main__, fname, loader, pkg_name)
File /usr/lib/python2.6/runpy.py, line 34, in
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +michael.foord
priority: - normal
type: crash - behavior
versions: -Python 3.0
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7501
10 matches
Mail list logo