Skip to content

Commit 43483a3

Browse files
committed
Fixed test
1 parent 2e5d593 commit 43483a3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ plugins = ["pdm-autoexport"]
1919

2020
[tool.pdm.scripts]
2121
devserver = "flask --app app run --debug"
22+
activate = "eval $(pdm venv activate)"
2223

2324
[tool.pdm.dev-dependencies]
2425
dev = [

tests/test_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ def test_run_type_check_with_pyright():
77
b: str = "2" # expect-type-error
88
c: int = "3" # expect-type-error
99
d: str = 4
10-
e: list[str] = [
11-
i # expect-type-error
12-
for i in range(10)
10+
e: list[str] = [ # expect-type-error
11+
i for i in range(10)
1312
]
1413
"""
1514
result = ChallengeManager._type_check_with_pyright(code)
1615
assert result.passed is False
17-
errors = [line for line in result.stdout.splitlines() if line]
18-
assert len(errors) == 3
19-
assert errors[0].startswith("4: error: Incompatible types in assignment")
20-
assert errors[1].startswith("2: error: Expected type error")
16+
assert result.stdout == (
17+
'4:error: Expression of type "Literal[4]" cannot be assigned to declared type "str"\n'
18+
"2: error: Expected type error\n\n"
19+
"Found 2 errors"
20+
)

0 commit comments

Comments
 (0)