File tree 4 files changed +13
-1
lines changed
4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 10
10
.python-version
11
11
build /
12
12
dist /
13
+ .idea /
Original file line number Diff line number Diff line change @@ -28,3 +28,4 @@ trio-typing==0.10.0
28
28
trustme == 1.1.0 ; python_version < '3.9'
29
29
trustme == 1.2.0 ; python_version >= '3.9'
30
30
uvicorn == 0.32.1
31
+ blockbuster == 1.5.10
Original file line number Diff line number Diff line change 7
7
8
8
import pytest
9
9
import trustme
10
+ from blockbuster import blockbuster_ctx
10
11
from cryptography .hazmat .backends import default_backend
11
12
from cryptography .hazmat .primitives .serialization import (
12
13
BestAvailableEncryption ,
31
32
}
32
33
33
34
35
+ @pytest .fixture (autouse = True )
36
+ def blockbuster ():
37
+ with blockbuster_ctx () as bb :
38
+ bb .functions ["os.stat" ].can_block_in ("/mimetypes.py" , "init" )
39
+ yield bb
40
+
41
+
34
42
@pytest .fixture (scope = "function" , autouse = True )
35
43
def clean_environ ():
36
44
"""Keeps os.environ clean for every test without having to mock os.environ"""
Original file line number Diff line number Diff line change 3
3
# https://url.spec.whatwg.org/
4
4
5
5
import json
6
+ from pathlib import Path
6
7
7
8
import pytest
8
9
9
10
from httpx ._urlparse import urlparse
10
11
11
12
# URL test cases from...
12
13
# https://github.com/web-platform-tests/wpt/blob/master/url/resources/urltestdata.json
13
- with open ("tests/models/whatwg.json" , "r" , encoding = "utf-8" ) as input :
14
+ whatwg_path = Path (__file__ ).parent .parent / "models" / "whatwg.json"
15
+ with whatwg_path .open ("r" , encoding = "utf-8" ) as input :
14
16
test_cases = json .load (input )
15
17
test_cases = [
16
18
item
You can’t perform that action at this time.
0 commit comments