aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 41dcac1..d441cb9 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -11,13 +11,24 @@ import pytest
import jsonpickle
from qc_app import create_app
-from quality_control.parsing import strain_names
from quality_control.errors import InvalidValue, DuplicateHeading
@pytest.fixture(scope="session")
def strains():
"""Parse the strains once every test session"""
- return strain_names("etc/strains.csv")
+ stainnames = set()
+ with open("etc/strains.csv", encoding="utf8") as strains_file:
+ for idx, line in enumerate(strains_file.readlines()):
+ if idx > 0:
+ parts = line.split()
+ for name in (parts[1], parts[2]):
+ stainnames.add(name.strip())
+ if len(parts) >= 6:
+ alias = parts[5].strip()
+ if alias != "" and alias not in ("P", "\\N"):
+ stainnames.add(alias)
+
+ return tuple(stainnames)
def is_port_in_use(port: int) -> bool:
"Check whether `port` is in use"