diff options
| author | Павел Жуков <33721692+LeaveMyYard@users.noreply.github.com> | 2023-03-29 18:12:02 +0300 |
|---|---|---|
| committer | Павел Жуков <33721692+LeaveMyYard@users.noreply.github.com> | 2023-03-29 18:12:02 +0300 |
| commit | 55a628b3d02ebcb485ff55c29cfd56521546be91 (patch) | |
| tree | 03e5ef5b139c30dcd0e2a9eadbffe7223937c837 /tests | |
| parent | 1971f310063c5525d856100f818e3252b29bd753 (diff) | |
Fix case when can not possible to calculate
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_krr.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/test_krr.py b/tests/test_krr.py index 4a25db6..30704ba 100644 --- a/tests/test_krr.py +++ b/tests/test_krr.py @@ -18,22 +18,31 @@ STRATEGY_NAME = "simple" def test_help(): result = runner.invoke(app, [STRATEGY_NAME, "--help"]) - assert result.exit_code == 0 + try: + assert result.exit_code == 0 + except AssertionError as e: + raise e from result.exception @pytest.mark.parametrize("log_flag", ["-v", "-q"]) def test_run(log_flag: str): result = runner.invoke(app, [STRATEGY_NAME, log_flag, "--namespace", "default"]) - assert result.exit_code == 0 + try: + assert result.exit_code == 0 + except AssertionError as e: + raise e from result.exception @pytest.mark.parametrize("format", ["json", "yaml", "table", "pprint"]) -def test_output_json(format: str): +def test_output_formats(format: str): result = runner.invoke(app, [STRATEGY_NAME, "-q", "-f", format, "--namespace", "default"]) - assert result.exit_code == 0 + try: + assert result.exit_code == 0 + except AssertionError as e: + raise e from result.exception if format == "json": - assert json.loads(result.stdout) + assert json.loads(result.stdout), result.stdout if format == "yaml": - assert yaml.safe_load(result.stdout) + assert yaml.safe_load(result.stdout), result.stdout |
