Skip to content

Commit

Permalink
twisted#11995 fix mypy due to hypothesis 6.85 (twisted#11994)
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Sep 19, 2023
2 parents d760cde + c5bbff6 commit 0b4daca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/twisted/newsfragments/11995.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix mypy due to hypothesis 6.85
4 changes: 3 additions & 1 deletion src/twisted/python/test/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

from hypothesis.strategies import SearchStrategy, characters, text
from typing_extensions import Literal


def systemdDescriptorNames() -> SearchStrategy[str]:
Expand All @@ -17,6 +18,7 @@ def systemdDescriptorNames() -> SearchStrategy[str]:
#
# > Names may contain any ASCII character, but must exclude control
# > characters and ":", and must be at most 255 characters in length.
control_characters: Literal["Cc"] = "Cc"
return text(
# The docs don't say there is a min size so I'm guessing...
min_size=1,
Expand All @@ -26,7 +28,7 @@ def systemdDescriptorNames() -> SearchStrategy[str]:
min_codepoint=0,
max_codepoint=127,
# This one excludes control characters.
blacklist_categories=("Cc",),
blacklist_categories=(control_characters,),
# And this excludes the separator.
blacklist_characters=(":",),
),
Expand Down

0 comments on commit 0b4daca

Please sign in to comment.