Skip to content

Commit

Permalink
Add example for __test__ (#7733)
Browse files Browse the repository at this point in the history
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
  • Loading branch information
JosephTLucas and nicoddemus committed Sep 9, 2020
1 parent 4df39e3 commit 6ae0f74
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/en/example/pythoncollection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,12 @@ interpreter:
collect_ignore = ["setup.py"]
if sys.version_info[0] > 2:
collect_ignore_glob = ["*_py2.py"]
Since Pytest 2.6, users can prevent pytest from discovering classes that start
with ``Test`` by setting a boolean ``__test__`` attribute to ``False``.

.. code-block:: python
# Will not be discovered as a test
class TestClass:
__test__ = False

0 comments on commit 6ae0f74

Please sign in to comment.