From 9754aa53869a68bff4bcc752e1e52a1b51d54f05 Mon Sep 17 00:00:00 2001 From: Pierrick Rambaud Date: Wed, 6 Sep 2023 15:26:07 +0000 Subject: [PATCH] test: check that subtest are also successful --- tests/test_copie.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_copie.py b/tests/test_copie.py index 58c4594..e7af0d5 100644 --- a/tests/test_copie.py +++ b/tests/test_copie.py @@ -14,11 +14,7 @@ def test_valid_fixture(copie): # run pytest with the following cmd args result = testdir.runpytest("-v") - - # fnmatch_lines does an assertion internally test_check(result, "test_valid_fixture") - - # make sure that that we get a '0' exit code for the testsuite assert result.ret == 0 @@ -40,6 +36,7 @@ def test_copie_project(copie): result = testdir.runpytest("-v", f"--template={copier_template}") test_check(result, "test_copie_project") + assert result.ret == 0 def test_copie_copie_with_template_kwarg(testdir, copier_template, test_check): @@ -66,6 +63,7 @@ def test_copie_project(copie): # run pytest without the template cli arg result = testdir.runpytest("-v") test_check(result, "test_copie_project") + assert result.ret == 0 def test_copie_fixture_removes_directories(testdir, copier_template, test_check): @@ -87,6 +85,7 @@ def test_previous_directory_is_removed(copie): result = testdir.runpytest("-v", f"--template={copier_template}") test_check(result, "test_create_result") test_check(result, "test_previous_directory_is_removed") + assert result.ret == 0 def test_copie_fixture_keeps_directories(testdir, copier_template, test_check): @@ -110,3 +109,4 @@ def test_previous_directory_is_kept(copie): ) test_check(result, "test_create_result") test_check(result, "test_previous_directory_is_kept") + assert result.ret == 0