mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
CI: Fix python ty runs with latest ty beta
- Add missing cast - Fix unnecessary cast in test_load_file.py
This commit is contained in:
parent
cc12315ed5
commit
d36124f248
2 changed files with 4 additions and 3 deletions
|
|
@ -5,11 +5,13 @@ import slint
|
|||
import pdoc
|
||||
import pathlib
|
||||
import subprocess
|
||||
import typing
|
||||
|
||||
|
||||
doc = pdoc.doc.Module(slint)
|
||||
|
||||
model_cls = doc.get("Model")
|
||||
model_cls = typing.cast(pdoc.doc.Class, doc.get("Model"))
|
||||
assert model_cls is not None
|
||||
for method in model_cls.inherited_members[("builtins", "PyModelBase")]:
|
||||
method.is_inherited = False
|
||||
if not method.name.startswith("_") and method.name != "init_self":
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
import pytest
|
||||
from slint import load_file, CompileError
|
||||
from pathlib import Path
|
||||
import typing
|
||||
|
||||
|
||||
def base_dir() -> Path:
|
||||
|
|
@ -56,7 +55,7 @@ def test_load_file_fail() -> None:
|
|||
def test_compile_error() -> None:
|
||||
with pytest.raises(CompileError) as excinfo:
|
||||
load_file(base_dir() / "test-file-error.slint")
|
||||
err = typing.cast(CompileError, excinfo.value)
|
||||
err = excinfo.value
|
||||
diagnostics = err.diagnostics
|
||||
assert len(diagnostics) == 2
|
||||
assert diagnostics[0].message == "Unknown type 'garbage'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue