You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returns the path to the feature folder (feat_xxxx) or check folder (check_xxxx)
5
+
6
+
- type_stub_cache_path
7
+
Is used to install the type stubs for the given portboard and version and cache it for 24 hours to speed up tests
8
+
Returns the path to the cache folder
9
+
10
+
- install_stubs
11
+
is the function that does the actual pip install to a folder
12
+
13
+
- copy_type_stubs
14
+
copies the type stubs from the cache to the feature folder
15
+
16
+
- pytest_runtest_makereport
17
+
is used to add the caplog to the test report to make it avaialble to VSCode test explorer
18
+
19
+
"""
20
+
1
21
importshutil
2
22
importsubprocess
3
23
importtime
4
24
frompathlibimportPath
5
25
26
+
importfasteners
6
27
importpytest
7
28
fromloguruimportloggeraslog
8
29
@@ -11,7 +32,19 @@
11
32
12
33
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
13
34
defpytest_runtest_makereport(item, call):
14
-
# execute all other hooks to obtain the report object
35
+
"""
36
+
pytest_runtest_makereport hook implementation.
37
+
38
+
Executes all other hooks to obtain the report object. Looks at actual failing test calls, not setup/teardown. Adds the caplog errors and warnings to the report.
39
+
40
+
Args:
41
+
item: The pytest Item object.
42
+
call: The pytest CallInfo object.
43
+
44
+
Returns:
45
+
The pytest Report object.
46
+
47
+
"""
15
48
outcome=yield
16
49
report=outcome.get_result()
17
50
@@ -41,37 +74,67 @@ def type_stub_cache_path(
41
74
request: pytest.FixtureRequest,
42
75
) ->Path:
43
76
"""
44
-
Installs a copy of the type stubs for the given portboard and version.
45
-
Returns the path to the cache folder
77
+
Installs a copy of the type stubs for the given portboard and version. Returns the path to the cache folder.
78
+
79
+
Args:
80
+
portboard: The portboard.
81
+
version: The version.
82
+
stub_source: The stub source.
83
+
pytestconfig: The pytest Config object.
84
+
request: The pytest FixtureRequest object.
85
+
86
+
Returns:
87
+
Path: The path to the cache folder.
46
88
"""
47
89
48
90
log.trace(f"setup install type_stubs to cache: {stub_source}, {version}, {portboard}")
0 commit comments