Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ include = [
]

[tool.ty.overrides.rules]
invalid-mutable-override = "ignore"
incompatible-mutable-override = "ignore"

[tool.coverage.report]
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "assert_never()"]
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ async def _make_actor(
# Get the source of main_func and convert it into a reasonable main_py file.
if main_func:
func_source = textwrap.dedent(inspect.getsource(main_func))
func_source = func_source.replace(f'def {main_func.__name__}(', 'def main(') # ty: ignore[unresolved-attribute]
func_source = func_source.replace(f'def {main_func.__name__}(', 'def main(') # ty: ignore[missing-attribute]
main_py = '\n'.join( # noqa: FLY002
[
'import asyncio',
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/actor/test_actor_create_proxy_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def request_handler(request: Request, response: Response) -> Response:
assert proxy_configuration._password == DUMMY_PASSWORD
assert proxy_configuration._country_code == country_code

assert len(patched_apify_client.calls['user']['get']) == 1 # ty: ignore[unresolved-attribute]
assert len(patched_apify_client.calls['user']['get']) == 1 # ty: ignore[missing-attribute]
assert call_mock.call_count == 1

await Actor.exit()
Expand Down Expand Up @@ -161,7 +161,7 @@ def request_handler(request: Request, response: Response) -> Response:
== f'http://groups-{"+".join(groups)},country-{country_code}_{subdivision}:{DUMMY_PASSWORD}@proxy.apify.com:8000'
)

assert len(patched_apify_client.calls['user']['get']) == 3 # ty: ignore[unresolved-attribute]
assert len(patched_apify_client.calls['user']['get']) == 3 # ty: ignore[missing-attribute]
assert call_mock.call_count == 3

await Actor.exit()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_proxy_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def request_handler(request: Request, response: Response) -> Response:
assert proxy_configuration._password == DUMMY_PASSWORD
assert proxy_configuration.is_man_in_the_middle is True

assert len(patched_apify_client.calls['user']['get']) == 1 # ty:ignore[unresolved-attribute]
assert len(patched_apify_client.calls['user']['get']) == 1 # ty:ignore[missing-attribute]
assert call_mock.call_count == 1


Expand Down Expand Up @@ -515,7 +515,7 @@ async def test_initialize_preferring_password_from_env_over_calling_api(
assert proxy_configuration._password == DUMMY_PASSWORD
assert proxy_configuration.is_man_in_the_middle is False

assert len(patched_apify_client.calls['user']['get']) == 0 # ty: ignore[unresolved-attribute]
assert len(patched_apify_client.calls['user']['get']) == 0 # ty: ignore[missing-attribute]


@pytest.mark.usefixtures('patched_impit_client')
Expand Down Expand Up @@ -678,7 +678,7 @@ def request_handler(request: Request, response: Response) -> Response:

await proxy_configuration.initialize()

assert len(patched_apify_client.calls['user']['get']) == 0 # ty: ignore[unresolved-attribute]
assert len(patched_apify_client.calls['user']['get']) == 0 # ty: ignore[missing-attribute]
assert call_mock.call_count == 0


Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def test_ipython_detection_when_active() -> None:

original = getattr(builtins, '__IPYTHON__', None)
try:
builtins.__IPYTHON__ = True # ty: ignore[unresolved-attribute]
builtins.__IPYTHON__ = True # ty: ignore[missing-attribute]
assert is_running_in_ipython() is True
finally:
if original is None:
if hasattr(builtins, '__IPYTHON__'):
del builtins.__IPYTHON__
else:
builtins.__IPYTHON__ = original # ty: ignore[unresolved-attribute]
builtins.__IPYTHON__ = original # ty: ignore[missing-attribute]


@pytest.mark.parametrize(
Expand Down Expand Up @@ -51,8 +51,8 @@ class _DocsGroupDecorated:
class _DocsNameDecorated:
pass

_ = _DocsGroupDecorated.nonexistent # ty: ignore[unresolved-attribute]
_ = _DocsNameDecorated.nonexistent # ty: ignore[unresolved-attribute]
_ = _DocsGroupDecorated.nonexistent # ty: ignore[missing-attribute]
_ = _DocsNameDecorated.nonexistent # ty: ignore[missing-attribute]


def test_docs_decorators_return_original_object() -> None:
Expand Down
Loading
Loading