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

feat(pytest): expose pytest fixtures and helpers for pdm plugins #1594

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

noirbizarre
Copy link
Member

Pull Request Check List

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

This PR follows the discussion #1571 and extract most pytest fixtures into their own public module pdm.pytest.

This allows pdm plugin developpers to benefits from them by importing them as a plugin:

pytest_plugins = [
    "pdm.pytest",
]

When relying on local file fixtures or any other configurable part, this is done by a dependency fixture.
The PDM test suite rely on those fixtures and configure them with PDM test fixtures (and so the PDM test suite is an usage example of those fixtures)

Given those fixtures are now in src, type hinting has been completed to comply with MyPy.
Documentation has been added in a dedicated page to differentiate from the real PDM API. Obviously, given I didn't write those, there might be some issues with the documentation and typing.

@frostming frostming merged commit 62d50c1 into pdm-project:main Jan 4, 2023
@frostming
Copy link
Collaborator

Thanks 🎉

@noirbizarre noirbizarre deleted the feature/pytest branch January 26, 2023 12:06
@j178 j178 mentioned this pull request Apr 3, 2024
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.

2 participants