From e6f56e70ce97a5178e52d6e49c8bb79027a1a525 Mon Sep 17 00:00:00 2001 From: Edward Amor Date: Tue, 12 Apr 2022 20:25:28 +0000 Subject: [PATCH] test: test isolation functions correctly --- .../cli/projects/test/tests/test_test.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/integration/cli/projects/test/tests/test_test.py b/tests/integration/cli/projects/test/tests/test_test.py index 32ec137a9f..aefea86734 100644 --- a/tests/integration/cli/projects/test/tests/test_test.py +++ b/tests/integration/cli/projects/test/tests/test_test.py @@ -1,2 +1,31 @@ +import pytest + + +@pytest.fixture(scope="session") +def alice(accounts): + yield accounts[0] + + +@pytest.fixture(scope="session") +def bob(accounts): + yield accounts[1] + + +@pytest.fixture(scope="module", autouse=True) +def setup(alice, bob): + alice.transfer(bob, 10**18) + + def test_test(): assert True + + +def test_isolation_first(alice, bob, chain): + assert chain.provider.get_block("latest").number == 1 + assert bob.balance == 1_000_001 * 10**18 + alice.transfer(bob, "1 ether") + + +def test_isolation_second(bob, chain): + assert chain.provider.get_block("latest").number == 1 + assert bob.balance == 1_000_001 * 10**18