Skip to content

Commit fec7968

Browse files
committed
Merge branch 'test_audit' into 'master'
Improvement of CoreMS tests See merge request mass-spectrometry/corems!126
2 parents f21afc6 + 980f7dc commit fec7968

29 files changed

Lines changed: 893 additions & 2177 deletions

SettingsCoreMS.json

Lines changed: 0 additions & 446 deletions
This file was deleted.

SettingsCoreMS.toml

Lines changed: 0 additions & 172 deletions
This file was deleted.

conftest.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import pytest
2+
from pathlib import Path
3+
4+
from corems.transient.input.brukerSolarix import ReadBrukerSolarix
5+
from corems.encapsulation.factory.parameters import MSParameters
6+
7+
@pytest.fixture
8+
def mass_spectrum_ftms(bruker_transient):
9+
"""Creates a mass spectrum object to be used in the tests"""
10+
# Instantiate the mass spectrum object
11+
mass_spectrum = bruker_transient.get_mass_spectrum(
12+
plot_result=False, auto_process=False, keep_profile=True
13+
)
14+
mass_spectrum.parameters = MSParameters(use_defaults=True)
15+
# Process the mass spectrum
16+
mass_spectrum.process_mass_spec()
17+
18+
return mass_spectrum
19+
20+
@pytest.fixture
21+
def ref_file_location():
22+
"""Returns the location of the reference file for calibration for the tests"""
23+
return Path.cwd() / "tests/tests_data/ftms/SRFA.ref"
24+
25+
@pytest.fixture
26+
def ftms_file_location():
27+
"""Returns the location of the FTMS file for the tests"""
28+
return Path.cwd() / "tests/tests_data/ftms/ESI_NEG_SRFA.d/"
29+
30+
@pytest.fixture
31+
def bruker_transient(ftms_file_location):
32+
"""Returns the transient object for the FTMS file"""
33+
bruker_reader = ReadBrukerSolarix(ftms_file_location)
34+
bruker_transient = bruker_reader.get_transient()
35+
36+
return bruker_transient

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[pytest]
2+
# To run tests with coverage, uncomment the following line
23
addopts = -ra -v --cov=corems --cov-config=pytest.ini --cov-report html --cov-report term -p no:warnings
34
norecursedirs = win_only
45
testpaths = tests

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pylint
2-
pytest~=7.2.1
3-
pytest-cov
2+
pytest~=8.3.2
3+
pytest-cov~=5.0.0
44
pyprof2calltree
55
memory_profiler
66
twine

tests/win_only/test_ImportMassSpectraCompassXtract.py renamed to tests/archive_tests/test_ImportMassSpectraCompassXtract.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'''
12
import sys
23
34
sys.path.append(".")
@@ -46,3 +47,4 @@
4647
mass_spec = lcms.get_mass_spec_by_scan_number(1)
4748
mass_spec.plot_mz_domain_profile()
4849
mass_spec.plot_profile_and_noise_threshold()
50+
'''

tests/chemstation.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/test.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

tests/test_aaaaa_thermo.py-disable

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)