regen plugin docs and links
--HG-- branch : 1.0.x
This commit is contained in:
@@ -4,14 +4,17 @@ pytest_unittest plugin
|
||||
|
||||
automatically discover and run traditional "unittest.py" style tests.
|
||||
|
||||
you can mix unittest TestCase subclasses and
|
||||
py.test style tests in one test module.
|
||||
Usage
|
||||
----------------
|
||||
|
||||
XXX consider user-specified test_suite()
|
||||
This plugin collects and runs Python `unittest.py style`_ tests.
|
||||
It will automatically collect ``unittest.TestCase`` subclasses
|
||||
and their ``test`` methods from the test modules of a project
|
||||
(usually following the ``test_*.py`` pattern).
|
||||
|
||||
this code is somewhat derived from Guido Wesdorps
|
||||
This plugin is enabled by default.
|
||||
|
||||
http://johnnydebris.net/svn/projects/py_unittest
|
||||
.. _`unittest.py style`: http://docs.python.org/library/unittest.html
|
||||
|
||||
Getting and improving this plugin
|
||||
---------------------------------
|
||||
@@ -34,19 +37,24 @@ For your convenience here is also an inlined version of ``pytest_unittest.py``:
|
||||
"""
|
||||
automatically discover and run traditional "unittest.py" style tests.
|
||||
|
||||
you can mix unittest TestCase subclasses and
|
||||
py.test style tests in one test module.
|
||||
Usage
|
||||
----------------
|
||||
|
||||
XXX consider user-specified test_suite()
|
||||
This plugin collects and runs Python `unittest.py style`_ tests.
|
||||
It will automatically collect ``unittest.TestCase`` subclasses
|
||||
and their ``test`` methods from the test modules of a project
|
||||
(usually following the ``test_*.py`` pattern).
|
||||
|
||||
this code is somewhat derived from Guido Wesdorps
|
||||
|
||||
http://johnnydebris.net/svn/projects/py_unittest
|
||||
This plugin is enabled by default.
|
||||
|
||||
.. _`unittest.py style`: http://docs.python.org/library/unittest.html
|
||||
"""
|
||||
import py
|
||||
import sys
|
||||
|
||||
def pytest_pycollect_makeitem(collector, name, obj):
|
||||
if 'unittest' not in sys.modules:
|
||||
return # nobody could have possibly derived a subclass
|
||||
if py.std.inspect.isclass(obj) and issubclass(obj, py.std.unittest.TestCase):
|
||||
return UnitTestCase(name, parent=collector)
|
||||
|
||||
@@ -147,7 +155,7 @@ For your convenience here is also an inlined version of ``pytest_unittest.py``:
|
||||
assert passed == 2
|
||||
assert passed + skipped + failed == 2
|
||||
|
||||
.. _`pytest_unittest.py`: http://bitbucket.org/hpk42/py-trunk/raw/e666e1d61190c52fb074f998d1781673db4d4d2f/py/test/plugin/pytest_unittest.py
|
||||
.. _`pytest_unittest.py`: http://bitbucket.org/hpk42/py-trunk/raw/c28e76a64569475dda8b92c68f9c1c0902c5049e/py/test/plugin/pytest_unittest.py
|
||||
.. _`extend`: ../extend.html
|
||||
.. _`plugins`: index.html
|
||||
.. _`contact`: ../../contact.html
|
||||
|
||||
Reference in New Issue
Block a user