diff --git a/docs/gen_test_case_reference.py b/docs/gen_test_case_reference.py index 8816b528303..6563ad43787 100644 --- a/docs/gen_test_case_reference.py +++ b/docs/gen_test_case_reference.py @@ -190,7 +190,9 @@ def run_collect_only(test_path: Path = source_directory) -> Tuple[str, str]: collect_only_command = f"fill --collect-only -q --until {DEV_FORKS[-1]} {test_path}" # strip out the test module output_lines = [ - line.split("::")[1] for line in output.split("\n") if line.startswith("tests/") + line.split("::")[1] + for line in output.split("\n") + if line.startswith("tests/") and "::" in line ] # prefix with required indent for admonition in MARKDOWN_TEST_CASES_TEMPLATE collect_only_output = "\n".join(" " + line for line in output_lines) diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000000..25a7ef24cae --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,23 @@ +""" +Pytest definitions applied to all tests. +""" +import warnings + +import pytest + + +def pytest_collection_modifyitems(items, config): + """ + Modify tests post collection. + + Here we override the default behavior of the `yul` fixture so that + solc compiles with shanghai instead of cancun (which is unavailable + in solc 0.8.20). + """ + for item in items: + if "Cancun" in item.name and "yul" in item.fixturenames: + if config.getoption("verbose") >= 2: + warnings.warn(f"Compiling Yul source for f{item.name} with Shanghai, not Cancun.") + else: + warnings.warn("Compiling Yul source with Shanghai, not Cancun.") + item.add_marker(pytest.mark.compile_yul_with("Shanghai"))