This repository was archived by the owner on Apr 4, 2024. It is now read-only.
File tree 1 file changed +31
-0
lines changed
python/pytest-selfie/pytest_selfie
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ from typing import Optional , Tuple
1
2
import pytest
2
3
3
4
@@ -17,3 +18,33 @@ def pytest_addoption(parser):
17
18
@pytest .fixture
18
19
def bar (request ):
19
20
return request .config .option .dest_foo
21
+
22
+
23
+ @pytest .hookimpl
24
+ def pytest_sessionstart (session : pytest .Session ):
25
+ print ("SELFIE SESSION STARTED" )
26
+ pass
27
+
28
+
29
+ @pytest .hookimpl
30
+ def pytest_sessionfinish (session : pytest .Session , exitstatus ):
31
+ print ("SELFIE SESSION FINISHED" )
32
+ pass
33
+
34
+
35
+ @pytest .hookimpl (hookwrapper = True )
36
+ def pytest_pyfunc_call (pyfuncitem : pytest .Function ):
37
+ # do_something_before_next_hook_executes()
38
+ print ("SELFIE start test {pytfuncitem.nodeid}" )
39
+
40
+ outcome = yield
41
+
42
+ res = outcome .get_result () # will raise if outcome was exception
43
+
44
+ print ("SELFIE end test {pytfuncitem.nodeid} with {Res}" )
45
+ # outcome.excinfo may be None or a (cls, val, tb) tuple
46
+ # res = outcome.get_result() # will raise if outcome was exception
47
+
48
+ # post_process_result(res)
49
+
50
+ # outcome.force_result(new_res) # to override the return value to the plugin system
You can’t perform that action at this time.
0 commit comments