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

Configure pytest to fail on warnings #3903

Merged
merged 4 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/contrib_rerun_py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:

- name: Run unit tests
shell: bash
run: cd rerun_py/tests && pytest
run: cd rerun_py/tests && pytest -c ../pyproject.toml

- name: Run e2e test
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_and_test_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ jobs:
- name: Run unit tests
if: needs.set-config.outputs.RUN_TESTS == 'true'
shell: bash
run: cd rerun_py/tests && pytest
run: cd rerun_py/tests && pytest -c ../pyproject.toml

- name: Run e2e test
if: needs.set-config.outputs.RUN_TESTS == 'true'
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ py-lint:

# Run fast unittests
py-test:
python -m pytest -vv rerun_py/tests/unit/
python -m pytest -vv -c rerun_py/pyproject.toml rerun_py/tests/unit/

# Run tests on all supported Python versions (through nox)
py-test-allpy:
Expand Down
8 changes: 8 additions & 0 deletions rerun_py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,11 @@ include = ["rerun_sdk.pth", "rerun_sdk/rerun_demo/colmap_fiat.rrd"]
locked = true
name = "rerun_bindings" # name of the .so library that the Python module will import
python-packages = ["rerun_sdk/rerun", "rerun_sdk/rerun_demo"]

[tool.pytest.ini_options]
# These conform to Python's Warning Filter syntax:
# https://docs.python.org/3/library/warnings.html#warning-filter
filterwarnings = """
error
ignore::pytest.PytestUnraisableExceptionWarning
Copy link
Member

Choose a reason for hiding this comment

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

any more context why this one is ignored?

Copy link
Member Author

Choose a reason for hiding this comment

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

The context is that I've been lazy and discarded this error as what I initially (mis-)read as some internal Pytest stuff. It turns out they were caused by two nasty instance of us not closing files properly, which I now fixed.

Thanks for not letting me be lazy.

"""
Loading