@@ -53,10 +53,18 @@ def print_section(title: str, body: str) -> None:
5353def main () -> int :
5454 port = find_free_port ()
5555 stdout_file = tempfile .NamedTemporaryFile (
56- mode = "w+" , encoding = "utf-8" , delete = False , prefix = "policyengine-api-boot-" , suffix = ".stdout.log"
56+ mode = "w+" ,
57+ encoding = "utf-8" ,
58+ delete = False ,
59+ prefix = "policyengine-api-boot-" ,
60+ suffix = ".stdout.log" ,
5761 )
5862 stderr_file = tempfile .NamedTemporaryFile (
59- mode = "w+" , encoding = "utf-8" , delete = False , prefix = "policyengine-api-boot-" , suffix = ".stderr.log"
63+ mode = "w+" ,
64+ encoding = "utf-8" ,
65+ delete = False ,
66+ prefix = "policyengine-api-boot-" ,
67+ suffix = ".stderr.log" ,
6068 )
6169 stdout_path = Path (stdout_file .name )
6270 stderr_path = Path (stderr_file .name )
@@ -79,9 +87,10 @@ def main() -> int:
7987 print (f"stdout log: { stdout_path } " )
8088 print (f"stderr log: { stderr_path } " )
8189
82- with stdout_path .open ("w" , encoding = "utf-8" ) as stdout_handle , stderr_path .open (
83- "w" , encoding = "utf-8"
84- ) as stderr_handle :
90+ with (
91+ stdout_path .open ("w" , encoding = "utf-8" ) as stdout_handle ,
92+ stderr_path .open ("w" , encoding = "utf-8" ) as stderr_handle ,
93+ ):
8594 process = subprocess .Popen (
8695 [
8796 sys .executable ,
@@ -121,7 +130,9 @@ def main() -> int:
121130 time .sleep (0.5 )
122131
123132 if not ready :
124- process .wait (timeout = 5 ) if process .poll () is not None else process .terminate ()
133+ process .wait (
134+ timeout = 5
135+ ) if process .poll () is not None else process .terminate ()
125136 if process .poll () is None :
126137 process .wait (timeout = 5 )
127138 print ("\n Boot smoke test failed: app did not become ready." )
0 commit comments