From 55293e2dbd3f5fc78d6f6d77a738651131b82383 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Tue, 27 Jun 2023 15:04:51 +0200 Subject: [PATCH] pytest: add a more verbose warning for yul compilation if ran with -vv --- tests/conftest.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index de80ed2829..25a7ef24ca 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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. @@ -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"))