File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -113,18 +113,21 @@ def test_set_loggers_Filehandler_without_permission(tmp_path):
113113 orig_handlers = logger .handlers
114114 logger .handlers = []
115115
116- tmp_path .chmod (0o400 )
117- logfile = tmp_path / "logs/ft_logfile.log"
118- config = {
119- "verbosity" : 2 ,
120- "logfile" : str (logfile ),
121- }
122-
123- setup_logging_pre ()
124- with pytest .raises (OperationalException ):
125- setup_logging (config )
126-
127- logger .handlers = orig_handlers
116+ try :
117+ tmp_path .chmod (0o400 )
118+ logfile = tmp_path / "logs/ft_logfile.log"
119+ config = {
120+ "verbosity" : 2 ,
121+ "logfile" : str (logfile ),
122+ }
123+
124+ setup_logging_pre ()
125+ with pytest .raises (OperationalException ):
126+ setup_logging (config )
127+
128+ logger .handlers = orig_handlers
129+ finally :
130+ tmp_path .chmod (0o700 )
128131
129132
130133@pytest .mark .skip (reason = "systemd is not installed on every system, so we're not testing this." )
You can’t perform that action at this time.
0 commit comments