Skip to content

Commit c4cbdcc

Browse files
[pre-commit.ci] pre-commit autoupdate (#628)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
1 parent b136f51 commit c4cbdcc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
hooks:
55
- id: ruff
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
7+
rev: v5.0.0
88
hooks:
99
- id: trailing-whitespace
1010
- id: end-of-file-fixer
@@ -21,7 +21,7 @@ repos:
2121
hooks:
2222
- id: sphinx-lint
2323
- repo: https://github.com/python-jsonschema/check-jsonschema
24-
rev: 0.33.0
24+
rev: 0.33.2
2525
hooks:
2626
- id: check-dependabot
2727
- id: check-github-workflows

src/test_typing_extensions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,13 +1207,15 @@ class My(enum.Enum):
12071207

12081208
self.assertEqual(Literal[My.A].__args__, (My.A,))
12091209

1210-
def test_illegal_parameters_do_not_raise_runtime_errors(self):
1210+
def test_strange_parameters_are_allowed(self):
1211+
# These are explicitly allowed by the typing spec
1212+
Literal[Literal[1, 2], Literal[4, 5]]
1213+
Literal[b"foo", "bar"]
1214+
12111215
# Type checkers should reject these types, but we do not
12121216
# raise errors at runtime to maintain maximum flexibility
12131217
Literal[int]
1214-
Literal[Literal[1, 2], Literal[4, 5]]
12151218
Literal[3j + 2, ..., ()]
1216-
Literal[b"foo", "bar"]
12171219
Literal[{"foo": 3, "bar": 4}]
12181220
Literal[T]
12191221

0 commit comments

Comments
 (0)