Skip to content

Commit

Permalink
chore: mute warnings in tests / update gitignore (DEV-2609) #498
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Aug 31, 2023
1 parent 2c4e2f8 commit 03e19d7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Expand Up @@ -49,7 +49,7 @@ venv.bak/
.idea
.vscode

# created files
# generated files
out.json
*id2iri_mapping*
**/~$*.*
Expand All @@ -60,3 +60,7 @@ testdata/test-list.json
metrics/
tmp/
/out/
testdata/preprocessed_files/
testdata/bitstreams/nested
processing_result_*.pkl
processed_files.txt
2 changes: 1 addition & 1 deletion src/dsp_tools/import_scripts
Submodule import_scripts updated 1 files
+4 −1 .gitignore
2 changes: 1 addition & 1 deletion test/e2e/test_00A1_import_scripts.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test_cli.py
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions test/unittests/test_excel2json/test_properties.py
Expand Up @@ -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]}
Expand Down Expand Up @@ -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"]})
Expand Down
4 changes: 2 additions & 2 deletions test/unittests/test_excel2xml.py
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 03e19d7

Please sign in to comment.