summaryrefslogtreecommitdiff
path: root/tests/unit/utils/test_utils.py
diff options
context:
space:
mode:
authorAxel Dahlberg <axel.dahlberg12@gmail.com>2021-01-17 14:36:26 +0100
committerAxel Dahlberg <axel.dahlberg12@gmail.com>2021-01-17 14:40:53 +0100
commit799b0fb5c64abd6daa2887ddd7816a7ec51c343c (patch)
tree072adf2f12864ba0d153e71a162a11dec9e9fa12 /tests/unit/utils/test_utils.py
parent51fa95d2582c83ea26c432203338cb6531a95ed8 (diff)
downloadqutebrowser-799b0fb5c64abd6daa2887ddd7816a7ec51c343c.tar.gz
qutebrowser-799b0fb5c64abd6daa2887ddd7816a7ec51c343c.zip
Test when cleanup_file context fails
Diffstat (limited to 'tests/unit/utils/test_utils.py')
-rw-r--r--tests/unit/utils/test_utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
index 74b49f573..238e89736 100644
--- a/tests/unit/utils/test_utils.py
+++ b/tests/unit/utils/test_utils.py
@@ -904,3 +904,10 @@ class TestCleanupFileContext:
with utils.cleanup_file(tmpfile):
raise RuntimeError
assert not tmpfile.exists()
+
+ def test_directory(self, tmp_path, caplog):
+ assert tmp_path.is_dir()
+ # removal of file fails since it's a directory
+ with caplog.at_level(logging.ERROR, 'misc'):
+ with utils.cleanup_file(tmp_path):
+ pass