File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,20 @@ check_print()
5858 fi
5959}
6060
61+ check_naive ()
62+ {
63+ # Check if there are any naive implementations not at start of test file
64+ for testfile in tests/test_* .py
65+ do
66+ last_naive=" $( grep -n ' def naive_' $testfile | tail -n 1 | awk -F: ' {print $1}' ) "
67+ first_test=" $( grep -n ' def test_' $testfile | head -n 1 | awk -F: ' {print $1}' ) "
68+ if [[ ! -z $last_naive && ! -z $first_test && $last_naive -gt $first_test ]]; then
69+ echo " Error: naive implementation found in the middle of $testfile line $last_naive "
70+ exit 1
71+ fi
72+ done
73+ }
74+
6175test_custom ()
6276{
6377 # export NUMBA_DISABLE_JIT=1
@@ -150,6 +164,7 @@ clean_up
150164check_black
151165check_flake
152166check_print
167+ check_naive
153168
154169if [[ $test_mode == " unit" ]]; then
155170 echo " Executing Unit Tests Only"
You can’t perform that action at this time.
0 commit comments