Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: import pytest in conftest.py example in doctest.rst #12181

Merged
merged 2 commits into from Apr 3, 2024

Conversation

MLopez-Ibanez
Copy link
Contributor

  • Include documentation when adding new features.
  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.

Change is trivial or a small documentation fix (e.g., a typo or reword of a small section).

The conftest.py example does not work without the import pytest, which leads to the following error:

py310: commands[0]> pytest --doctest-modules --doctest-continue-on-failure --pyargs src
ImportError while loading conftest '[...]/mooplot/python/src/conftest.py'.
src/conftest.py:4: in <module>
    @pytest.fixture(autouse=True)
E   NameError: name 'pytest' is not defined

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!

@nicoddemus nicoddemus merged commit cc588d1 into pytest-dev:main Apr 3, 2024
24 checks passed
@nicoddemus nicoddemus added the backport 8.2.x Apply on merged PRs, backports the changes to the 8.2.x branch label Apr 3, 2024
@MLopez-Ibanez MLopez-Ibanez deleted the patch-1 branch April 3, 2024 17:30
flying-sheep pushed a commit to flying-sheep/pytest that referenced this pull request Apr 9, 2024
hrfuller pushed a commit to hrfuller/pytest that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 8.2.x Apply on merged PRs, backports the changes to the 8.2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants