Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#628)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/python-jsonschema/check-jsonschema: 0.31.0 → 0.31.1](python-jsonschema/check-jsonschema@0.31.0...0.31.1)
- [github.com/psf/black: 24.10.0 → 25.1.0](psf/black@24.10.0...25.1.0)
- [github.com/PyCQA/isort: 5.13.2 → 6.0.0](PyCQA/isort@5.13.2...6.0.0)
- [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](codespell-project/codespell@v2.3.0...v2.4.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 17, 2025
1 parent f9f1422 commit 8124cf4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.31.0
rev: 0.31.1
hooks:
- id: check-github-workflows
- id: check-dependabot
- id: check-readthedocs
- repo: https://github.com/psf/black
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
Expand All @@ -40,7 +40,7 @@ repos:
hooks:
- id: slyp
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
Expand Down
4 changes: 2 additions & 2 deletions nose2/plugins/junitxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ def string_cleanup(string, keep_restricted=False):
if not issubclass(type(string), str):
string = str(string, encoding="utf-8", errors="replace")

string = _ILLEGAL_REGEX.sub("\uFFFD", string)
string = _ILLEGAL_REGEX.sub("\ufffd", string)
if not keep_restricted:
string = _RESTRICTED_REGEX.sub("\uFFFD", string)
string = _RESTRICTED_REGEX.sub("\ufffd", string)

return string
28 changes: 14 additions & 14 deletions nose2/tests/unit/test_junitxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _fromisoformat(date_str):
class TestJunitXmlPlugin(TestCase):
_RUN_IN_TEMP = True

BAD_FOR_XML_U = "A\x07 B\x0B C\x10 D\uD900 E\uFFFE F\x80 G\x90 H\uFDDD"
BAD_FOR_XML_U = "A\x07 B\x0b C\x10 D\ud900 E\ufffe F\x80 G\x90 H\ufddd"
# UTF-8 string with double null (invalid)
BAD_FOR_XML_B = (
b"A\x07 B\x0b C\x10 D\xed\xa4\x80 "
Expand All @@ -49,23 +49,23 @@ class TestJunitXmlPlugin(TestCase):
# G\\xc2\\x90 H\\xef\\xb7\\x9d \\x00\\x00"

if sys.maxunicode <= 0xFFFF:
EXPECTED_RE = "^[\x09\x0A\x0D\x20\x21-\uD7FF\uE000-\uFFFD]*$"
EXPECTED_RE = "^[\x09\x0a\x0d\x20\x21-\ud7ff\ue000-\ufffd]*$"
EXPECTED_RE_SAFE = (
"^[\x09\x0A\x0D\x20\x21-\x7E\x85\xA0-\uD7FF\uE000-\uFDCF\uFDF0-\uFFFD]*$"
"^[\x09\x0a\x0d\x20\x21-\x7e\x85\xa0-\ud7ff\ue000-\ufdcf\ufdf0-\ufffd]*$"
)
else:
EXPECTED_RE = "^[\x09\x0A\x0D\x20\x21-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*$"
EXPECTED_RE = "^[\x09\x0a\x0d\x20\x21-\ud7ff\ue000-\ufffd\u10000-\u10ffFF]*$"
EXPECTED_RE_SAFE = (
"^[\x09\x0A\x0D\x20\x21-\x7E\x85"
"\xA0-\uD7FF\uE000-\uFDCF\uFDF0-\uFFFD"
"\u10000-\u1FFFD\u20000-\u2FFFD"
"\u30000-\u3FFFD\u40000-\u4FFFD"
"\u50000-\u5FFFD\u60000-\u6FFFD"
"\u70000-\u7FFFD\u80000-\u8FFFD"
"\u90000-\u8FFFD\uA0000-\uAFFFD"
"\uB0000-\uBFFFD\uC0000-\uCFFFD"
"\uD0000-\uDFFFD\uE0000-\uEFFFD"
"\uF0000-\uFFFFD\u100000-\u10FFFD]*$"
"^[\x09\x0a\x0d\x20\x21-\x7e\x85"
"\xa0-\ud7ff\ue000-\ufdcf\ufdf0-\ufffd"
"\u10000-\u1fffD\u20000-\u2fffD"
"\u30000-\u3fffD\u40000-\u4fffD"
"\u50000-\u5fffD\u60000-\u6fffD"
"\u70000-\u7fffD\u80000-\u8fffD"
"\u90000-\u8fffD\ua0000-\uafffD"
"\ub0000-\ubfffD\uc0000-\ucfffD"
"\ud0000-\udfffD\ue0000-\uefffD"
"\uf0000-\uffffD\u100000-\u10ffFD]*$"
)

def setUp(self):
Expand Down

0 comments on commit 8124cf4

Please sign in to comment.