Skip to content

Commit 4af0bc2

Browse files
committed
Windows messages differ.
1 parent b34d8f0 commit 4af0bc2

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tests/integration/behaviors/test_behaviors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_wait(mock_server):
1717
with mock_server(imposter), Timer() as timer:
1818
httpx.get(str(imposter.url))
1919

20-
assert_that(timer.elapsed, between(0.1, 0.25))
20+
assert_that(timer.elapsed, between(0.1, 0.3))
2121

2222

2323
def test_wait_function(mock_server):

tests/integration/test_server.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def test_request_to_mock_server(mock_server):
3232

3333

3434
def test_nonexistent_executable():
35-
with pytest.raises(OSError, match="No such file or directory"):
35+
with pytest.raises(OSError, match=r"(?i)file"):
3636
ExecutingMountebankServer(executable=str(Path() / "no" / "such" / "path"), port=2526)
3737

3838

3939
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"):
4141
ExecutingMountebankServer(executable=str(Path() / "README.md"), port=2526)
4242

4343

@@ -130,15 +130,12 @@ def test_remove_and_replace_impostor_from_running_server(mock_server):
130130
other_impostors = [i for i in initial if i.name != "egg"]
131131
server.delete_impostor(egg_impostor)
132132

133-
with pytest.raises(httpx.ConnectError, match="Connection refused"):
133+
with pytest.raises(httpx.ConnectError, match=r"(?i)connection"):
134134
httpx.get(f"{egg_impostor.url}/test")
135135
responses = [httpx.get(f"{i.url}/test") for i in other_impostors]
136136
assert_that(
137137
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")),
142139
)
143140

144141
# Reset the server from the initial impostors, and check it's back to normal

0 commit comments

Comments
 (0)