Skip to content

Commit

Permalink
STY: Check pytest.raises is used context manager (pandas-dev#24332)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and Pingviinituutti committed Feb 28, 2019
1 parent 0c5766d commit 390be97
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
invgrep -R --exclude=*.pyc --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas
RET=$(($RET + $?)) ; echo $MSG "DONE"

# Check that we use pytest.raises only as a context manager
#
# For any flake8-compliant code, the only way this regex gets
# matched is if there is no "with" statement preceding "pytest.raises"
MSG='Check for pytest.raises as context manager (a line starting with `pytest.raises` is invalid, needs a `with` to precede it)' ; echo $MSG
MSG='TODO: This check is currently skipped because so many files fail this. Please enable when all are corrected (xref gh-24332)' ; echo $MSG
# invgrep -R --include '*.py' -E '[[:space:]] pytest.raises' pandas/tests
# RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Check that no file in the repo contains tailing whitespaces' ; echo $MSG
invgrep --exclude="*.svg" -RI "\s$" *
RET=$(($RET + $?)) ; echo $MSG "DONE"
Expand Down

0 comments on commit 390be97

Please sign in to comment.