diff --git a/tests/test_mp_proxy_auxiliary.py b/tests/test_mp_proxy_auxiliary.py index 5a8cdf23..9da8cc7c 100644 --- a/tests/test_mp_proxy_auxiliary.py +++ b/tests/test_mp_proxy_auxiliary.py @@ -301,10 +301,12 @@ def test_getattr_physical_cchannel( proxy_inst.lock.__exit__.assert_not_called() # attribute does not exist - with pytest.raises(AttributeError, match="object has no attribute does_not_exist"): + with pytest.raises( + AttributeError, match="object has no attribute 'does_not_exist'" + ): mock_aux1.channel.does_not_exist - proxy_inst.lock.__enter__.assert_not_called() - proxy_inst.lock.__exit__.assert_not_called() + proxy_inst.lock.__enter__.assert_called_once() + proxy_inst.lock.__exit__.assert_called_once() def test_create_auxiliary_instance(mp_proxy_auxiliary_inst, caplog): diff --git a/tests/test_proxy_auxiliary.py b/tests/test_proxy_auxiliary.py index 8bd372f0..e3d3af02 100644 --- a/tests/test_proxy_auxiliary.py +++ b/tests/test_proxy_auxiliary.py @@ -184,10 +184,12 @@ def test_getattr_physical_cchannel( proxy_inst.lock.__exit__.assert_not_called() # attribute does not exist - with pytest.raises(AttributeError, match="object has no attribute does_not_exist"): + with pytest.raises( + AttributeError, match="object has no attribute 'does_not_exist'" + ): mock_aux1.channel.does_not_exist - proxy_inst.lock.__enter__.assert_not_called() - proxy_inst.lock.__exit__.assert_not_called() + proxy_inst.lock.__enter__.assert_called_once() + proxy_inst.lock.__exit__.assert_called_once() def test_get_proxy_con_pre_load(mocker, cchannel_inst):