Skip to content

Commit 5023c38

Browse files
authored
Enable some more ruff check. NFC (#23471)
The unused argument in test_export_es6 should have been removed as part of #22598.
1 parent 8432190 commit 5023c38

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ lint.select = [
2727
]
2828

2929
lint.ignore = [
30-
"ARG002",
31-
"ARG005",
3230
"B006",
3331
"B011",
3432
"B018",
@@ -49,8 +47,10 @@ lint.ignore = [
4947
"PLW2901",
5048
]
5149
lint.per-file-ignores."emrun.py" = [ "PLE0704" ]
52-
lint.per-file-ignores."tools/ports/*.py" = [ "ARG001" ]
50+
lint.per-file-ignores."tools/ports/*.py" = [ "ARG001", "ARG005" ]
5351
lint.per-file-ignores."test/other/ports/*.py" = [ "ARG001" ]
52+
lint.per-file-ignores."test/parallel_testsuite.py" = [ "ARG002" ]
53+
lint.per-file-ignores."test/test_benchmark.py" = [ "ARG002" ]
5454
lint.mccabe.max-complexity = 51 # Recommended: 10
5555
lint.pylint.allow-magic-value-types = [
5656
"bytes",

test/test_browser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4406,9 +4406,9 @@ def test_webgl_vao_without_automatic_extensions(self):
44064406
# blitFramebuffer path on WebGL 2.0 (falls back to VAO on Firefox < 67)
44074407
'gl2_no_aa': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=0'],),
44084408
})
4409-
def test_webgl_offscreen_framebuffer_state_restoration(self, args, skip_vao=False):
4410-
cmd = args + ['-lGL', '-sOFFSCREEN_FRAMEBUFFER', '-DEXPLICIT_SWAP=1']
4411-
self.btest_exit('webgl_offscreen_framebuffer_swap_with_bad_state.c', args=cmd)
4409+
def test_webgl_offscreen_framebuffer_state_restoration(self, args):
4410+
base_args = ['-lGL', '-sOFFSCREEN_FRAMEBUFFER', '-DEXPLICIT_SWAP=1']
4411+
self.btest_exit('webgl_offscreen_framebuffer_swap_with_bad_state.c', args=base_args + args)
44124412

44134413
@parameterized({
44144414
'': ([],),
@@ -5017,7 +5017,7 @@ def test_offset_converter(self, args):
50175017
self.btest_exit('test_offset_converter.c', args=['-sUSE_OFFSET_CONVERTER', '-gsource-map'] + args)
50185018

50195019
# Tests emscripten_unwind_to_js_event_loop() behavior
5020-
def test_emscripten_unwind_to_js_event_loop(self, *args):
5020+
def test_emscripten_unwind_to_js_event_loop(self):
50215021
self.btest_exit('test_emscripten_unwind_to_js_event_loop.c')
50225022

50235023
@requires_wasm2js
@@ -5358,7 +5358,7 @@ def test_wasmfs_opfs_errors(self):
53585358
self.btest(test, args=args, expected='0')
53595359

53605360
@no_firefox('no 4GB support yet')
5361-
def test_emmalloc_memgrowth(self, *args):
5361+
def test_emmalloc_memgrowth(self):
53625362
if not self.is_4gb():
53635363
self.set_setting('MAXIMUM_MEMORY', '4GB')
53645364
self.btest_exit('emmalloc_memgrowth.cpp', args=['-sMALLOC=emmalloc', '-sALLOW_MEMORY_GROWTH=1', '-sABORTING_MALLOC=0', '-sASSERTIONS=2', '-sMINIMAL_RUNTIME=1'])

test/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ def test_emmalloc(self, *args):
795795

796796
@no_asan('ASan does not support custom memory allocators')
797797
@no_lsan('LSan does not support custom memory allocators')
798-
def test_emmalloc_usable_size(self, *args):
798+
def test_emmalloc_usable_size(self):
799799
self.set_setting('MALLOC', 'emmalloc')
800800
self.do_core_test('test_malloc_usable_size.c', regex=True)
801801

@@ -829,7 +829,7 @@ def test_emmalloc_trim(self):
829829
self.do_core_test('test_emmalloc_trim.c')
830830

831831
# Test case against https://github.com/emscripten-core/emscripten/issues/10363
832-
def test_emmalloc_memalign_corruption(self, *args):
832+
def test_emmalloc_memalign_corruption(self):
833833
self.set_setting('MALLOC', 'emmalloc')
834834
self.do_core_test('test_emmalloc_memalign_corruption.c')
835835

test/test_other.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,16 +425,12 @@ def test_export_es6_node_requires_import_meta(self):
425425
'-sENVIRONMENT=node', '-sEXPORT_ES6', '-sUSE_ES6_IMPORT_META=0'])
426426
self.assertContained('EXPORT_ES6 and ENVIRONMENT=*node* requires USE_ES6_IMPORT_META to be set', err)
427427

428-
@parameterized({
429-
'': (False,),
430-
'package_json': (True,),
431-
})
432428
@parameterized({
433429
'': ([],),
434430
# load a worker before startup to check ES6 modules there as well
435431
'pthreads': (['-pthread', '-sPTHREAD_POOL_SIZE=1'],),
436432
})
437-
def test_export_es6(self, package_json, args):
433+
def test_export_es6(self, args):
438434
self.run_process([EMCC, test_file('hello_world.c'), '-sEXPORT_ES6',
439435
'-o', 'hello.mjs'] + args)
440436
# In ES6 mode we use MODULARIZE, so we must instantiate an instance of the
@@ -5277,7 +5273,7 @@ def test_extra_opt_levels(self):
52775273
'O1': [['-O1']],
52785274
})
52795275
def test_fs_after_main(self, args):
5280-
self.do_runf('test_fs_after_main.c', 'Test passed.')
5276+
self.do_runf('test_fs_after_main.c', 'Test passed.', emcc_args=args)
52815277

52825278
def test_oz_size(self):
52835279
sizes = {}
@@ -13725,7 +13721,7 @@ def test_emscripten_console_log(self):
1372513721
self.do_run_in_out_file_test('emscripten_console_log.c', emcc_args=['--pre-js', test_file('emscripten_console_log_pre.js')])
1372613722

1372713723
# Tests emscripten_unwind_to_js_event_loop() behavior
13728-
def test_emscripten_unwind_to_js_event_loop(self, *args):
13724+
def test_emscripten_unwind_to_js_event_loop(self):
1372913725
self.do_runf('test_emscripten_unwind_to_js_event_loop.c')
1373013726

1373113727
@node_pthreads

0 commit comments

Comments
 (0)