Skip to content

Warnings with pytest are fixed #223

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

Conversation

dmitry-lipetsk
Copy link
Collaborator

  1. [pytest.ini] testpaths has another format. It is a spaces separated list.

pytest warning:
PytestConfigWarning: No files were found in testpaths; consider removing or adjusting your testpaths configuration. Searching recursively from the current directory instead.

  1. pytest tries to find the test function in TestgresException class. Let's rename it to avoid this problem.

pytest warning:
PytestCollectionWarning: cannot collect test class 'TestgresException' because it has a init constructor (from: tests/test_simple.py)
class TestgresException(Exception):

Of course, we can add test=False in TestgresException but it is not a good solution.

1) [pytest.ini] testpaths has another format. It is a spaces separated list.

pytest warning:
PytestConfigWarning: No files were found in testpaths; consider removing or adjusting your testpaths configuration. Searching recursively from the current directory instead.

2) pytest tries to find the test function in TestgresException class. Let's rename it to avoid this problem.

pytest warning:
PytestCollectionWarning: cannot collect test class 'TestgresException' because it has a __init__ constructor (from: tests/test_simple.py)
    class TestgresException(Exception):

Of course, we can add __test__=False in TestgresException but it is not a good solution.
@dmitry-lipetsk
Copy link
Collaborator Author

@dmitry-lipetsk dmitry-lipetsk merged commit b597bf8 into postgrespro:master Mar 18, 2025
1 check 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.

1 participant