Repository: matchms/matchms

Issue:
Rearrange tests in folders
Since there are plenty of tests, it might be better to rearrange them into folders regarding the different topics to make things a bit more organized.

Discussion:

Patch:
diff --git a/README.rst b/README.rst
index ca66c274..42885b93 100644
--- a/README.rst
+++ b/README.rst
@@ -164,7 +164,7 @@ Introduction
 
 To get started with matchms, we recommend following our `matchms introduction tutorial <https://blog.esciencecenter.nl/build-your-own-mass-spectrometry-analysis-pipeline-in-python-using-matchms-part-i-d96c718c68ee>`_.
 
-Below is a small example of using matchms to calculate the Cosine score between mass Spectrums in the `tests/pesticides.mgf <https://github.com/matchms/matchms/blob/master/tests/pesticides.mgf>`_ file.
+Below is a small example of using matchms to calculate the Cosine score between mass Spectrums in the `tests/testdata/pesticides.mgf <https://github.com/matchms/matchms/blob/master/tests/testdata/pesticides.mgf>`_ file.
 
 .. code-block:: python
 
@@ -173,7 +173,7 @@ Below is a small example of using matchms to calculate the Cosine score between
     pipeline = Pipeline()
     
     # Read spectrums from a MGF formatted file, for other formats see https://matchms.readthedocs.io/en/latest/api/matchms.importing.html 
-    pipeline.query_files = "tests/pesticides.mgf"
+    pipeline.query_files = "tests/testdata/pesticides.mgf"
     pipeline.filter_steps_queries = [
         ["default_filters"],
         ["add_parent_mass"],
@@ -202,7 +202,7 @@ steps can run without using the matchms ``Pipeline``:
     from matchms.similarity import CosineGreedy
 
     # Read spectrums from a MGF formatted file, for other formats see https://matchms.readthedocs.io/en/latest/api/matchms.importing.html 
-    file = load_from_mgf("tests/pesticides.mgf")
+    file = load_from_mgf("tests/testdata/pesticides.mgf")
 
     # Apply filters to clean and enhance each spectrum
     spectrums = []
diff --git a/matchms/exporting/save_as_mgf.py b/matchms/exporting/save_as_mgf.py
index 0a449d44..c73183cd 100644
--- a/matchms/exporting/save_as_mgf.py
+++ b/matchms/exporting/save_as_mgf.py
@@ -43,4 +43,5 @@ def save_as_mgf(spectrums: List[Spectrum], filename: str):
                          "intensity array": spectrum.peaks.intensities,
                          "params": spectrum.metadata}
         # Append spectrum to file
-        py_mgf.write([spectrum_dict], filename)
+        with open(filename, 'a', encoding="utf-8") as out:
+            py_mgf.write(spectrum_dict, out)
diff --git a/readthedocs/index.rst b/readthedocs/index.rst
index e6627203..a397ee12 100644
--- a/readthedocs/index.rst
+++ b/readthedocs/index.rst
@@ -43,7 +43,7 @@ Install matchms from Anaconda Cloud with
 Example
 =======
 
-Below is a small example of using matchms to calculate the Cosine score between mass Spectrums in the `tests/pesticides.mgf <https://github.com/matchms/matchms/blob/master/tests/pesticides.mgf>`_ file.
+Below is a small example of using matchms to calculate the Cosine score between mass Spectrums in the `tests/testdata/pesticides.mgf <https://github.com/matchms/matchms/blob/master/tests/testdata/pesticides.mgf>`_ file.
 
 .. testcode::
 
@@ -54,7 +54,7 @@ Below is a small example of using matchms to calculate the Cosine score between
     from matchms.similarity import CosineGreedy
 
     # Read spectrums from a MGF formatted file, for other formats see https://matchms.readthedocs.io/en/latest/api/matchms.importing.html
-    file = load_from_mgf("../tests/pesticides.mgf")
+    file = load_from_mgf("../tests/testdata/pesticides.mgf")
 
     # Apply filters to clean and enhance each spectrum
     spectrums = []


Test patch:
diff --git a/integration-tests/test_user_workflow.py b/integration-tests/test_user_workflow.py
index 0bcd90ce..7b4cd1e9 100644
--- a/integration-tests/test_user_workflow.py
+++ b/integration-tests/test_user_workflow.py
@@ -7,7 +7,7 @@ from matchms.similarity import CosineGreedy
 
 def test_user_workflow():
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectrums_file = os.path.join(module_root, "tests", "pesticides.mgf")
+    spectrums_file = os.path.join(module_root, "tests", "testdata", "pesticides.mgf")
 
     pipeline = Pipeline()
     pipeline.query_files = spectrums_file
diff --git a/tests/exporting/__init__.py b/tests/exporting/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/tests/exporting/__init__.py
@@ -0,0 +1,1 @@
+# -*- coding: utf-8 -*-
diff --git a/tests/test_exporting_metadata.py b/tests/exporting/test_exporting_metadata.py
similarity index 78%
rename from tests/test_exporting_metadata.py
rename to tests/exporting/test_exporting_metadata.py
index 916b213d..7f7d732d 100644
--- a/tests/test_exporting_metadata.py
+++ b/tests/exporting/test_exporting_metadata.py
@@ -13,8 +13,8 @@ from tests.builder_Spectrum import SpectrumBuilder
 
 @pytest.fixture
 def spectra():
-    module_root = os.path.dirname(__file__)
-    inpath = os.path.join(module_root, "MoNA-export-GC-MS-first10.msp")
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    inpath = os.path.join(module_root, "testdata", "MoNA-export-GC-MS-first10.msp")
     spectra = list(load_from_msp(inpath))
     return spectra
 
@@ -34,7 +34,8 @@ def test_get_metadata_as_array(spectra):
 
 
 def test_export_as_csv(tmp_path, spectra):
-    expected = os.path.join(os.path.dirname(__file__), "expected_metadata.csv")    
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    expected = os.path.join(module_root, "testdata", "expected_metadata.csv")    
     outpath = tmp_path / "metadata.csv"
     export_metadata_as_csv(spectra, outpath)
 
@@ -53,7 +54,8 @@ def test_subset_metadata(spectra):
 
 def test_export_metadata_as_json(tmp_path, spectra):
     outpath = tmp_path / "metadata.json"
-    expected = os.path.join(os.path.dirname(__file__), "expected_metadata.json")    
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    expected = os.path.join(module_root, "testdata","expected_metadata.json")    
 
     export_metadata_as_json(spectra, outpath)
     filecmp.cmp(outpath, expected)
diff --git a/tests/test_save_as_json_load_from_json.py b/tests/exporting/test_save_as_json_load_from_json.py
similarity index 98%
rename from tests/test_save_as_json_load_from_json.py
rename to tests/exporting/test_save_as_json_load_from_json.py
index 583b6ab9..cdf31c42 100644
--- a/tests/test_save_as_json_load_from_json.py
+++ b/tests/exporting/test_save_as_json_load_from_json.py
@@ -17,7 +17,7 @@ def builder() -> SpectrumBuilder:
 
 def load_test_spectra_file(test_filename):
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectrums_file = os.path.join(module_root, "tests", test_filename)
+    spectrums_file = os.path.join(module_root, "testdata", test_filename)
     spectra = list(load_from_json(spectrums_file))
     return spectra
 
diff --git a/tests/test_save_as_mgf.py b/tests/exporting/test_save_as_mgf.py
similarity index 97%
rename from tests/test_save_as_mgf.py
rename to tests/exporting/test_save_as_mgf.py
index 77afdf5f..5ad74700 100644
--- a/tests/test_save_as_mgf.py
+++ b/tests/exporting/test_save_as_mgf.py
@@ -4,12 +4,12 @@ import numpy as np
 import pytest
 from matchms.exporting import save_as_mgf
 from matchms.importing import load_from_mgf
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def load_test_spectra_file(test_filename):
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectrums_file = os.path.join(module_root, "tests", test_filename)
+    spectrums_file = os.path.join(module_root, "testdata", test_filename)
     spectra = list(load_from_mgf(spectrums_file))
     return spectra
 
diff --git a/tests/test_save_as_msp.py b/tests/exporting/test_save_as_msp.py
similarity index 94%
rename from tests/test_save_as_msp.py
rename to tests/exporting/test_save_as_msp.py
index 8e63881b..b70990fb 100644
--- a/tests/test_save_as_msp.py
+++ b/tests/exporting/test_save_as_msp.py
@@ -6,7 +6,7 @@ import pytest
 from matchms import Spectrum
 from matchms.exporting import save_as_msp
 from matchms.importing import load_from_msp
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.fixture
@@ -28,7 +28,7 @@ def data(request):
 
 def load_test_spectra_file(test_filename):
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectrums_file = os.path.join(module_root, "tests", test_filename)
+    spectrums_file = os.path.join(module_root, "testdata", test_filename)
     spectra = list(load_from_msp(spectrums_file))
     return spectra
 
diff --git a/tests/filtering/__init__.py b/tests/filtering/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/tests/filtering/__init__.py
@@ -0,0 +1,1 @@
+# -*- coding: utf-8 -*-
diff --git a/tests/test_add_compound_name.py b/tests/filtering/test_add_compound_name.py
similarity index 95%
rename from tests/test_add_compound_name.py
rename to tests/filtering/test_add_compound_name.py
index 45ea3ae0..4dc5549f 100644
--- a/tests/test_add_compound_name.py
+++ b/tests/filtering/test_add_compound_name.py
@@ -2,7 +2,7 @@ import pytest
 from testfixtures import LogCapture
 from matchms.filtering import add_compound_name
 from matchms.logging_functions import reset_matchms_logger
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, expected, check_log", [
diff --git a/tests/test_add_fingerprint.py b/tests/filtering/test_add_fingerprint.py
similarity index 96%
rename from tests/test_add_fingerprint.py
rename to tests/filtering/test_add_fingerprint.py
index e012dcc5..5a8dbd46 100644
--- a/tests/test_add_fingerprint.py
+++ b/tests/filtering/test_add_fingerprint.py
@@ -4,7 +4,7 @@ from testfixtures import LogCapture
 from matchms.filtering import add_fingerprint
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize('metadata, expected', [
diff --git a/tests/test_add_losses.py b/tests/filtering/test_add_losses.py
similarity index 98%
rename from tests/test_add_losses.py
rename to tests/filtering/test_add_losses.py
index 0ee85218..fce3ac3c 100644
--- a/tests/test_add_losses.py
+++ b/tests/filtering/test_add_losses.py
@@ -2,7 +2,7 @@ import numpy as np
 import pytest
 from testfixtures import LogCapture
 from matchms.filtering import add_losses
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("mz, loss_mz_to, expected_mz, expected_intensities", [
diff --git a/tests/test_add_parent_mass.py b/tests/filtering/test_add_parent_mass.py
similarity index 99%
rename from tests/test_add_parent_mass.py
rename to tests/filtering/test_add_parent_mass.py
index 198db736..29653cbd 100644
--- a/tests/test_add_parent_mass.py
+++ b/tests/filtering/test_add_parent_mass.py
@@ -2,7 +2,7 @@ import numpy as np
 import pytest
 from matchms.constants import PROTON_MASS
 from matchms.filtering import add_parent_mass
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize('metadata, expected', [
diff --git a/tests/test_add_precursor_mz.py b/tests/filtering/test_add_precursor_mz.py
similarity index 98%
rename from tests/test_add_precursor_mz.py
rename to tests/filtering/test_add_precursor_mz.py
index 166a7167..e21c64b0 100644
--- a/tests/test_add_precursor_mz.py
+++ b/tests/filtering/test_add_precursor_mz.py
@@ -3,7 +3,7 @@ import pytest
 from matchms.filtering import add_precursor_mz
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, expected", [
diff --git a/tests/test_add_retention.py b/tests/filtering/test_add_retention.py
similarity index 94%
rename from tests/test_add_retention.py
rename to tests/filtering/test_add_retention.py
index f1da9836..b4d9b1e4 100644
--- a/tests/test_add_retention.py
+++ b/tests/filtering/test_add_retention.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import add_retention_index, add_retention_time
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, expected", [
diff --git a/tests/test_clean_compound_name.py b/tests/filtering/test_clean_compound_name.py
similarity index 96%
rename from tests/test_clean_compound_name.py
rename to tests/filtering/test_clean_compound_name.py
index 335e7171..4a1ca017 100644
--- a/tests/test_clean_compound_name.py
+++ b/tests/filtering/test_clean_compound_name.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import clean_compound_name
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("name, expected", [
diff --git a/tests/test_correct_charge.py b/tests/filtering/test_correct_charge.py
similarity index 93%
rename from tests/test_correct_charge.py
rename to tests/filtering/test_correct_charge.py
index 3a9400fa..0b38cebc 100644
--- a/tests/test_correct_charge.py
+++ b/tests/filtering/test_correct_charge.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import correct_charge
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, expected", [
diff --git a/tests/test_derive_adduct_from_name.py b/tests/filtering/test_derive_adduct_from_name.py
similarity index 97%
rename from tests/test_derive_adduct_from_name.py
rename to tests/filtering/test_derive_adduct_from_name.py
index a48fd70b..94dd02d4 100644
--- a/tests/test_derive_adduct_from_name.py
+++ b/tests/filtering/test_derive_adduct_from_name.py
@@ -3,7 +3,7 @@ from testfixtures import LogCapture
 from matchms.filtering import derive_adduct_from_name
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, remove_adduct_from_name, expected_adduct, expected_name, removed_adduct", [
diff --git a/tests/test_derive_formula_from_name.py b/tests/filtering/test_derive_formula_from_name.py
similarity index 98%
rename from tests/test_derive_formula_from_name.py
rename to tests/filtering/test_derive_formula_from_name.py
index cd92ec71..f4606929 100644
--- a/tests/test_derive_formula_from_name.py
+++ b/tests/filtering/test_derive_formula_from_name.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import derive_formula_from_name
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, remove_formula_from_name, expected_formula, expected_compound_name", [
diff --git a/tests/test_derive_inchi_from_inchikey.py b/tests/filtering/test_derive_inchi_from_inchikey.py
similarity index 95%
rename from tests/test_derive_inchi_from_inchikey.py
rename to tests/filtering/test_derive_inchi_from_inchikey.py
index 66d3da06..720689f4 100644
--- a/tests/test_derive_inchi_from_inchikey.py
+++ b/tests/filtering/test_derive_inchi_from_inchikey.py
@@ -3,7 +3,7 @@ from testfixtures import LogCapture
 from matchms.filtering import derive_inchikey_from_inchi
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def test_derive_inchikey_from_inchi():
diff --git a/tests/test_derive_inchi_from_smiles.py b/tests/filtering/test_derive_inchi_from_smiles.py
similarity index 95%
rename from tests/test_derive_inchi_from_smiles.py
rename to tests/filtering/test_derive_inchi_from_smiles.py
index 13b81dfd..c2300ee5 100644
--- a/tests/test_derive_inchi_from_smiles.py
+++ b/tests/filtering/test_derive_inchi_from_smiles.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import derive_inchi_from_smiles
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def test_derive_inchi_from_smiles():
diff --git a/tests/test_derive_ionmode.py b/tests/filtering/test_derive_ionmode.py
similarity index 93%
rename from tests/test_derive_ionmode.py
rename to tests/filtering/test_derive_ionmode.py
index ae6c9b2c..f02bda5f 100644
--- a/tests/test_derive_ionmode.py
+++ b/tests/filtering/test_derive_ionmode.py
@@ -1,5 +1,5 @@
 from matchms.filtering import derive_ionmode
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def test_derive_ionmode_positive_adduct():
diff --git a/tests/test_derive_smiles_from_inchi.py b/tests/filtering/test_derive_smiles_from_inchi.py
similarity index 96%
rename from tests/test_derive_smiles_from_inchi.py
rename to tests/filtering/test_derive_smiles_from_inchi.py
index 42df9b3a..e0b6661f 100644
--- a/tests/test_derive_smiles_from_inchi.py
+++ b/tests/filtering/test_derive_smiles_from_inchi.py
@@ -3,7 +3,7 @@ from testfixtures import LogCapture
 from matchms.filtering import derive_smiles_from_inchi
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def test_derive_smiles_from_inchi():
diff --git a/tests/test_harmonize_undefined_inchi.py b/tests/filtering/test_harmonize_undefined_inchi.py
similarity index 95%
rename from tests/test_harmonize_undefined_inchi.py
rename to tests/filtering/test_harmonize_undefined_inchi.py
index b9fe39b5..db98978f 100644
--- a/tests/test_harmonize_undefined_inchi.py
+++ b/tests/filtering/test_harmonize_undefined_inchi.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import harmonize_undefined_inchi
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, aliases, undefined, expected", [
diff --git a/tests/test_harmonize_undefined_inchikey.py b/tests/filtering/test_harmonize_undefined_inchikey.py
similarity index 95%
rename from tests/test_harmonize_undefined_inchikey.py
rename to tests/filtering/test_harmonize_undefined_inchikey.py
index 5f86c5b5..b0a25236 100644
--- a/tests/test_harmonize_undefined_inchikey.py
+++ b/tests/filtering/test_harmonize_undefined_inchikey.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import harmonize_undefined_inchikey
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, aliases, undefined, expected", [
diff --git a/tests/test_harmonize_undefined_smiles.py b/tests/filtering/test_harmonize_undefined_smiles.py
similarity index 95%
rename from tests/test_harmonize_undefined_smiles.py
rename to tests/filtering/test_harmonize_undefined_smiles.py
index eff5426c..6cefeef9 100644
--- a/tests/test_harmonize_undefined_smiles.py
+++ b/tests/filtering/test_harmonize_undefined_smiles.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import harmonize_undefined_smiles
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, aliases, undefined, expected", [
diff --git a/tests/test_interpret_pepmass.py b/tests/filtering/test_interpret_pepmass.py
similarity index 98%
rename from tests/test_interpret_pepmass.py
rename to tests/filtering/test_interpret_pepmass.py
index e7f26008..c02f3786 100644
--- a/tests/test_interpret_pepmass.py
+++ b/tests/filtering/test_interpret_pepmass.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import interpret_pepmass
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("input_pepmass, expected_results",
diff --git a/tests/test_load_adducts.py b/tests/filtering/test_load_adducts.py
similarity index 100%
rename from tests/test_load_adducts.py
rename to tests/filtering/test_load_adducts.py
diff --git a/tests/test_make_charge_int.py b/tests/filtering/test_make_charge_int.py
similarity index 96%
rename from tests/test_make_charge_int.py
rename to tests/filtering/test_make_charge_int.py
index 9b1e4d89..c84d2158 100644
--- a/tests/test_make_charge_int.py
+++ b/tests/filtering/test_make_charge_int.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import make_charge_int
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("input_charge, corrected_charge", [('+1', 1),
diff --git a/tests/test_make_charge_scalar.py b/tests/filtering/test_make_charge_scalar.py
similarity index 95%
rename from tests/test_make_charge_scalar.py
rename to tests/filtering/test_make_charge_scalar.py
index 45e990ab..69b63baf 100644
--- a/tests/test_make_charge_scalar.py
+++ b/tests/filtering/test_make_charge_scalar.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import make_charge_scalar
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("input_charge, corrected_charge", [
diff --git a/tests/test_normalize_intensities.py b/tests/filtering/test_normalize_intensities.py
similarity index 98%
rename from tests/test_normalize_intensities.py
rename to tests/filtering/test_normalize_intensities.py
index 3c28dab4..ecd001a2 100644
--- a/tests/test_normalize_intensities.py
+++ b/tests/filtering/test_normalize_intensities.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import add_losses, normalize_intensities
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("mz, intensities", [
diff --git a/tests/test_reduce_to_number_of_peaks.py b/tests/filtering/test_reduce_to_number_of_peaks.py
similarity index 99%
rename from tests/test_reduce_to_number_of_peaks.py
rename to tests/filtering/test_reduce_to_number_of_peaks.py
index 4a215e4c..6e270ed1 100644
--- a/tests/test_reduce_to_number_of_peaks.py
+++ b/tests/filtering/test_reduce_to_number_of_peaks.py
@@ -4,7 +4,7 @@ from testfixtures import LogCapture
 from matchms.filtering import reduce_to_number_of_peaks
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata", [{}, {"parent_mass": 50}])
diff --git a/tests/test_remove_peaks_around_precursor_mz.py b/tests/filtering/test_remove_peaks_around_precursor_mz.py
similarity index 98%
rename from tests/test_remove_peaks_around_precursor_mz.py
rename to tests/filtering/test_remove_peaks_around_precursor_mz.py
index 8a336e05..6f631f1f 100644
--- a/tests/test_remove_peaks_around_precursor_mz.py
+++ b/tests/filtering/test_remove_peaks_around_precursor_mz.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import remove_peaks_around_precursor_mz
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.fixture
diff --git a/tests/test_remove_peaks_outside_top_k.py b/tests/filtering/test_remove_peaks_outside_top_k.py
similarity index 96%
rename from tests/test_remove_peaks_outside_top_k.py
rename to tests/filtering/test_remove_peaks_outside_top_k.py
index b9180fc6..b6033ef2 100644
--- a/tests/test_remove_peaks_outside_top_k.py
+++ b/tests/filtering/test_remove_peaks_outside_top_k.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import remove_peaks_outside_top_k
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("peaks, k, mz_window, expected", [
diff --git a/tests/test_repair_inchi_inchikey_smiles.py b/tests/filtering/test_repair_inchi_inchikey_smiles.py
similarity index 98%
rename from tests/test_repair_inchi_inchikey_smiles.py
rename to tests/filtering/test_repair_inchi_inchikey_smiles.py
index a1114018..1397d928 100644
--- a/tests/test_repair_inchi_inchikey_smiles.py
+++ b/tests/filtering/test_repair_inchi_inchikey_smiles.py
@@ -1,6 +1,6 @@
 import pytest
 from matchms.filtering import repair_inchi_inchikey_smiles
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, expected_inchi, expected_inchikey, expected_smiles", [
diff --git a/tests/test_require_minimum_number_of_peaks.py b/tests/filtering/test_require_minimum_number_of_peaks.py
similarity index 98%
rename from tests/test_require_minimum_number_of_peaks.py
rename to tests/filtering/test_require_minimum_number_of_peaks.py
index 12d53557..67011a19 100644
--- a/tests/test_require_minimum_number_of_peaks.py
+++ b/tests/filtering/test_require_minimum_number_of_peaks.py
@@ -2,7 +2,7 @@ import numpy as np
 import pytest
 from matchms.filtering import require_minimum_number_of_peaks
 from matchms.typing import SpectrumType
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.fixture
diff --git a/tests/test_require_minimum_of_high_peaks.py b/tests/filtering/test_require_minimum_of_high_peaks.py
similarity index 97%
rename from tests/test_require_minimum_of_high_peaks.py
rename to tests/filtering/test_require_minimum_of_high_peaks.py
index a0a4d6b9..26d15b15 100644
--- a/tests/test_require_minimum_of_high_peaks.py
+++ b/tests/filtering/test_require_minimum_of_high_peaks.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import require_minimum_of_high_peaks
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("peaks, no_peaks, intensity_percent, expected", [
diff --git a/tests/test_require_precursor_below_mz.py b/tests/filtering/test_require_precursor_below_mz.py
similarity index 98%
rename from tests/test_require_precursor_below_mz.py
rename to tests/filtering/test_require_precursor_below_mz.py
index b9dcfb08..53bcb701 100644
--- a/tests/test_require_precursor_below_mz.py
+++ b/tests/filtering/test_require_precursor_below_mz.py
@@ -4,7 +4,7 @@ from testfixtures import LogCapture
 from matchms.filtering import require_precursor_below_mz
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, max_mz, expected", [
diff --git a/tests/test_require_precursor_mz.py b/tests/filtering/test_require_precursor_mz.py
similarity index 98%
rename from tests/test_require_precursor_mz.py
rename to tests/filtering/test_require_precursor_mz.py
index 61f8c39b..e6efb74c 100644
--- a/tests/test_require_precursor_mz.py
+++ b/tests/filtering/test_require_precursor_mz.py
@@ -4,7 +4,7 @@ from testfixtures import LogCapture
 from matchms.filtering.require_precursor_mz import require_precursor_mz
 from matchms.logging_functions import (reset_matchms_logger,
                                        set_matchms_logger_level)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("metadata, expected", [
diff --git a/tests/test_select_by_intensity.py b/tests/filtering/test_select_by_intensity.py
similarity index 97%
rename from tests/test_select_by_intensity.py
rename to tests/filtering/test_select_by_intensity.py
index 98d0cacc..e74ab207 100644
--- a/tests/test_select_by_intensity.py
+++ b/tests/filtering/test_select_by_intensity.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import select_by_intensity
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("peaks, intensity_from, intensity_to, expected", [
diff --git a/tests/test_select_by_mz.py b/tests/filtering/test_select_by_mz.py
similarity index 97%
rename from tests/test_select_by_mz.py
rename to tests/filtering/test_select_by_mz.py
index d234cc1c..d68b6708 100644
--- a/tests/test_select_by_mz.py
+++ b/tests/filtering/test_select_by_mz.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.filtering import select_by_mz
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.mark.parametrize("peaks, mz_from, mz_to, expected", [
diff --git a/tests/test_select_by_relative_intensity.py b/tests/filtering/test_select_by_relative_intensity.py
similarity index 97%
rename from tests/test_select_by_relative_intensity.py
rename to tests/filtering/test_select_by_relative_intensity.py
index 1c5310e1..6da6c998 100644
--- a/tests/test_select_by_relative_intensity.py
+++ b/tests/filtering/test_select_by_relative_intensity.py
@@ -2,7 +2,7 @@ import numpy as np
 import pytest
 from matchms import Spectrum
 from matchms.filtering import select_by_relative_intensity
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.fixture
diff --git a/tests/importing/__init__.py b/tests/importing/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/tests/importing/__init__.py
@@ -0,0 +1,1 @@
+# -*- coding: utf-8 -*-
diff --git a/tests/test_load_from_mgf.py b/tests/importing/test_load_from_mgf.py
similarity index 80%
rename from tests/test_load_from_mgf.py
rename to tests/importing/test_load_from_mgf.py
index 8de2f115..921fedee 100644
--- a/tests/test_load_from_mgf.py
+++ b/tests/importing/test_load_from_mgf.py
@@ -5,7 +5,7 @@ from matchms.importing import load_from_mgf
 
 def test_load_from_mgf_using_filepath():
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectra_file = os.path.join(module_root, "tests", "pesticides.mgf")
+    spectra_file = os.path.join(module_root, "testdata", "pesticides.mgf")
 
     spectra = list(load_from_mgf(spectra_file))
 
@@ -15,7 +15,7 @@ def test_load_from_mgf_using_filepath():
 
 def test_load_from_mgf_using_file():
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectra_filepath = os.path.join(module_root, "tests", "pesticides.mgf")
+    spectra_filepath = os.path.join(module_root, "testdata", "pesticides.mgf")
 
     with open(spectra_filepath, "r", encoding="utf-8") as spectra_file:
         spectra = list(load_from_mgf(spectra_file))
diff --git a/tests/test_load_from_msp.py b/tests/importing/test_load_from_msp.py
similarity index 94%
rename from tests/test_load_from_msp.py
rename to tests/importing/test_load_from_msp.py
index e651f10a..21fffb26 100644
--- a/tests/test_load_from_msp.py
+++ b/tests/importing/test_load_from_msp.py
@@ -28,7 +28,7 @@ def test_load_from_msp_spaces_mona_1():
 
     module_root = os.path.join(os.path.dirname(__file__), "..")
     spectrums_file = os.path.join(
-        module_root, "tests", "MoNA-export-GC-MS-first10.msp")
+        module_root, "testdata", "MoNA-export-GC-MS-first10.msp")
     spectrum = list(load_from_msp(spectrums_file))
 
     expected_inchikey = np.array([
@@ -50,7 +50,7 @@ def test_load_from_msp_spaces_mona_2():
     """
     module_root = os.path.join(os.path.dirname(__file__), "..")
     spectrums_file = os.path.join(
-        module_root, "tests", "MoNA-export-GC-MS-first10.msp")
+        module_root, "testdata", "MoNA-export-GC-MS-first10.msp")
     spectrum = next(iter(load_from_msp(spectrums_file)))
 
     expected_mz = np.array([
@@ -83,7 +83,7 @@ def test_load_from_msp_spaces_massbank_1():
 
     module_root = os.path.join(os.path.dirname(__file__), "..")
     spectrums_file = os.path.join(
-        module_root, "tests", "massbank_five_spectra.msp")
+        module_root, "testdata", "massbank_five_spectra.msp")
     spectrum = list(load_from_msp(spectrums_file))
 
     expected_inchikey = [
@@ -111,7 +111,7 @@ def test_load_from_msp_tabs():
 
     module_root = os.path.join(os.path.dirname(__file__), "..")
     spectrums_file = os.path.join(
-        module_root, "tests", "rcx_gc-ei_ms_20201028_perylene.msp")
+        module_root, "testdata", "rcx_gc-ei_ms_20201028_perylene.msp")
     spectra = list(load_from_msp(spectrums_file))
 
     expected_inchikey = np.array([
@@ -154,7 +154,7 @@ def test_load_from_msp_multiline():
 
     module_root = os.path.join(os.path.dirname(__file__), "..")
     spectrums_file = os.path.join(
-        module_root, "tests", "multiline_semicolon.msp")
+        module_root, "testdata", "multiline_semicolon.msp")
 
     actual = list(load_from_msp(spectrums_file))
     expected = [
@@ -194,7 +194,7 @@ def test_load_from_msp_diverse_spectrum_collection():
 
     module_root = os.path.join(os.path.dirname(__file__), "..")
     spectrums_file = os.path.join(
-        module_root, "tests", "test_spectra_collection.msp")
+        module_root, "testdata", "test_spectra_collection.msp")
     spectrum = load_from_msp(spectrums_file)
 
     expected_inchikey = np.array([
@@ -218,7 +218,7 @@ def test_load_from_msp_diverse_spectrum_collection():
 
 def test_load_msl():
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectrums_file = os.path.join(module_root, "tests", "JL_2021_V2.msl")
+    spectrums_file = os.path.join(module_root, "testdata", "JL_2021_V2.msl")
     actual = list(load_from_msp(spectrums_file))[0]
 
     metadata = {
@@ -241,7 +241,7 @@ def test_load_msl():
 
 def test_load_golm_style_msp():
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectrums_file = os.path.join(module_root, "tests", "golm.msp")
+    spectrums_file = os.path.join(module_root, "testdata", "golm.msp")
     actual = list(load_from_msp(spectrums_file))
 
     assert len(actual) == 3
diff --git a/tests/test_load_from_mzml.py b/tests/importing/test_load_from_mzml.py
similarity index 79%
rename from tests/test_load_from_mzml.py
rename to tests/importing/test_load_from_mzml.py
index fe123c05..14926fe6 100644
--- a/tests/test_load_from_mzml.py
+++ b/tests/importing/test_load_from_mzml.py
@@ -5,8 +5,8 @@ from matchms.importing import load_from_mzml
 def test_load_from_mzml():
     """Test parsing of mzml file to spectrum objects"""
 
-    module_root = os.path.dirname(__file__)
-    mzml_file = os.path.join(module_root, "testdata.mzml")
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    mzml_file = os.path.join(module_root, "testdata", "testdata.mzml")
     spectrums = list(load_from_mzml(mzml_file))
 
     assert len(spectrums) == 10, "Expected 10 spectrums."
diff --git a/tests/test_load_from_mzxml.py b/tests/importing/test_load_from_mzxml.py
similarity index 76%
rename from tests/test_load_from_mzxml.py
rename to tests/importing/test_load_from_mzxml.py
index c1938745..07c0513e 100644
--- a/tests/test_load_from_mzxml.py
+++ b/tests/importing/test_load_from_mzxml.py
@@ -5,8 +5,8 @@ from matchms.importing import load_from_mzxml
 def test_load_from_mzxml():
     """Test parsing of mzxml file to spectrum objects"""
 
-    module_root = os.path.dirname(__file__)
-    mzxml_file = os.path.join(module_root, "testdata.mzXML")
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    mzxml_file = os.path.join(module_root, "testdata", "testdata.mzXML")
     spectrum = next(load_from_mzxml(mzxml_file))
 
     assert len(list(load_from_mzxml(mzxml_file))) == 1, "Expected single spectrum"
@@ -18,8 +18,8 @@ def test_load_from_mzxml():
 def test_load_from_mzxml_ms_levels():
     """Test parsing of mzxml file to spectrum objects using different ms levels."""
 
-    module_root = os.path.dirname(__file__)
-    mzxml_file = os.path.join(module_root, "testdata.mzXML")
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    mzxml_file = os.path.join(module_root, "testdata", "testdata.mzXML")
 
     expected_num_spectra = [1, 1, 3, 0]
     for i in range(4):
diff --git a/tests/test_load_from_usi.py b/tests/importing/test_load_from_usi.py
similarity index 96%
rename from tests/test_load_from_usi.py
rename to tests/importing/test_load_from_usi.py
index 4911ca50..c2e6e270 100644
--- a/tests/test_load_from_usi.py
+++ b/tests/importing/test_load_from_usi.py
@@ -1,7 +1,7 @@
 from unittest.mock import Mock, patch
 import numpy as np
 from matchms.importing import load_from_usi
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @patch("requests.get")
diff --git a/tests/test_load_spectra.py b/tests/importing/test_load_spectra.py
similarity index 99%
rename from tests/test_load_spectra.py
rename to tests/importing/test_load_spectra.py
index cbb7d2d1..bc305ce5 100644
--- a/tests/test_load_spectra.py
+++ b/tests/importing/test_load_spectra.py
@@ -19,7 +19,7 @@ def test_load_spectra_unknown_file(tmp_path):
 ])
 def test_load_spectra(filename, ftype, expected_num_spectra):
     """Test if pickled file is loaded in correctly"""
-    tests_root = os.path.join(os.path.dirname(__file__), "../tests")
+    tests_root = os.path.join(os.path.dirname(__file__), "../testdata")
     file = os.path.join(tests_root, filename)
     actual = list(load_spectra(file, ftype=ftype))
    
diff --git a/tests/networking/__init__.py b/tests/networking/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/tests/networking/__init__.py
@@ -0,0 +1,1 @@
+# -*- coding: utf-8 -*-
diff --git a/tests/test_SimilarityNetwork.py b/tests/networking/test_SimilarityNetwork.py
similarity index 100%
rename from tests/test_SimilarityNetwork.py
rename to tests/networking/test_SimilarityNetwork.py
diff --git a/tests/test_networking_functions.py b/tests/networking/test_networking_functions.py
similarity index 100%
rename from tests/test_networking_functions.py
rename to tests/networking/test_networking_functions.py
diff --git a/tests/plotting/__init__.py b/tests/plotting/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/tests/plotting/__init__.py
@@ -0,0 +1,1 @@
+# -*- coding: utf-8 -*-
diff --git a/tests/test_spectrum_plots.py b/tests/plotting/test_spectrum_plots.py
similarity index 100%
rename from tests/test_spectrum_plots.py
rename to tests/plotting/test_spectrum_plots.py
diff --git a/tests/similarity/__init__.py b/tests/similarity/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/tests/similarity/__init__.py
@@ -0,0 +1,1 @@
+# -*- coding: utf-8 -*-
diff --git a/tests/test_cosine_greedy.py b/tests/similarity/test_cosine_greedy.py
similarity index 98%
rename from tests/test_cosine_greedy.py
rename to tests/similarity/test_cosine_greedy.py
index 1ca714b4..3beea1d5 100644
--- a/tests/test_cosine_greedy.py
+++ b/tests/similarity/test_cosine_greedy.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.similarity import CosineGreedy
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def compute_expected_score(mz_power, intensity_power, spectrum_1, spectrum_2, matches):
diff --git a/tests/test_cosine_hungarian.py b/tests/similarity/test_cosine_hungarian.py
similarity index 100%
rename from tests/test_cosine_hungarian.py
rename to tests/similarity/test_cosine_hungarian.py
diff --git a/tests/test_fingerprint_similarity.py b/tests/similarity/test_fingerprint_similarity.py
similarity index 100%
rename from tests/test_fingerprint_similarity.py
rename to tests/similarity/test_fingerprint_similarity.py
diff --git a/tests/test_intersect_mz.py b/tests/similarity/test_intersect_mz.py
similarity index 93%
rename from tests/test_intersect_mz.py
rename to tests/similarity/test_intersect_mz.py
index 46d283d8..5561dc4d 100644
--- a/tests/test_intersect_mz.py
+++ b/tests/similarity/test_intersect_mz.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.similarity import IntersectMz
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def test_intersect_mz_without_parameters():
diff --git a/tests/test_modified_cosine.py b/tests/similarity/test_modified_cosine.py
similarity index 99%
rename from tests/test_modified_cosine.py
rename to tests/similarity/test_modified_cosine.py
index 46439272..b3c90d58 100644
--- a/tests/test_modified_cosine.py
+++ b/tests/similarity/test_modified_cosine.py
@@ -3,7 +3,7 @@ import pytest
 from matchms import Spectrum
 from matchms.filtering import normalize_intensities
 from matchms.similarity import ModifiedCosine
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def compute_expected_score(spectrum_1, spectrum_2, matches):
diff --git a/tests/test_neutral_losses_cosine.py b/tests/similarity/test_neutral_losses_cosine.py
similarity index 99%
rename from tests/test_neutral_losses_cosine.py
rename to tests/similarity/test_neutral_losses_cosine.py
index d1e865cd..61fb7dde 100644
--- a/tests/test_neutral_losses_cosine.py
+++ b/tests/similarity/test_neutral_losses_cosine.py
@@ -3,7 +3,7 @@ import pytest
 from matchms import Spectrum
 from matchms.filtering import normalize_intensities
 from matchms.similarity import NeutralLossesCosine
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 def compute_expected_score(spectrum_1, spectrum_2, matches):
diff --git a/tests/test_parentmass_match.py b/tests/similarity/test_parentmass_match.py
similarity index 97%
rename from tests/test_parentmass_match.py
rename to tests/similarity/test_parentmass_match.py
index 5abaa6fd..3ba8e7b7 100644
--- a/tests/test_parentmass_match.py
+++ b/tests/similarity/test_parentmass_match.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.similarity import ParentMassMatch
-from .builder_Spectrum import SpectrumBuilder, spectra_factory
+from ..builder_Spectrum import SpectrumBuilder, spectra_factory
 
 
 @pytest.mark.parametrize('parent_mass, tolerance, expected', [
diff --git a/tests/test_precursormz_match.py b/tests/similarity/test_precursormz_match.py
similarity index 97%
rename from tests/test_precursormz_match.py
rename to tests/similarity/test_precursormz_match.py
index 855f783b..84841dd8 100644
--- a/tests/test_precursormz_match.py
+++ b/tests/similarity/test_precursormz_match.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from matchms.similarity import PrecursorMzMatch
-from .builder_Spectrum import SpectrumBuilder, spectra_factory
+from ..builder_Spectrum import SpectrumBuilder, spectra_factory
 
 
 @pytest.mark.parametrize('precursor_mz, tolerance, tolerance_type, expected', [
diff --git a/tests/test_spectrum_similarity_functions.py b/tests/similarity/test_spectrum_similarity_functions.py
similarity index 99%
rename from tests/test_spectrum_similarity_functions.py
rename to tests/similarity/test_spectrum_similarity_functions.py
index d918578f..107cd706 100644
--- a/tests/test_spectrum_similarity_functions.py
+++ b/tests/similarity/test_spectrum_similarity_functions.py
@@ -6,7 +6,7 @@ from matchms.similarity.spectrum_similarity_functions import (
     collect_peak_pairs, find_matches, number_matching, number_matching_ppm,
     number_matching_symmetric, number_matching_symmetric_ppm,
     score_best_matches)
-from .builder_Spectrum import SpectrumBuilder
+from ..builder_Spectrum import SpectrumBuilder
 
 
 @pytest.fixture
diff --git a/tests/test_vector_similarity_functions.py b/tests/similarity/test_vector_similarity_functions.py
similarity index 100%
rename from tests/test_vector_similarity_functions.py
rename to tests/similarity/test_vector_similarity_functions.py
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index 2b1a9c9b..4d37e970 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -7,7 +7,7 @@ from matchms.similarity import ModifiedCosine
 
 
 module_root = os.path.join(os.path.dirname(__file__), "..")
-spectrums_file_msp = os.path.join(module_root, "tests", "massbank_five_spectra.msp")
+spectrums_file_msp = os.path.join(module_root, "tests", "testdata", "massbank_five_spectra.msp")
 
 
 def test_pipeline_initial_check_missing_file():
diff --git a/tests/test_pipeline.yaml b/tests/test_pipeline.yaml
index 5e6c59dd..e30aed21 100644
--- a/tests/test_pipeline.yaml
+++ b/tests/test_pipeline.yaml
@@ -2,7 +2,7 @@
 # Change and adapt fields where necessary 
 # ==================== 
 importing:
-  queries: ./tests/massbank_five_spectra.msp
+  queries: ./tests/testdata/massbank_five_spectra.msp
   references: 
 filtering_queries:
 - - default_filters
diff --git a/tests/test_scoring_method_consistency.py b/tests/test_scoring_method_consistency.py
index a3140477..0d64ff6b 100644
--- a/tests/test_scoring_method_consistency.py
+++ b/tests/test_scoring_method_consistency.py
@@ -16,7 +16,7 @@ from matchms.importing import load_from_json
 
 
 module_root = os.path.dirname(__file__)
-json_file = os.path.join(module_root, "gnps_spectra.json")
+json_file = os.path.join(module_root, "testdata", "gnps_spectra.json")
 # Get similarity measures available in matchms
 _score_functions = {
     "cosinegreedy": [mssimilarity.CosineGreedy, {}],