File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -47,17 +47,6 @@ def set_rng_seed(seed):
4747TEST_WITH_SLOW = os .getenv ('PYTORCH_TEST_WITH_SLOW' , '0' ) == '1'
4848
4949
50- parser = argparse .ArgumentParser (add_help = False )
51- parser .add_argument ('--accept' , action = 'store_true' )
52- args , remaining = parser .parse_known_args ()
53- if not ACCEPT :
54- ACCEPT = args .accept
55- for i , arg in enumerate (sys .argv ):
56- if arg == '--accept' :
57- del sys .argv [i ]
58- break
59-
60-
6150class MapNestedTensorObjectImpl (object ):
6251 def __init__ (self , tensor_map_fn ):
6352 self .tensor_map_fn = tensor_map_fn
@@ -119,8 +108,9 @@ def _get_expected_file(self, name=None):
119108 if not ACCEPT and not os .path .exists (expected_file ):
120109 raise RuntimeError (
121110 f"No expect file exists for { os .path .basename (expected_file )} in { expected_file } ; "
122- "to accept the current output, run:\n "
123- f"python { __main__ .__file__ } { munged_id } --accept" )
111+ "to accept the current output, re-run the failing test after setting the EXPECTTEST_ACCEPT "
112+ "env variable. For example: EXPECTTEST_ACCEPT=1 pytest test/test_models.py -k alexnet"
113+ )
124114
125115 return expected_file
126116
You can’t perform that action at this time.
0 commit comments