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

STY: Enforce ruff/flake8-pytest-style rules (PT) #1356

Merged
merged 9 commits into from
Sep 25, 2024

Conversation

DimitriPapadopoulos
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.37%. Comparing base (2532132) to head (e58e2ea).
Report is 10 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1356   +/-   ##
=======================================
  Coverage   95.36%   95.37%           
=======================================
  Files         207      207           
  Lines       29680    29674    -6     
  Branches     4992     4993    +1     
=======================================
- Hits        28305    28301    -4     
+ Misses        935      933    -2     
  Partials      440      440           

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

Comment on lines 143 to 146
except SystemExit:
pass
else:
assert False, 'argparse exits on --help. If changing to another parser, update test.'
pytest.fail('argparse exits on --help. If changing to another parser, update test.')
Copy link
Member

Choose a reason for hiding this comment

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

I think the whole try/except/else block should be:

with pytest.raises(SystemExit):
    main()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I (think I) applied your suggestion.

nibabel/tests/test_tripwire.py Outdated Show resolved Hide resolved
DimitriPapadopoulos and others added 9 commits September 24, 2024 19:56
PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple`
PT015 Assertion always fails, replace with `pytest.fail()`
PT017 Found assertion on exception `err` in `except` block, use `pytest.raises()` instead
PT022 No teardown in fixture `db`, use `return` instead of `yield`
PT027 Use `pytest.raises` instead of unittest-style `assertRaises`
@effigies
Copy link
Member

Failures seem related to scipy/scipy#21623.

@effigies effigies merged commit b614330 into nipy:master Sep 25, 2024
46 of 49 checks passed
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