File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
python/pytest-selfie/pytest_selfie Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ from typing import Optional , Tuple
12import pytest
23
34
@@ -17,3 +18,33 @@ def pytest_addoption(parser):
1718@pytest .fixture
1819def bar (request ):
1920 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