diff --git a/tests/conftest.py b/tests/conftest.py index 1763e9e..fae7cf7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -247,7 +247,7 @@ def mock_signer(get_random_checksum_address): @pytest.fixture(scope="module") @pytest.mark.usefixtures('testerchain', 'agency') -def porter(ursulas, mock_rest_middleware, test_registry): +def porter(ursulas, mock_rest_middleware, test_registry, module_mocker): porter = Porter( domain=TEMPORARY_DOMAIN, eth_endpoint=MOCK_ETH_PROVIDER_URI, @@ -259,6 +259,7 @@ def porter(ursulas, mock_rest_middleware, test_registry): verify_node_bonding=False, network_middleware=mock_rest_middleware, ) + module_mocker.patch.object(porter, "_get_ursula_version", return_value="7.4.0") yield porter porter.stop_learning_loop() diff --git a/tests/test_get_ursulas.py b/tests/test_get_ursulas.py index c596a5d..bedaa34 100644 --- a/tests/test_get_ursulas.py +++ b/tests/test_get_ursulas.py @@ -195,15 +195,12 @@ def test_get_ursulas_schema(get_random_checksum_address): @pytest.mark.parametrize("timeout", [None, 15, 20]) @pytest.mark.parametrize("duration", [None, 0, 60 * 60 * 24, 60 * 60 * 24 * 365]) def test_get_ursulas_python_interface( - mocker, porter, ursulas, timeout, duration, excluded_staker_address_for_duration_greater_than_0, ): - mocker.patch.object(porter, "_get_ursula_version", return_value="7.4.0") - # simple quantity = 4 ursulas_info = porter.get_ursulas(quantity=quantity) @@ -289,16 +286,12 @@ def test_get_ursulas_python_interface( @pytest.mark.parametrize("timeout", [None, 10, 20]) @pytest.mark.parametrize("duration", [None, 0, 60 * 60 * 24, 60 * 60 * 24 * 365]) def test_get_ursulas_web_interface( - mocker, - porter, porter_web_controller, ursulas, timeout, duration, excluded_staker_address_for_duration_greater_than_0, ): - mocker.patch.object(porter, "_get_ursula_version", return_value="7.4.0") - # Send bad data to assert error return response = porter_web_controller.get( "/get_ursulas", data=json.dumps({"bad": "input"})