Skip to content

Commit f9ebfcc

Browse files
committed
Disabling tests for pook when testing Python 3.11
1 parent ae2848d commit f9ebfcc

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def read_version(package):
5757
"Programming Language :: Python :: 3.8",
5858
"Programming Language :: Python :: 3.9",
5959
"Programming Language :: Python :: 3.10",
60+
"Programming Language :: Python :: 3.11",
6061
"Programming Language :: Python :: Implementation :: CPython",
6162
"Programming Language :: Python :: Implementation :: PyPy",
6263
"Topic :: Software Development",

tests/main/test_pook.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
import pook
2-
import requests
1+
import platform
32

4-
from mocket.plugins.pook_mock_engine import MocketEngine
3+
if not platform.python_version().startswith("3.11."):
4+
# it looks like `pook` is not compatible with Python 3.11
5+
import pook
6+
import requests
57

6-
pook.set_mock_engine(MocketEngine)
8+
from mocket.plugins.pook_mock_engine import MocketEngine
79

10+
pook.set_mock_engine(MocketEngine)
811

9-
@pook.on
10-
def test_pook_engine():
12+
@pook.on
13+
def test_pook_engine():
1114

12-
url = "http://twitter.com/api/1/foobar"
13-
status = 404
14-
response_json = {"error": "foo"}
15+
url = "http://twitter.com/api/1/foobar"
16+
status = 404
17+
response_json = {"error": "foo"}
1518

16-
mock = pook.get(
17-
url,
18-
headers={"content-type": "application/json"},
19-
reply=status,
20-
response_json=response_json,
21-
)
22-
mock.persist()
19+
mock = pook.get(
20+
url,
21+
headers={"content-type": "application/json"},
22+
reply=status,
23+
response_json=response_json,
24+
)
25+
mock.persist()
2326

24-
requests.get(url)
25-
assert mock.calls == 1
27+
requests.get(url)
28+
assert mock.calls == 1
2629

27-
resp = requests.get(url)
28-
assert resp.status_code == status
29-
assert resp.json() == response_json
30-
assert mock.calls == 2
30+
resp = requests.get(url)
31+
assert resp.status_code == status
32+
assert resp.json() == response_json
33+
assert mock.calls == 2

0 commit comments

Comments
 (0)