Skip to content

Commit

Permalink
fix errors caught by mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
tangentstorm committed Jan 23, 2024
1 parent c5bfc85 commit 5d46bf4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tanco/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def error_lines(self):
@dataclass
class TestResult:
kind: ResultKind
error: TestFailure = None
rule: ValidationRule = None
error: TestFailure | None = None
rule: ValidationRule | None = None
actual: list[str] = field(default_factory=list)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion tanco/orgtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

from .model import Challenge, TestDescription

OldTestDescription = namedtuple('TestDescription', ['name', 'lines'])
OldTestDescription = namedtuple('OldTestDescription', ['name', 'lines'])


class TestReaderStateMachine:
Expand Down
3 changes: 2 additions & 1 deletion tanco/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def local_check_output(cfg: m.Config, actual: list[str], test: TestDescription):
case ResultKind.Fail:
# a regression! (test failed and have the rule,
# so we have to tell the server)
assert local_res.error is not None
fail(cfg, local_res.error.error_lines(), test.name, local_res)
case ResultKind.AskServer:
client = TancoClient()
Expand Down Expand Up @@ -191,7 +192,7 @@ def run_tests(cfg: Config):
for line in test.ilines:
print(line)
print()
fail(cfg, e.error_lines(), test)
fail(cfg, e.error_lines(), test.name)


def find_target(cfg: Config, argv: list[str]) -> Config:
Expand Down

0 comments on commit 5d46bf4

Please sign in to comment.