Add example for __test__ (#7733)

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
Joseph Lucas 2020-09-09 09:33:39 -04:00 committed by GitHub
parent 4df39e3a1d
commit 6ae0f741ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -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