summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2023-01-23 22:19:45 +1300
committertoofar <toofar@spalge.com>2023-01-23 22:19:45 +1300
commita5a30aef9f09f5035e5597877d1a45e3146960fb (patch)
tree9b8d812626668fd781136e24650c9dc40b65d6e1
parentb3caf7eeeb7bdc0364af4b471e2bdfb8834c33a1 (diff)
downloadqutebrowser-a5a30aef9f09f5035e5597877d1a45e3146960fb.tar.gz
qutebrowser-a5a30aef9f09f5035e5597877d1a45e3146960fb.zip
Reduce hypothesis iterations for test_invariants
The text strategy doesn't perform well with long strings. Not really related to this PR but pushing to a branch and merging is less stressful than pushing to master. ref: #7553#issuecomment-1399918153
-rw-r--r--tests/unit/utils/test_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
index 86b5efb8c..aa063b7c6 100644
--- a/tests/unit/utils/test_utils.py
+++ b/tests/unit/utils/test_utils.py
@@ -34,7 +34,7 @@ from PyQt5.QtCore import QUrl, QRect, QPoint
from PyQt5.QtGui import QClipboard
import pytest
import hypothesis
-from hypothesis import strategies
+from hypothesis import strategies, settings
import yaml
import qutebrowser
@@ -661,6 +661,7 @@ class TestSanitizeFilename:
assert utils.sanitize_filename(name, replacement=None) == 'Bad File'
@hypothesis.given(filename=strategies.text(min_size=100))
+ @settings(max_examples=10)
def test_invariants(self, filename):
sanitized = utils.sanitize_filename(filename, shorten=True)
assert len(os.fsencode(sanitized)) <= 255 - len("(123).download")