Skip to content

Commit

Permalink
fixed test of empty list of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
osherdp committed Jun 13, 2018
1 parent ff0802f commit 8b120f9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/cli/test_client.py
Expand Up @@ -128,18 +128,19 @@ def test_giving_invalid_paths():

@mock.patch("rotest.cli.client.discover_tests_under_paths",
mock.MagicMock(return_value=set()))
def test_finding_no_test():
def test_finding_no_test(capsys):
with Patcher() as patcher:
patcher.fs.add_real_file(DEFAULT_CONFIG_PATH)
patcher.fs.add_real_file(DEFAULT_SCHEMA_PATH)
patcher.fs.create_file("some_test.py")

sys.argv = ["rotest", "some_test.py"]
with pytest.raises(
ValueError,
match="No test was found at given paths: .*some_test.py"):
with pytest.raises(SystemExit):
main()

out, _ = capsys.readouterr()
assert "No test was found at given paths:" in out


def test_listing_tests(capsys):
class Case(TestCase):
Expand Down

0 comments on commit 8b120f9

Please sign in to comment.