Skip to content

Commit d25a841

Browse files
committed
updates for new ty version
1 parent eddbf49 commit d25a841

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ reportIncompatibleUnannotatedOverride = 'error'
207207
division-by-zero = "error"
208208
possibly-unresolved-reference = "warn"
209209
unused-ignore-comment = "warn"
210-
invalid-type-form = "ignore" # https://github.com/astral-sh/ty/issues/157
211210

212211
[tool.ty.environment]
213212
python-platform = "all"

pytest_robotframework/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _get_failure(self, *args: Never, **kwargs: Never):
120120
in_framework = False
121121
tb = trace
122122
# find a frame from a module that should always be in the trace
123-
if Path(frame.filename) == Path(model.__file__):
123+
if Path(frame.filename) == Path(model.__file__): # ty:ignore[invalid-argument-type] https://github.com/astral-sh/ty/issues/860
124124
break
125125
else:
126126
# using logger.error because raising an exception here would screw up the output xml
@@ -355,7 +355,7 @@ def inner(
355355
/,
356356
*args: P.args,
357357
**kwargs: P.kwargs,
358-
) -> T:
358+
) -> T: # ty:ignore[invalid-method-override] https://github.com/astral-sh/ty/issues/1820
359359
T_WrappedContextManager = TypeVar("T_WrappedContextManager")
360360

361361
@final

pytest_robotframework/_internal/robot/listeners_and_suite_visitors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def __init__(self, session: Session, *, items: list[Item]):
244244

245245
@override
246246
# https://github.com/robotframework/robotframework/issues/4940
247-
def visit_test( # pyright:ignore[reportIncompatibleMethodOverride]
247+
def visit_test( # pyright:ignore[reportIncompatibleMethodOverride] # ty:ignore[invalid-method-override]
248248
self, test: running.TestCase
249249
):
250250
for item in self.items:
@@ -298,7 +298,7 @@ def __init__(self, *, session: Session, xdist_item: Item | None = None):
298298

299299
@override
300300
# https://github.com/robotframework/robotframework/issues/4940
301-
def start_test(self, test: running.TestCase) -> bool | None: # pyright:ignore[reportIncompatibleMethodOverride]
301+
def start_test(self, test: running.TestCase) -> bool | None: # pyright:ignore[reportIncompatibleMethodOverride] # ty:ignore[invalid-method-override]
302302
if self.xdist_item:
303303
item = self.xdist_item
304304
else:

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ def xpath(
178178
result = self._proxied.xpath(_path, namespaces, extensions, smart_strings, **_variables)
179179
if _is_element_list(result):
180180
# variance moment, but we aren't storing the value anywhere so it's fine
181-
return [_XmlElement(element) for element in result] # pyright:ignore[reportReturnType]
181+
# not-iterable & invalid-argument-type errors due to https://github.com/astral-sh/ty/issues/117
182+
return [_XmlElement(element) for element in result] # pyright:ignore[reportReturnType] # ty:ignore[invalid-return-type,not-iterable,invalid-argument-type]
182183
return result
183184

184185
def count_children(self) -> int:

tests/type_tests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
# keyword, args:
1818
@keyword(name="foo bar", tags=("a", "b"))
19-
def a(): ...
19+
def a() -> None: ...
2020

21-
# https://github.com/astral-sh/ty/issues/157
21+
# https://github.com/astral-sh/ty/issues/1821
2222

2323
_ = assert_type(a, Callable[[], None]) # ty:ignore[type-assertion-failure]
2424

2525
# keyword, no args:
2626
@keyword
27-
def g(): ...
27+
def g() -> None: ...
2828

2929
_ = assert_type(g, Callable[[], None]) # ty:ignore[type-assertion-failure]
3030

@@ -61,10 +61,10 @@ def d() -> Iterator[None]:
6161

6262
# keyword, non-context manager with wrap_context_manager=True:
6363
# expected type error
64-
@keyword(wrap_context_manager=True) # pyright:ignore[reportArgumentType]
65-
def e(): ...
64+
@keyword(wrap_context_manager=True) # pyright:ignore[reportArgumentType] # ty:ignore[invalid-argument-type]
65+
def e() -> None: ...
6666

6767
# keyword, non-context manager with wrap_context_manager=False:
6868
# expected type error
6969
@keyword(wrap_context_manager=False) # pyright:ignore[reportArgumentType]
70-
def f(): ...
70+
def f() -> None: ...

0 commit comments

Comments
 (0)