summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qutebrowser/config/configtypes.py2
-rw-r--r--tests/unit/utils/test_utils.py22
2 files changed, 11 insertions, 13 deletions
diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py
index fde4a24f0..cc6c3fd2f 100644
--- a/qutebrowser/config/configtypes.py
+++ b/qutebrowser/config/configtypes.py
@@ -1530,7 +1530,7 @@ class ShellCommand(List):
def complete(self) -> _Completions:
if self._completions is not None:
- return self._completions
+ return self._completions # pragma: no cover
else:
return super().complete()
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
index 525b99550..74b49f573 100644
--- a/tests/unit/utils/test_utils.py
+++ b/tests/unit/utils/test_utils.py
@@ -882,27 +882,25 @@ def test_mimetype_extension(mimetype, extension):
class TestCleanupFileContext:
- def test_no_file(self, tmpdir):
- tmpfile = tmpdir / 'tmp.txt'
+ def test_no_file(self, tmp_path):
+ tmpfile = tmp_path / 'tmp.txt'
with utils.cleanup_file(tmpfile):
pass
- assert not os.path.exists(tmpfile)
+ assert not tmpfile.exists()
- def test_no_error(self, tmpdir):
- tmpfile = tmpdir / 'tmp.txt'
+ def test_no_error(self, tmp_path):
+ tmpfile = tmp_path / 'tmp.txt'
with tmpfile.open('w'):
pass
with utils.cleanup_file(tmpfile):
pass
- assert not os.path.exists(tmpfile)
+ assert not tmpfile.exists()
- def test_error(self, tmpdir):
- tmpfile = tmpdir / 'tmp.txt'
+ def test_error(self, tmp_path):
+ tmpfile = tmp_path / 'tmp.txt'
with tmpfile.open('w'):
pass
- try:
+ with pytest.raises(RuntimeError):
with utils.cleanup_file(tmpfile):
raise RuntimeError
- except RuntimeError:
- pass
- assert not os.path.exists(tmpfile)
+ assert not tmpfile.exists()