Skip to content

Conversation

JosephTLucas
Copy link
Contributor

PR reference: https://twitter.com/pytestdotorg/status/1302444196842725376?s=20

This example page seemed to be the best location. Anywhere else you recommend?

@JosephTLucas
Copy link
Contributor Author

Initially, I'd added my name to AUTHORS based on the PR prompt, but after reading the CONTRIBUTING guidelines in more detail, decided it wasn't warranted. I also cut the documentation down to 80 chars per line. For my development, is there something like black but for .rst files?

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JosephTLucas, please take a look at my comments. 👍

.. code-block:: python
# Will be discovered as a test
def test_class:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def test_class:
class TestClass:

collect_ignore_glob = ["*_py2.py"]
User modules with names matching ``test*.py`` may be discovered as tests. Since
Pytest 2.6, users can prevent this test discovery by setting a boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pytest 2.6, users can prevent this test discovery by setting a boolean
Pytest 2.6, users can prevent pytest from discovering classes that start with ``Test`` by setting a boolean ``__test__`` attribute to ``False``.

Also I think we only need the example with False set; otherwise the example using __test__ = True implies that pytest will discover the class for tests even if it doesn't match the python_classes configuration option, which is not true.

@josephlucas-arc
Copy link

Thanks @nicoddemus ! Changes made.

@nicoddemus nicoddemus merged commit 6ae0f74 into pytest-dev:master Sep 9, 2020
@nicoddemus
Copy link
Member

Thanks @JosephTLucas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants