Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Pass count as keyword argument to re.sub()
This fixes two test failures under Python 3.13:

```
Failed Tests (2):
  FileCheck.py integration tests :: tests/extra_features/pseudo_numeric_variables/01_line_variable_once/test.itest
  FileCheck.py integration tests :: tests/extra_features/pseudo_numeric_variables/02_line_variable_twice/test.itest
```

Both are failing due to:

```
filecheck/filecheck.py:372: DeprecationWarning: 'count' is passed as positional argument
```

Passing `count` as positional argument to `re.sub()` has been deprecated
in Python 3.13: https://docs.python.org/3.13/whatsnew/3.13.html#id9
and produces a `DeprecationWarning` exception.
  • Loading branch information
rathann committed Nov 21, 2023
commit 2864540445fb1bbf7791e5eea9315b952b6264fd
2 changes: 1 addition & 1 deletion filecheck/filecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def parse_check(line: str, line_idx, config: Config) -> Optional[Check]:
LINE_NUMBER_REGEX,
str(line_idx + offset + 1),
check_expression,
1,
count=1,
)
line_var_match = re.search(LINE_NUMBER_REGEX, check_expression)

Expand Down