Add example for __test__ (#7733)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
parent
4df39e3a1d
commit
6ae0f741ef
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue