File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,15 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
148148 invgrep -R --exclude=* .pyc --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas
149149 RET=$(( $RET  +  $? )) ;  echo  $MSG  " DONE" 
150150
151+  #  Check that we use pytest.raises only as a context manager
152+  # 
153+  #  For any flake8-compliant code, the only way this regex gets
154+  #  matched is if there is no "with" statement preceding "pytest.raises"
155+  MSG=' Check for pytest.raises as context manager (a line starting with `pytest.raises` is invalid, needs a `with` to precede it)' ;  echo  $MSG 
156+  MSG=' TODO: This check is currently skipped because so many files fail this. Please enable when all are corrected (xref gh-24332)' ;  echo  $MSG 
157+  #  invgrep -R --include '*.py' -E '[[:space:]] pytest.raises' pandas/tests
158+  #  RET=$(($RET + $?)) ; echo $MSG "DONE"
159+ 
151160 MSG=' Check that no file in the repo contains tailing whitespaces' ;  echo  $MSG 
152161 invgrep --exclude=" *.svg" " \s$" * 
153162 RET=$(( $RET  +  $? )) ;  echo  $MSG  " DONE" 
                         You can’t perform that action at this time. 
           
                  
0 commit comments