@@ -342,17 +342,11 @@ async def test_get_latest_dag_runs_without_params_excludes_other_users_runs(
342342 dag_template_a , _ = await _setup_dag_template (async_client , user_a )
343343 dag_template_b , _ = await _setup_dag_template (async_client , user_b )
344344
345- run_a_id = await _create_dag_run_via_api (
346- async_client , user_a , dag_template_a , {"owner" : "a" }
347- )
348- run_b_id = await _create_dag_run_via_api (
349- async_client , user_b , dag_template_b , {"owner" : "b" }
350- )
345+ run_a_id = await _create_dag_run_via_api (async_client , user_a , dag_template_a , {"owner" : "a" })
346+ run_b_id = await _create_dag_run_via_api (async_client , user_b , dag_template_b , {"owner" : "b" })
351347
352348 # User A asks for latest runs with no filter -- must not see user B's run.
353- response = await async_client .get (
354- "/api/v1/dag_runs/latest/" , headers = {"test_username" : user_a }
355- )
349+ response = await async_client .get ("/api/v1/dag_runs/latest/" , headers = {"test_username" : user_a })
356350 assert response .status_code == 200 , response .content
357351 returned_ids = {item ["id" ] for item in response .json ()}
358352 assert run_a_id in returned_ids
@@ -390,17 +384,13 @@ async def test_get_latest_dag_runs_with_other_users_project_id_is_rejected(
390384
391385
392386@pytest .mark .asyncio
393- async def test_get_latest_dag_runs_with_own_project_id_still_works (
394- async_client : AsyncClient , db
395- ):
387+ async def test_get_latest_dag_runs_with_own_project_id_still_works (async_client : AsyncClient , db ):
396388 """The legitimate case -- user asking for runs in a project they own --
397389 must keep returning their runs after the visibility filter is applied.
398390 """
399391 user_a = "user_individual@no_team.com"
400392 dag_template_a , _ = await _setup_dag_template (async_client , user_a )
401- run_id = await _create_dag_run_via_api (
402- async_client , user_a , dag_template_a , {"owner" : "a" }
403- )
393+ run_id = await _create_dag_run_via_api (async_client , user_a , dag_template_a , {"owner" : "a" })
404394
405395 # By dag_template_id.
406396 response = await async_client .get (
@@ -415,9 +405,7 @@ async def test_get_latest_dag_runs_with_own_project_id_still_works(
415405 project_a_id , * _ = await _setup_sample_project (async_client , user_a )
416406 # New template in this project, new run.
417407 dag_template_a2 , _ = await _setup_dag_template (async_client , user_a )
418- run_id_2 = await _create_dag_run_via_api (
419- async_client , user_a , dag_template_a2 , {"owner" : "a2" }
420- )
408+ run_id_2 = await _create_dag_run_via_api (async_client , user_a , dag_template_a2 , {"owner" : "a2" })
421409 response = await async_client .get (
422410 f"/api/v1/dag_runs/latest/?{ urlencode ({'project_id' : project_a_id })} " ,
423411 headers = {"test_username" : user_a },
0 commit comments