From 3313a634c2e75a553bdb6832c117516678dbf262 Mon Sep 17 00:00:00 2001 From: stephen cyron Date: Thu, 14 Apr 2022 06:24:26 -0400 Subject: [PATCH] Added one test with nocompile --- tests/cli/test_console.py | 14 ++++++++++++++ tests/conftest.py | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/tests/cli/test_console.py b/tests/cli/test_console.py index 41c160600..f2f1ed78f 100644 --- a/tests/cli/test_console.py +++ b/tests/cli/test_console.py @@ -41,6 +41,20 @@ def test_multiple_commands(testproject, accounts, history, console): assert len(history) == 2 assert testproject.BrownieTester[0].owner() == accounts[0] +def test_multiple_commands_with_nocompile(testproject_nocompile, accounts, history, console): + shell = console(testproject_nocompile) + _run_cmd( + shell, + [ + "config", + "accounts[0].deploy(BrownieTester, True)", + "BrownieTester[0].doNothing()", + 'accounts.add("0x416b8a7d9290502f5661da81f0cf43893e3d19cb9aea3c426cfb36e8186e9c09")', + ], + ) + assert len(history) == 2 + assert testproject_nocompile.BrownieTester[0].owner() == accounts[0] + def test_multiline_commands(accounts, history, console): shell = console() diff --git a/tests/conftest.py b/tests/conftest.py index a7f2bd754..93a2f4423 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -180,6 +180,14 @@ def testproject(_project_factory, project, tmp_path): os.chdir(path) return project.load(path, "TestProject") +# same as function above but doesn't compile +@pytest.fixture +def testproject_nocompile(_project_factory, project, tmp_path): + path = tmp_path.joinpath("testproject") + _copy_all(_project_factory, path) + os.chdir(path) + return project.load(path, "TestProject", compile=False) + @pytest.fixture def tp_path(testproject):