diff --git a/tests/test_dig_aws.py b/tests/test_dig_aws.py index 87d0563..f0104e1 100644 --- a/tests/test_dig_aws.py +++ b/tests/test_dig_aws.py @@ -97,7 +97,7 @@ def test_lookup(test_dig): with pytest.raises(ValueError) as e: test_dig.lookup("what are you talking about") - assert e.startswith("Wrong IP or CIDR format") + assert str(e.value).startswith("Wrong IP or CIDR format") def test_response_plain_print(test_dig, capsys): diff --git a/tests/test_get_aws_ip_ranges_json.py b/tests/test_get_aws_ip_ranges_json.py index 76ccefa..db6a02c 100644 --- a/tests/test_get_aws_ip_ranges_json.py +++ b/tests/test_get_aws_ip_ranges_json.py @@ -83,4 +83,4 @@ def test_get_aws_ip_ranges_invalid_status(mocker, fs, create_cache_dir) -> None: with pytest.raises(digaws.UnexpectedRequestException) as e: digaws.get_aws_ip_ranges() - assert e.match("^Unexpected response from") + assert str(e.value).startswith("Unexpected response from")