Skip to content

Commit

Permalink
Mock fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Jan 18, 2024
1 parent 776a4ff commit ef4f328
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions tests/integration_tests/cli/test_integration_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
from ert.storage import open_storage


@pytest.fixture(name="mock_cli_run")
def fixture_mock_cli_run(monkeypatch):
mocked_monitor = Mock()
mocked_thread_start = Mock()
mocked_thread_join = Mock()
monkeypatch.setattr(threading.Thread, "start", mocked_thread_start)
monkeypatch.setattr(threading.Thread, "join", mocked_thread_join)
yield mocked_monitor, mocked_thread_join, mocked_thread_start


@pytest.mark.scheduler
@pytest.mark.integration_test
def test_runpath_file(tmpdir, source_root, try_queue_and_scheduler, monkeypatch):
Expand Down Expand Up @@ -226,9 +216,7 @@ def test_ensemble_evaluator_disable_monitoring(

@pytest.mark.scheduler
@pytest.mark.integration_test
def test_cli_test_run(
tmpdir, source_root, mock_cli_run, try_queue_and_scheduler, monkeypatch
):
def test_cli_test_run(tmpdir, source_root, try_queue_and_scheduler, monkeypatch):
shutil.copytree(
os.path.join(source_root, "test-data", "poly_example"),
os.path.join(str(tmpdir), "poly_example"),
Expand All @@ -239,11 +227,6 @@ def test_cli_test_run(
parsed = ert_parser(parser, [TEST_RUN_MODE, "poly_example/poly.ert"])
run_cli(parsed)

monitor_mock, thread_join_mock, thread_start_mock = mock_cli_run
monitor_mock.assert_called_once()
thread_join_mock.assert_called_once()
thread_start_mock.assert_has_calls([[call(), call()]])


@pytest.mark.scheduler
@pytest.mark.integration_test
Expand Down

0 comments on commit ef4f328

Please sign in to comment.