From fd5c3b3320ccbcef710d7a3cf6b6edabbe415d88 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 8 Jan 2024 21:04:26 -0700 Subject: [PATCH] fix a flaky test --- tests/cli_test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cli_test.py b/tests/cli_test.py index 23541cc..c4f4700 100644 --- a/tests/cli_test.py +++ b/tests/cli_test.py @@ -25,9 +25,10 @@ def test_cli_help(capsys): def test_cli_default(capsys): - assert main(["MyBmi"]) == 0 - exec(capsys.readouterr().out) - assert "MyBmi" in globals() + assert main(["MyUniqueBmi"]) == 0 + globs = {} + exec(capsys.readouterr().out, globs) + assert "MyUniqueBmi" in globs def test_cli_wraps_lines(capsys):