@@ -24,7 +24,6 @@ def broker() -> RedisBroker:
2424
2525def build_faststream_config (
2626 broker : BrokerUsecase [typing .Any , typing .Any ] | None = None ,
27- health_checks_additional_checker : typing .Callable [[], typing .Coroutine [bool , typing .Any , typing .Any ]] | None = None ,
2827) -> FastStreamConfig :
2928 return FastStreamConfig (
3029 service_name = "microservice" ,
@@ -40,7 +39,6 @@ def build_faststream_config(
4039 sentry_dsn = "https://testdsn@localhost/1" ,
4140 health_checks_path = "/custom-health/" ,
4241 logging_buffer_capacity = 0 ,
43- health_checks_additional_checker = health_checks_additional_checker ,
4442 application = faststream .asgi .AsgiFastStream (
4543 broker ,
4644 asyncapi_path = faststream .asgi .AsyncAPIRoute ("/docs/" ),
@@ -86,20 +84,6 @@ async def test_faststream_bootstrap_health_check_wo_broker() -> None:
8684 assert response .text == "Service is unhealthy"
8785
8886
89- async def test_faststream_bootstrap_additional_health_checker (broker : RedisBroker ) -> None :
90- async def custom_checker () -> bool :
91- return False
92-
93- bootstrap_config = build_faststream_config (broker = broker , health_checks_additional_checker = custom_checker )
94- bootstrapper = FastStreamBootstrapper (bootstrap_config = bootstrap_config )
95- application = bootstrapper .bootstrap ()
96- test_client = TestClient (app = application )
97-
98- response = test_client .get (bootstrap_config .health_checks_path )
99- assert response .status_code == status .HTTP_500_INTERNAL_SERVER_ERROR
100- assert response .text == "Service is unhealthy"
101-
102-
10387def test_faststream_bootstrapper_not_ready () -> None :
10488 with emulate_package_missing ("faststream" ), pytest .raises (RuntimeError , match = "faststream is not installed" ):
10589 FastStreamBootstrapper (bootstrap_config = FastStreamConfig (application = faststream .asgi .AsgiFastStream ()))
0 commit comments