File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -621,22 +621,21 @@ def test_run_app_preexisting_inet6_socket(patched_loop) -> None:
621
621
622
622
623
623
@pytest .mark .skipif (not hasattr (socket , "AF_UNIX" ), reason = "requires UNIX sockets" )
624
- def test_run_app_preexisting_unix_socket (patched_loop , mocker ) -> None :
624
+ def test_run_app_preexisting_unix_socket (patched_loop , unix_sockname , mocker ) -> None :
625
625
app = web .Application ()
626
626
627
- sock_path = "/tmp/test_preexisting_sock1"
628
627
sock = socket .socket (socket .AF_UNIX )
629
628
with contextlib .closing (sock ):
630
- sock .bind (sock_path )
631
- os .unlink (sock_path )
629
+ sock .bind (unix_sockname )
630
+ os .unlink (unix_sockname )
632
631
633
632
printer = mock .Mock (wraps = stopper (patched_loop ))
634
633
web .run_app (app , sock = sock , print = printer , loop = patched_loop )
635
634
636
635
patched_loop .create_server .assert_called_with (
637
636
mock .ANY , sock = sock , backlog = 128 , ssl = None
638
637
)
639
- assert f"http://unix:{ sock_path } :" in printer .call_args [0 ][0 ]
638
+ assert f"http://unix:{ unix_sockname } :" in printer .call_args [0 ][0 ]
640
639
641
640
642
641
def test_run_app_multiple_preexisting_sockets (patched_loop ) -> None :
You can’t perform that action at this time.
0 commit comments