Skip to content

Commit 2f6d608

Browse files
authored
[test] Test params should not start with _. NFC (#23510)
The params names are implicitly joined to the test name with `_`.
1 parent 39891da commit 2f6d608

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

test/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ def parameterize(func, parameters):
792792
test functions.
793793
"""
794794
prev = getattr(func, '_parameterize', None)
795+
assert not any(p.startswith('_') for p in parameters)
795796
if prev:
796797
# If we're parameterizing 2nd time, construct a cartesian product for various combinations.
797798
func._parameterize = {

test/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7016,7 +7016,7 @@ def test(args=None, asserts=False):
70167016

70177017
@parameterized({
70187018
'': ([],),
7019-
'_files': (['-DUSE_FILES'],)
7019+
'files': (['-DUSE_FILES'],)
70207020
})
70217021
def test_FS_exports(self, extra_args):
70227022
# these used to be exported, but no longer are by default

test/test_other.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ def test_cmake_explicit_generator(self):
999999
@requires_ninja
10001000
@parameterized({
10011001
'': [[]],
1002-
'_no_gnu': [['-DNO_GNU_EXTENSIONS=1']],
1002+
'no_gnu': [['-DNO_GNU_EXTENSIONS=1']],
10031003
})
10041004
def test_cmake_with_embind_cpp11_mode(self, args):
10051005
# Use ninja generator here since we assume its always installed on our build/test machines.
@@ -1022,7 +1022,7 @@ def test_cmake_bitcode_static_libraries(self):
10221022

10231023
@parameterized({
10241024
'': ['0'],
1025-
'_suffix': ['1'],
1025+
'suffix': ['1'],
10261026
})
10271027
def test_cmake_static_lib(self, custom):
10281028
# Test that one is able to use custom suffixes for static libraries.
@@ -14970,8 +14970,8 @@ def test_standalone_whole_archive(self):
1497014970

1497114971
@parameterized({
1497214972
'': ([],),
14973-
'_single_file': (['-sSINGLE_FILE'],),
14974-
'_single_file_es6': (['-sSINGLE_FILE', '-sEXPORT_ES6', '--extern-post-js', test_file('modularize_post_js.js')],),
14973+
'single_file': (['-sSINGLE_FILE'],),
14974+
'single_file_es6': (['-sSINGLE_FILE', '-sEXPORT_ES6', '--extern-post-js', test_file('modularize_post_js.js')],),
1497514975
})
1497614976
def test_proxy_to_worker(self, args):
1497714977
self.do_runf('hello_world.c', emcc_args=['--proxy-to-worker'] + args)

0 commit comments

Comments
 (0)