Skip to content

Commit

Permalink
pytest: compile Yul with --target-version shanghai when fork is cancun
Browse files Browse the repository at this point in the history
  • Loading branch information
danceratopz committed Jun 27, 2023
1 parent 8636cf6 commit be8bb66
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Pytest (plugin) definitions local to Cancun tests.
"""
import warnings

import pytest


def pytest_collection_modifyitems(items):
"""
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:
warnings.warn("Compiling Yul source with Shanghai, not Cancun.")
item.add_marker(pytest.mark.compile_yul_with("Shanghai"))

0 comments on commit be8bb66

Please sign in to comment.