From 03e19d792d947236198afec5de441f8fa3963b0f Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum <39048939+jnussbaum@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:41:21 +0200 Subject: [PATCH] chore: mute warnings in tests / update gitignore (DEV-2609) #498 --- .gitignore | 6 +++++- src/dsp_tools/import_scripts | 2 +- test/e2e/test_00A1_import_scripts.py | 2 +- test/e2e/test_cli.py | 2 +- test/unittests/test_excel2json/test_properties.py | 2 ++ test/unittests/test_excel2xml.py | 4 ++-- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d66efb858..5216a7258 100644 --- a/.gitignore +++ b/.gitignore @@ -49,7 +49,7 @@ venv.bak/ .idea .vscode -# created files +# generated files out.json *id2iri_mapping* **/~$*.* @@ -60,3 +60,7 @@ testdata/test-list.json metrics/ tmp/ /out/ +testdata/preprocessed_files/ +testdata/bitstreams/nested +processing_result_*.pkl +processed_files.txt diff --git a/src/dsp_tools/import_scripts b/src/dsp_tools/import_scripts index 119877793..729249853 160000 --- a/src/dsp_tools/import_scripts +++ b/src/dsp_tools/import_scripts @@ -1 +1 @@ -Subproject commit 1198777939d3e171d5034b75192329a84a78bbcf +Subproject commit 729249853afff0abea9dce9f70ce0f6d2ed3818e diff --git a/test/e2e/test_00A1_import_scripts.py b/test/e2e/test_00A1_import_scripts.py index 9b33e76d3..8040402b1 100644 --- a/test/e2e/test_00A1_import_scripts.py +++ b/test/e2e/test_00A1_import_scripts.py @@ -22,7 +22,7 @@ def tearDown(self) -> None: if os.path.isfile("src/dsp_tools/import_scripts/data-processed.xml"): os.remove("src/dsp_tools/import_scripts/data-processed.xml") - @pytest.mark.filterwarnings("ignore") + @pytest.mark.filterwarnings("ignore::UserWarning") def test_import_scripts(self) -> None: """ Execute the import script in its directory, create the project on the DSP server, and upload the created XML to diff --git a/test/e2e/test_cli.py b/test/e2e/test_cli.py index 51b9942d0..39f9652fd 100644 --- a/test/e2e/test_cli.py +++ b/test/e2e/test_cli.py @@ -272,7 +272,7 @@ def test_id_to_iri(self) -> None: output_expected = f.read() self.assertEqual(output_actual, output_expected) - @pytest.mark.filterwarnings("ignore") + @pytest.mark.filterwarnings("ignore::UserWarning") def test_excel2xml(self) -> None: datafile = Path("testdata/excel2xml/excel2xml-testdata.xlsx") shortcode = "1234" diff --git a/test/unittests/test_excel2json/test_properties.py b/test/unittests/test_excel2json/test_properties.py index d049b87a8..320ea0bfa 100644 --- a/test/unittests/test_excel2json/test_properties.py +++ b/test/unittests/test_excel2json/test_properties.py @@ -355,6 +355,7 @@ def test_validate_properties(self) -> None: with self.assertRaisesRegex(UserError, message): e2j.excel2properties(file, self.outfile) + @pytest.mark.filterwarnings("ignore::UserWarning") def test__rename_deprecated_lang_cols(self) -> None: original_df = pd.DataFrame( {"en": [1, 2, 3], "de": [1, 2, 3], "fr": [1, 2, 3], "it": [1, 2, 3], "rm": [1, 2, 3]} @@ -442,6 +443,7 @@ def test__do_property_excel_compliance(self) -> None: "{error_str}", ) + @pytest.mark.filterwarnings("ignore::UserWarning") def test__rename_deprecated_hlist(self) -> None: original_df = pd.DataFrame({"hlist": [pd.NA, pd.NA, "languages"]}) expected_df = pd.DataFrame({"gui_attributes": [pd.NA, pd.NA, "hlist:languages"]}) diff --git a/test/unittests/test_excel2xml.py b/test/unittests/test_excel2xml.py index 292dc1c3d..81cbb60c4 100644 --- a/test/unittests/test_excel2xml.py +++ b/test/unittests/test_excel2xml.py @@ -445,7 +445,7 @@ def test_make_resptr_prop(self) -> None: invalid_values = [True, 10.0, 5] run_test(self, prop, method, different_values, invalid_values) - @pytest.mark.filterwarnings("ignore") + @pytest.mark.filterwarnings("ignore::UserWarning") def test_make_text_prop(self) -> None: # standard tests prop = "text" @@ -714,7 +714,7 @@ def test_create_json_list_mapping(self) -> None: } self.assertDictEqual(testlist_mapping_returned, testlist_mapping_expected) - @pytest.mark.filterwarnings("ignore") + @pytest.mark.filterwarnings("ignore::UserWarning") def test_excel2xml(self) -> None: # test the valid files, 3 times identical, but in the three formats XLSX, XLS, and CSV with open("testdata/excel2xml/excel2xml-expected-output.xml", encoding="utf-8") as f: