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

tests: change how pytest adds markers #246

Merged
merged 11 commits into from
Sep 4, 2024

Conversation

mariuswinger
Copy link
Contributor

@mariuswinger mariuswinger commented Sep 3, 2024

Why is this pull request needed?

The old setup didn't work particularly well/was buggy.

What does this pull request change?

Markers are automatically added based on the parent test directory.
pytest --unit and pytest runs unit tests, while pytest --integration runs integration tests. Finally, pytest --unit --integration runs both. Furthermore, one can use markers to select the appropriate tests even quicker: e.g. pytest -m integration, which skips collecting all tests and just collects integration tests.

Also, pre-commit was failing on main, so I had to make some additional changes in order to make it run successfully. The state of this repo right now ...

Issues related to this change:

None.

@mariuswinger mariuswinger requested a review from a team as a code owner September 3, 2024 17:12
Copy link
Contributor

@sebastianvitterso sebastianvitterso left a comment

Choose a reason for hiding this comment

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

I can dig it

api/src/tests/conftest.py Outdated Show resolved Hide resolved
api/src/common/exceptions.py Outdated Show resolved Hide resolved
api/src/common/logger_level.py Outdated Show resolved Hide resolved
@mariuswinger mariuswinger merged commit 532f123 into main Sep 4, 2024
7 checks passed
@mariuswinger mariuswinger deleted the tests/fix-conftest-pytest-marks branch September 4, 2024 09:46
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