tests: reset permissions on tmp-path
to facilitate cleanup
This commit is contained in:
@@ -113,6 +113,7 @@ def test_set_loggers_Filehandler_without_permission(tmp_path):
|
|||||||
orig_handlers = logger.handlers
|
orig_handlers = logger.handlers
|
||||||
logger.handlers = []
|
logger.handlers = []
|
||||||
|
|
||||||
|
try:
|
||||||
tmp_path.chmod(0o400)
|
tmp_path.chmod(0o400)
|
||||||
logfile = tmp_path / "logs/ft_logfile.log"
|
logfile = tmp_path / "logs/ft_logfile.log"
|
||||||
config = {
|
config = {
|
||||||
@@ -125,6 +126,8 @@ def test_set_loggers_Filehandler_without_permission(tmp_path):
|
|||||||
setup_logging(config)
|
setup_logging(config)
|
||||||
|
|
||||||
logger.handlers = orig_handlers
|
logger.handlers = orig_handlers
|
||||||
|
finally:
|
||||||
|
tmp_path.chmod(0o700)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="systemd is not installed on every system, so we're not testing this.")
|
@pytest.mark.skip(reason="systemd is not installed on every system, so we're not testing this.")
|
||||||
|
|||||||
Reference in New Issue
Block a user