regen docs, add a specific test_collectonly.py example

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-10-11 13:38:16 +02:00
parent b5b8e5f0c2
commit a82a6bb058
4 changed files with 20 additions and 19 deletions

View File

@ -319,24 +319,14 @@ Collection nodes which have children are called "Collectors" and otherwise
they are called "Items" or "test items". Here is an example of such a they are called "Items" or "test items". Here is an example of such a
tree:: tree::
testing $ py.test --collectonly test_parseonly.py example $ py.test --collectonly test_collectonly.py
<Directory 'testing'> <Directory 'example'>
<Module 'test_parseopt.py'> <Module 'test_collectonly.py'>
<Class 'TestParser'> <Function 'test_function'>
<Class 'TestClass'>
<Instance '()'> <Instance '()'>
<Function 'test_init'> <Function 'test_method'>
<Function 'test_group_add_and_get'> <Function 'test_anothermethod'>
<Function 'test_addgroup_deprecation'>
<Function 'test_getgroup_simple'>
<Function 'test_group_ordering'>
<Function 'test_group_addoption'>
<Function 'test_group_shortopt_lowercase'>
<Function 'test_parser_addoption'>
<Function 'test_parse'>
<Function 'test_parse_will_set_default'>
<Function 'test_parse_setoption'>
<Function 'test_parse_defaultgetter'>
<Function 'test_addoption_parser_epilog'>
By default all directories not starting with a dot are traversed, By default all directories not starting with a dot are traversed,
looking for ``test_*.py`` and ``*_test.py`` files. Those Python looking for ``test_*.py`` and ``*_test.py`` files. Those Python

View File

@ -45,7 +45,7 @@ then you can just invoke ``py.test`` without command line options::
$ py.test $ py.test
============================= test session starts ============================== ============================= test session starts ==============================
platform linux2 -- Python 2.6.5 -- pytest-2.0.0dev0 platform linux2 -- Python 2.6.5 -- pytest-2.0.0dev0
test path 1: /tmp/doc-exec-109 test path 1: /tmp/doc-exec-224
conftest.py . conftest.py .
example.rst . example.rst .

View File

@ -0,0 +1,11 @@
# run this with $ py.test --collectonly test_collectonly.py
#
def test_function():
pass
class TestClass:
def test_method():
pass
def test_anothermethod():
pass

View File

@ -40,7 +40,7 @@ will be undone.
$ py.test $ py.test
============================= test session starts ============================== ============================= test session starts ==============================
platform linux2 -- Python 2.6.5 -- pytest-2.0.0dev0 platform linux2 -- Python 2.6.5 -- pytest-2.0.0dev0
test path 1: /tmp/doc-exec-117 test path 1: /tmp/doc-exec-232
=============================== in 0.00 seconds =============================== =============================== in 0.00 seconds ===============================