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

ENH: Consider warnings as errors when running pytest #157

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jhlegarreta
Copy link
Collaborator

@jhlegarreta jhlegarreta commented Jan 9, 2025

Consider warnings as errors when running pytest.

@jhlegarreta jhlegarreta force-pushed the TreatWarningsAsErrors branch 2 times, most recently from aeacf9c to f3842ff Compare January 9, 2025 23:10
@jhlegarreta jhlegarreta changed the title ENH: Treat warnings as errors ENH: Consider warnings as errors when running pytest Jan 9, 2025
@jhlegarreta jhlegarreta force-pushed the TreatWarningsAsErrors branch 2 times, most recently from ed057ad to aa05a60 Compare January 9, 2025 23:57
@effigies
Copy link
Member

I would suggest not adding -Werror for the min runs. Warnings are expected with old versions.

@jhlegarreta jhlegarreta force-pushed the TreatWarningsAsErrors branch from aa05a60 to 74ca019 Compare January 10, 2025 00:03
@jhlegarreta
Copy link
Collaborator Author

jhlegarreta commented Jan 10, 2025

Tried different things here:

So ran out of ideas.

As for

I would suggest not adding -Werror for the min runs. Warnings are expected with old versions.

If you have a suggestion to avoid applying the option for them, I would be happy to add it.

@jhlegarreta jhlegarreta force-pushed the TreatWarningsAsErrors branch from 74ca019 to a540f1c Compare January 10, 2025 00:07
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.87%. Comparing base (a6bcd48) to head (c51dc3a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #157      +/-   ##
==========================================
- Coverage   65.25%   64.87%   -0.38%     
==========================================
  Files          25       23       -2     
  Lines        2674     2648      -26     
  Branches      420      367      -53     
==========================================
- Hits         1745     1718      -27     
- Misses        812      816       +4     
+ Partials      117      114       -3     
Flag Coverage Δ
unittests 64.87% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@effigies
Copy link
Member

You could do something like this in tox.ini:

command =
    pytest ... \
    !min:  -Werror \
      {posargs:-n auto}

@jhlegarreta jhlegarreta force-pushed the TreatWarningsAsErrors branch from a540f1c to 0e11f80 Compare January 10, 2025 00:29
Consider warnings as errors when running `pytest`: exclude the `min`
dependencies configuration as warnings are expected with older versions.
@jhlegarreta jhlegarreta force-pushed the TreatWarningsAsErrors branch from 0e11f80 to 5a45007 Compare January 10, 2025 00:29
tox.ini Outdated Show resolved Hide resolved
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