Skip to content

Commit

Permalink
test: try fix weird issue
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Jun 13, 2024
1 parent 6968a15 commit 10a9b37
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ethpm_types import ContractType
from packaging.version import Version

from ape_solidity.compiler import logger
from ape_solidity.exceptions import IndexOutOfBoundsError

EXPECTED_NON_SOLIDITY_ERR_MSG = "Unable to compile 'RandomVyperFile.vy' using Solidity compiler."
Expand Down Expand Up @@ -690,8 +691,17 @@ def test_enrich_error_when_builtin(project, owner, connection):
def test_flatten(project, compiler, caplog):
path = project.sources.lookup("contracts/Imports.sol")
with caplog.at_level(LogLevel.WARNING):
compiler.flatten_contract(path, project=project)
actual = caplog.messages[-1]
res = compiler.flatten_contract(path, project=project)

# Ensure logger was flushed.
for handler in logger._logger.handlers:
handler.flush()

messages = caplog.messages
if len(messages) == 0:
pytest.fail(f"Missing captured logs for conflicting license. Result: {res}")

actual = messages[-1]
expected = (
"Conflicting licenses found: 'LGPL-3.0-only, MIT'. "
"Using the root file's license 'MIT'."
Expand Down

0 comments on commit 10a9b37

Please sign in to comment.