Skip to content

Commit 6e7e28d

Browse files
committed
fix(consume): use parameter-based test discovery in pytest_generate_tests
Replace hardcoded function name check with parameter-based discovery for better maintainability. This avoids the design flaw of production code referencing specific test function names. Fixes unit test failures by checking for 'test_case' parameter presence instead of maintaining an allowlist of function names.
1 parent eb0ab02 commit 6e7e28d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pytest_plugins/consume/consume.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ def pytest_generate_tests(metafunc):
559559
if "cache" in sys.argv:
560560
return
561561

562-
# Only apply to simulator test functions to avoid conflicts with other consume simulators
563-
if metafunc.function.__name__ not in ["test_blockchain_via_engine", "test_via_rlp"]:
562+
# Only apply to functions that have a 'test_case' parameter (consume test functions)
563+
if "test_case" not in metafunc.fixturenames:
564564
return
565565

566566
test_cases = metafunc.config.test_cases

0 commit comments

Comments
 (0)