File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ OPTION:
4545 --skip-list SKIPLIST
4646 --extra-skip-list-suffixes SEMICOLON-SEPARATED LIST OF SUFFIXES
4747 --select-from-file SELECTFILE
48+ --test-expr EXPRESSION
4849"
4950
5051err () {
@@ -86,6 +87,7 @@ TRITON_TEST_IGNORE_ERRORS=false
8687SKIP_PIP=false
8788SKIP_PYTORCH=false
8889TEST_UNSKIP=false
90+ TRITON_TEST_EXPRESSION=" "
8991
9092while (( $# != 0 )) ; do
9193 case " $1 " in
@@ -273,6 +275,10 @@ while (( $# != 0 )); do
273275 TRITON_TEST_SELECTFILE=" $( realpath " $2 " ) "
274276 shift 2
275277 ;;
278+ --test-expr)
279+ TRITON_TEST_EXPRESSION=" $2 "
280+ shift 2
281+ ;;
276282 --help)
277283 echo " $HELP "
278284 exit 0
@@ -342,12 +348,18 @@ run_unit_tests() {
342348}
343349
344350run_pytest_command () {
351+ local pytest_args=(" $@ " )
352+
353+ if [[ -n " $TRITON_TEST_EXPRESSION " ]]; then
354+ pytest_args+=(-k " $TRITON_TEST_EXPRESSION " )
355+ fi
356+
345357 if [[ -n " $TRITON_TEST_SELECTFILE " ]]; then
346- if pytest " $@ " --collect-only > /dev/null 2>&1 ; then
347- pytest " $@ "
358+ if pytest " ${pytest_args[@]} " --collect-only > /dev/null 2>&1 ; then
359+ pytest " ${pytest_args[@]} "
348360 fi
349361 else
350- pytest " $@ "
362+ pytest " ${pytest_args[@]} "
351363 fi
352364}
353365
You can’t perform that action at this time.
0 commit comments