diff --git a/tests/conftest.py b/tests/conftest.py index 58db8e5cbd..7311578461 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,24 +9,24 @@ from slither import Slither -def pytest_configure(config): +def pytest_configure(config) -> None: """Create a temporary directory for the tests to use.""" if is_master(): config.stash["shared_directory"] = tempfile.mkdtemp() -def pytest_unconfigure(config): +def pytest_unconfigure(config) -> None: """Remove the temporary directory after the tests are done.""" if is_master(): shutil.rmtree(config.stash["shared_directory"]) -def pytest_configure_node(node): +def pytest_configure_node(node) -> None: """Configure each worker node with the shared directory.""" node.workerinput["shared_directory"] = node.config.stash["shared_directory"] -def is_master(): +def is_master() -> bool: """Returns True if the current process is the master process (which does not have a worker id).""" return os.environ.get("PYTEST_XDIST_WORKER") is None diff --git a/tests/unit/core/test_literal.py b/tests/unit/core/test_literal.py index 569b6eec73..2622090c54 100644 --- a/tests/unit/core/test_literal.py +++ b/tests/unit/core/test_literal.py @@ -89,3 +89,10 @@ def test_not_equal_to_non_literal(self): lit = Literal("100", "uint256") assert lit != "100" assert lit != 100 + assert lit != None + + def test_equal_none_subdenomination(self): + """Literals with None and absent subdenomination should be equal.""" + lit1 = Literal("100", "uint256") + lit2 = Literal("100", "uint256", subdenomination=None) + assert lit1 == lit2