Skip to content

Commit 1a8269a

Browse files
Noman Arshadfacebook-github-bot
Noman Arshad
authored andcommitted
Replace blacklist with blocklist in test/run_test.py file. (pytorch#42011)
Summary: Fixes pytorch#41716 test/run_test.py file updated with an appropriate replacement for blacklist and whitelist. Pull Request resolved: pytorch#42011 Reviewed By: pbelevich Differential Revision: D22791836 Pulled By: malfet fbshipit-source-id: 8139649c5b70c876b711e25c33f3051ea8461063
1 parent e179966 commit 1a8269a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/run_test.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
'distributed/test_ddp_under_dist_autograd',
9595
]
9696

97-
WINDOWS_BLACKLIST = [
97+
WINDOWS_BLOCKLIST = [
9898
'distributed/nn/jit/test_instantiator',
9999
'distributed/nn/api/test_remote_module_spawn',
100100
'distributed/rpc/faulty_agent/test_dist_autograd_spawn',
@@ -112,7 +112,7 @@
112112
'distributed/test_ddp_under_dist_autograd',
113113
]
114114

115-
ROCM_BLACKLIST = [
115+
ROCM_BLOCKLIST = [
116116
'distributed/nn/jit/test_instantiator',
117117
'distributed/nn/api/test_remote_module_spawn',
118118
'distributed/rpc/faulty_agent/test_dist_autograd_spawn',
@@ -135,7 +135,7 @@
135135
'test_openmp',
136136
]
137137

138-
RUN_PARALLEL_BLACKLIST = [
138+
RUN_PARALLEL_BLOCKLIST = [
139139
'test_cpp_extensions_jit',
140140
'test_expecttest',
141141
'test_jit_disabled',
@@ -232,7 +232,7 @@ def run_test(executable, test_module, test_directory, options, *extra_unittest_a
232232
unittest_args = options.additional_unittest_args
233233
if options.verbose:
234234
unittest_args.append('--verbose')
235-
if test_module in RUN_PARALLEL_BLACKLIST:
235+
if test_module in RUN_PARALLEL_BLOCKLIST:
236236
unittest_args = [arg for arg in unittest_args if not arg.startswith('--run-parallel')]
237237
# Can't call `python -m unittest test_*` here because it doesn't run code
238238
# in `if __name__ == '__main__': `. So call `python test_*.py` instead.
@@ -433,9 +433,9 @@ def parse_args():
433433
' where you want to run all tests, but care more about some set, '
434434
'e.g. after making a change to a specific component')
435435
parser.add_argument(
436-
'--ignore-win-blacklist',
436+
'--ignore-win-blocklist',
437437
action='store_true',
438-
help='always run blacklisted windows tests')
438+
help='always run blocklisted windows tests')
439439
parser.add_argument(
440440
'--determine-from',
441441
help='File of affected source filenames to determine which tests to run.')
@@ -527,19 +527,19 @@ def get_selected_tests(options):
527527

528528
selected_tests = exclude_tests(options.exclude, selected_tests)
529529

530-
if sys.platform == 'win32' and not options.ignore_win_blacklist:
530+
if sys.platform == 'win32' and not options.ignore_win_blocklist:
531531
target_arch = os.environ.get('VSCMD_ARG_TGT_ARCH')
532532
if target_arch != 'x64':
533-
WINDOWS_BLACKLIST.append('cpp_extensions_aot_no_ninja')
534-
WINDOWS_BLACKLIST.append('cpp_extensions_aot_ninja')
535-
WINDOWS_BLACKLIST.append('cpp_extensions_jit')
536-
WINDOWS_BLACKLIST.append('jit')
537-
WINDOWS_BLACKLIST.append('jit_fuser')
533+
WINDOWS_BLOCKLIST.append('cpp_extensions_aot_no_ninja')
534+
WINDOWS_BLOCKLIST.append('cpp_extensions_aot_ninja')
535+
WINDOWS_BLOCKLIST.append('cpp_extensions_jit')
536+
WINDOWS_BLOCKLIST.append('jit')
537+
WINDOWS_BLOCKLIST.append('jit_fuser')
538538

539-
selected_tests = exclude_tests(WINDOWS_BLACKLIST, selected_tests, 'on Windows')
539+
selected_tests = exclude_tests(WINDOWS_BLOCKLIST, selected_tests, 'on Windows')
540540

541541
elif TEST_WITH_ROCM:
542-
selected_tests = exclude_tests(ROCM_BLACKLIST, selected_tests, 'on ROCm')
542+
selected_tests = exclude_tests(ROCM_BLOCKLIST, selected_tests, 'on ROCm')
543543

544544
return selected_tests
545545

0 commit comments

Comments
 (0)