From 8b120f9fbde11a478972db57b3e88144deeee7d0 Mon Sep 17 00:00:00 2001 From: Osher De Paz Date: Thu, 14 Jun 2018 00:19:22 +0300 Subject: [PATCH] fixed test of empty list of tests --- tests/cli/test_client.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/cli/test_client.py b/tests/cli/test_client.py index f0d7be5c..73cc1121 100644 --- a/tests/cli/test_client.py +++ b/tests/cli/test_client.py @@ -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):