Skip to content

Commit 5e15e2f

Browse files
committed
Format local boot smoke script
1 parent 93357f1 commit 5e15e2f

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

scripts/smoke_test_local_boot.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,18 @@ def print_section(title: str, body: str) -> None:
5353
def 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("\nBoot smoke test failed: app did not become ready.")

0 commit comments

Comments
 (0)