Skip to content

Commit 6ae0f74

Browse files
Add example for __test__ (#7733)
Co-authored-by: Bruno Oliveira <[email protected]>
1 parent 4df39e3 commit 6ae0f74

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/en/example/pythoncollection.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,12 @@ interpreter:
313313
collect_ignore = ["setup.py"]
314314
if sys.version_info[0] > 2:
315315
collect_ignore_glob = ["*_py2.py"]
316+
317+
Since Pytest 2.6, users can prevent pytest from discovering classes that start
318+
with ``Test`` by setting a boolean ``__test__`` attribute to ``False``.
319+
320+
.. code-block:: python
321+
322+
# Will not be discovered as a test
323+
class TestClass:
324+
__test__ = False

0 commit comments

Comments
 (0)