From fbff8e72dfa81455625db08ad848d6e2c6115255 Mon Sep 17 00:00:00 2001 From: Almaz Ilaletdinov Date: Wed, 12 Jun 2024 00:44:28 +0300 Subject: [PATCH] Fix empty lines between tests --- tests/test_init.py | 13 +++++++++++++ tests/test_main.py | 1 + 2 files changed, 14 insertions(+) diff --git a/tests/test_init.py b/tests/test_init.py index 6111fd30..d026062b 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -42,10 +42,14 @@ def run_mutation_stub(*_): with patch('mutmut.run_mutation', run_mutation_stub): check_mutants_original(**kwargs) + class ConfigStub: hash_of_tests = None + + config_stub = ConfigStub() + def test_run_mutation_tests_thread_synchronization(monkeypatch): # arrange total_mutants = 3 @@ -80,10 +84,12 @@ def progress_mock_register(*_): close_active_queues() + @fixture def testpatches_path(testdata: Path): return testdata / "test_patches" + def test_read_patch_data_new_empty_file_not_in_the_list(testpatches_path: Path): # arrange new_empty_file_name = "new_empty_file.txt" @@ -95,6 +101,7 @@ def test_read_patch_data_new_empty_file_not_in_the_list(testpatches_path: Path): # assert assert not new_empty_file_name in new_empty_file_changes + def test_read_patch_data_removed_empty_file_not_in_the_list(testpatches_path: Path): # arrange existing_empty_file_name = "existing_empty_file.txt" @@ -106,6 +113,7 @@ def test_read_patch_data_removed_empty_file_not_in_the_list(testpatches_path: Pa # assert assert existing_empty_file_name not in remove_empty_file_changes + def test_read_patch_data_renamed_empty_file_not_in_the_list(testpatches_path: Path): # arrange renamed_empty_file_name = "renamed_existing_empty_file.txt" @@ -117,6 +125,7 @@ def test_read_patch_data_renamed_empty_file_not_in_the_list(testpatches_path: Pa # assert assert renamed_empty_file_name not in renamed_empty_file_changes + def test_read_patch_data_added_line_is_in_the_list(testpatches_path: Path): # arrange file_name = "existing_file.txt" @@ -129,6 +138,7 @@ def test_read_patch_data_added_line_is_in_the_list(testpatches_path: Path): assert file_name in file_changes assert file_changes[file_name] == {3} # line is added between second and third + def test_read_patch_data_edited_line_is_in_the_list(testpatches_path: Path): # arrange file_name = "existing_file.txt" @@ -141,6 +151,7 @@ def test_read_patch_data_edited_line_is_in_the_list(testpatches_path: Path): assert file_name in file_changes assert file_changes[file_name] == {2} # line is added between 2nd and 3rd + def test_read_patch_data_edited_line_in_subfolder_is_in_the_list(testpatches_path: Path): # arrange file_name = os.path.join("sub", "existing_file.txt") # unix will use "/", windows "\" to join @@ -153,6 +164,7 @@ def test_read_patch_data_edited_line_in_subfolder_is_in_the_list(testpatches_pat assert file_name in file_changes assert file_changes[file_name] == {2} # line is added between 2nd and 3rd + def test_read_patch_data_renamed_file_edited_line_is_in_the_list(testpatches_path: Path): # arrange original_file_name = "existing_file.txt" @@ -167,6 +179,7 @@ def test_read_patch_data_renamed_file_edited_line_is_in_the_list(testpatches_pat assert new_file_name in file_changes assert file_changes[new_file_name] == {3} # 3rd line is edited + def test_read_patch_data_mutliple_files(testpatches_path: Path): # arrange expected_changes = { diff --git a/tests/test_main.py b/tests/test_main.py index 22ef3791..95544ca8 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -705,6 +705,7 @@ def test_html_output(surviving_mutants_filesystem): 'foo.py2000.002' '') + def test_html_custom_output(surviving_mutants_filesystem): result = CliRunner().invoke(climain, ['run', '--paths-to-mutate=foo.py', "--test-time-base=15.0"], catch_exceptions=False) print(repr(result.output))