@@ -32,12 +32,12 @@ def test_request_to_mock_server(mock_server):
32
32
33
33
34
34
def test_nonexistent_executable ():
35
- with pytest .raises (OSError , match = "No such file or directory " ):
35
+ with pytest .raises (OSError , match = r"(?i) file" ):
36
36
ExecutingMountebankServer (executable = str (Path () / "no" / "such" / "path" ), port = 2526 )
37
37
38
38
39
39
def test_non_executable ():
40
- with pytest .raises (OSError , match = "No such file or directory " ):
40
+ with pytest .raises (OSError , match = r"(?i) file|executable " ):
41
41
ExecutingMountebankServer (executable = str (Path () / "README.md" ), port = 2526 )
42
42
43
43
@@ -130,15 +130,12 @@ def test_remove_and_replace_impostor_from_running_server(mock_server):
130
130
other_impostors = [i for i in initial if i .name != "egg" ]
131
131
server .delete_impostor (egg_impostor )
132
132
133
- with pytest .raises (httpx .ConnectError , match = "Connection refused " ):
133
+ with pytest .raises (httpx .ConnectError , match = r"(?i)connection " ):
134
134
httpx .get (f"{ egg_impostor .url } /test" )
135
135
responses = [httpx .get (f"{ i .url } /test" ) for i in other_impostors ]
136
136
assert_that (
137
137
responses ,
138
- contains_inanyorder (
139
- is_response ().with_body ("sausage" ),
140
- is_response ().with_body ("chips" ),
141
- ),
138
+ contains_inanyorder (is_response ().with_body ("sausage" ), is_response ().with_body ("chips" )),
142
139
)
143
140
144
141
# Reset the server from the initial impostors, and check it's back to normal
0 commit comments