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

Introduce catch_warnings fixture #844

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all 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 setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ norecursedirs =
dist
build
addopts =
--strict
--strict-markers
--doctest-modules
--durations=0
--color=yes
Expand Down
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import warnings
from pathlib import Path

import pytest

from pl_bolts.utils.stability import UnderReviewWarning

# GitHub Actions use this path to cache datasets.
# Use `datadir` fixture where possible and use `DATASETS_PATH` in
# `pytest.mark.parametrize()` where you cannot use `datadir`.
Expand All @@ -12,3 +15,11 @@
@pytest.fixture(scope="session")
def datadir():
return Path(DATASETS_PATH)


@pytest.fixture
def catch_warnings():
with warnings.catch_warnings():
warnings.simplefilter("error")
warnings.simplefilter("ignore", UnderReviewWarning)
yield