1
- from tests .integration .conftest import MakeActorFunction , RunActorFunction
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ if TYPE_CHECKING :
6
+ from .conftest import MakeActorFunction , RunActorFunction
2
7
3
8
4
9
async def test_actor_on_platform_max_crawl_depth (
@@ -79,8 +84,7 @@ async def test_actor_on_platform_max_request_retries(
79
84
80
85
async def main () -> None :
81
86
"""The crawler entry point."""
82
- from crawlee ._types import BasicCrawlingContext
83
- from crawlee .crawlers import ParselCrawler , ParselCrawlingContext
87
+ from crawlee .crawlers import BasicCrawlingContext , ParselCrawler , ParselCrawlingContext
84
88
85
89
from apify import Actor
86
90
@@ -99,7 +103,8 @@ async def default_handler(_: ParselCrawlingContext) -> None:
99
103
raise RuntimeError ('Some error' )
100
104
101
105
await crawler .run (['http://localhost:8080/' ])
102
- assert failed_counter == max_retries , f'{ failed_counter = } ' # TODO max_retries + 1
106
+ # https://github.com/apify/crawlee-python/issues/1326 , should be max_retries + 1
107
+ assert failed_counter == max_retries , f'{ failed_counter = } '
103
108
104
109
actor = await make_actor (label = 'crawler-max-retries' , main_func = main )
105
110
run_result = await run_actor (actor )
0 commit comments