Skip to content

Commit

Permalink
pytest: add a more verbose warning for yul compilation if ran with -vv
Browse files Browse the repository at this point in the history
  • Loading branch information
danceratopz committed Jun 27, 2023
1 parent be8bb66 commit 55293e2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
Pytest (plugin) definitions local to Cancun tests.
Pytest definitions applied to all tests.
"""
import warnings

import pytest


def pytest_collection_modifyitems(items):
def pytest_collection_modifyitems(items, config):
"""
Modify tests post collection.
Expand All @@ -16,5 +16,8 @@ def pytest_collection_modifyitems(items):
"""
for item in items:
if "Cancun" in item.name and "yul" in item.fixturenames:
warnings.warn("Compiling Yul source with Shanghai, not Cancun.")
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"))

0 comments on commit 55293e2

Please sign in to comment.