Skip to content

Stop pytest from picking up non-test classes #395

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

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

dkropachev
Copy link
Collaborator

Some classes are not meant to be picked up.
But pytest does it and throw warning message when something goes wrong. One example of this issue:

PytestCollectionWarning: cannot collect test class 'TestCluster' because it has a __new__ constructor (from: tests/integration/standard/column_encryption/test_policies.py)
    class TestCluster(object):

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

Some classes are not meant to be picked up,
but pytest does it and throw warning message when something goes wrong.
One example of this issue:
PytestCollectionWarning: cannot collect test class 'TestCluster' because it has a __new__ constructor (from: tests/integration/standard/column_encryption/test_policies.py)
    class TestCluster(object):
@dkropachev dkropachev force-pushed the dk/make-pytest-ignore-non-test-classes branch from fc66a85 to 08e5980 Compare December 20, 2024 13:16
Copy link

@fruch fruch left a comment

Choose a reason for hiding this comment

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

LGTM

@dkropachev dkropachev merged commit dea4904 into master Dec 20, 2024
27 of 28 checks passed
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