File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ RELEASE_TYPE: patch
2+
3+ This patch replaces some internal ``% ``-style string formatting with f-strings. There is no user-visible change.
Original file line number Diff line number Diff line change @@ -717,10 +717,9 @@ def __init__(
717717 self .start_span (TOP_LABEL )
718718
719719 def __repr__ (self ) -> str :
720- return "ConjectureData(%s, %d choices%s)" % (
721- self .status .name ,
722- len (self .nodes ),
723- ", frozen" if self .frozen else "" ,
720+ return (
721+ f"ConjectureData({ self .status .name } , { len (self .nodes )} "
722+ f"choices{ ', frozen' if self .frozen else '' } )"
724723 )
725724
726725 @property
Original file line number Diff line number Diff line change @@ -381,10 +381,10 @@ def __enter__(self) -> None:
381381 # is happening and it's hard to imagine an
382382 # intentionally-deeply-recursive use of this code.
383383 assert cur_depth <= 1000 , (
384- "Hypothesis would usually add %d to the stack depth of %d here, "
385- "but we are already much deeper than expected. Aborting now, to "
386- "avoid extending the stack limit in an infinite loop... "
387- % ( self . new_limit - self . old_limit , self . old_limit )
384+ f "Hypothesis would usually add { self . new_limit - self . old_limit } to "
385+ f"the stack depth of { self . old_limit } here, but we are already much "
386+ "deeper than expected. Aborting now, to avoid extending the stack "
387+ "limit in an infinite loop..."
388388 )
389389 try :
390390 _stackframe_limiter .enter_context (
Original file line number Diff line number Diff line change @@ -106,8 +106,10 @@ def __init__(
106106 label_regex = r"[a-zA-Z][a-zA-Z0-9]?"
107107 else :
108108 maximum_center_character_pattern_repetitions = self .max_element_length - 2
109- label_regex = r"[a-zA-Z]([a-zA-Z0-9\-]{0,%d}[a-zA-Z0-9])?" % (
110- maximum_center_character_pattern_repetitions ,
109+ label_regex = (
110+ r"[a-zA-Z]([a-zA-Z0-9\-]{0,"
111+ f"{ maximum_center_character_pattern_repetitions } "
112+ r"}[a-zA-Z0-9])?"
111113 )
112114
113115 # Construct reusable strategies here to avoid a performance hit by doing
Original file line number Diff line number Diff line change @@ -78,8 +78,6 @@ ignore = [
7878 " SIM114" ,
7979 " SIM300" ,
8080 " SIM905" ,
81- " UP031" ,
82- " UP037" ,
8381]
8482
8583[tool .ruff .lint .per-file-ignores ]
You can’t perform that action at this time.
0 commit comments