Skip to content

Commit

Permalink
Add test for GenAiPAException for nonzero exit
Browse files Browse the repository at this point in the history
  • Loading branch information
dyastremsky committed Mar 1, 2024
1 parent 5a3f598 commit e7e3808
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/c++/perf_analyzer/genai-pa/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

import pytest
from genai_pa import parser
from genai_pa.exceptions import GenAiPAException
from genai_pa.main import run


class TestCLIArguments:
Expand Down Expand Up @@ -91,3 +93,7 @@ def test_arguments_model_not_provided(self):

# Check that the exit was unsuccessful
assert exc_info.value.code != 0

def test_execption_on_nonzero_exit(self):
with pytest.raises(GenAiPAException) as e:
_ = run(["-m", "nonexistent_model"])

Check warning

Code scanning / CodeQL

Use of the return value of a procedure Warning test

The result of
run
is used even though it is always None.

0 comments on commit e7e3808

Please sign in to comment.