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

adding config file for filtering warnings #63

Closed
wants to merge 2 commits into from
Closed

Conversation

kzqureshi
Copy link
Contributor

'pytest.ini' file has been added to filter the DeprecationWarning

@kzqureshi kzqureshi requested a review from lang-m March 23, 2024 08:35
@lang-m
Copy link
Member

lang-m commented Apr 24, 2024

@kzqureshi Could you please move the pytest configuration to pyproject.toml (https://docs.pytest.org/en/7.1.x/reference/customize.html#pyproject-toml)

Comment on lines +2 to +3
python_files = test_*.py
python_functions = test_*
Copy link
Member

Choose a reason for hiding this comment

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

Are these two lines really require?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes in pytest.ini these are required because these two lines are selecting all the files with test names and then applying the ignore command on the tests.

python_files = test_*.py
python_functions = test_*
filterwarnings =
ignore::DeprecationWarning:traitlets.*:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ignore::DeprecationWarning:traitlets.*:
error
ignore::DeprecationWarning:traitlets.*:

I would like to convert all other warnings to errors (https://docs.pytest.org/en/7.1.x/how-to/capture-warnings.html#controlling-warnings)

python_files = test_*.py
python_functions = test_*
filterwarnings =
ignore::DeprecationWarning:traitlets.*:
Copy link
Member

Choose a reason for hiding this comment

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

[Note for myself] re-check if the warning is suppressed locally, may need further changes (pytest -W error -W 'ignore: :DeprecationWarning' seems to work, the warning is raised from dependencies from k3d)

@lang-m
Copy link
Member

lang-m commented May 9, 2024

Closing in favour of #66

@lang-m lang-m closed this May 9, 2024
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.

2 participants