File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -678,10 +678,6 @@ def pytest_sessionfinish(self):
678
678
with catching_logs (self .log_file_handler , level = self .log_file_level ):
679
679
yield
680
680
681
- # Close the FileHandler explicitly.
682
- # (logging.shutdown might have lost the weakref?!)
683
- self .log_file_handler .close ()
684
-
685
681
@pytest .hookimpl (hookwrapper = True , tryfirst = True )
686
682
def pytest_sessionstart (self ):
687
683
self .log_cli_handler .set_when ("sessionstart" )
@@ -706,6 +702,12 @@ def pytest_runtestloop(self, session):
706
702
with catching_logs (self .log_file_handler , level = self .log_file_level ):
707
703
yield # run all the tests
708
704
705
+ @pytest .hookimpl
706
+ def pytest_unconfigure (self ):
707
+ # Close the FileHandler explicitly.
708
+ # (logging.shutdown might have lost the weakref?!)
709
+ self .log_file_handler .close ()
710
+
709
711
710
712
class _LiveLoggingStreamHandler (logging .StreamHandler ):
711
713
"""
You can’t perform that action at this time.
0 commit comments