From 56a9da3ab11ad9deaeae40ca357224abdb99809c Mon Sep 17 00:00:00 2001 From: ryanjameskennedy Date: Tue, 2 Jan 2024 23:07:41 +0100 Subject: [PATCH] Fix data_fpath error --- tests/fixtures/ecoli/__init__.py | 58 ++++++++++++------------ tests/fixtures/mtuberculosis/__init__.py | 24 +++++----- tests/fixtures/saureus/__init__.py | 44 +++++++++--------- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/tests/fixtures/ecoli/__init__.py b/tests/fixtures/ecoli/__init__.py index f1af44c..6679406 100644 --- a/tests/fixtures/ecoli/__init__.py +++ b/tests/fixtures/ecoli/__init__.py @@ -8,86 +8,86 @@ @pytest.fixture() -def ecoli_analysis_meta_path(data_fpath): +def ecoli_analysis_meta_path(data_path): """Get path for ecoli meta file""" - return str(data_fpath.joinpath("ecoli", "analysis_meta.json")) + return str(data_path.joinpath("ecoli", "analysis_meta.json")) @pytest.fixture() -def ecoli_bwa_path(data_fpath): +def ecoli_bwa_path(data_path): """Get path for ecoli bwa qc file""" - return str(data_fpath.joinpath("ecoli", "bwa.qc")) + return str(data_path.joinpath("ecoli", "bwa.qc")) @pytest.fixture() -def ecoli_quast_path(data_fpath): +def ecoli_quast_path(data_path): """Get path for ecoli quast file""" - return str(data_fpath.joinpath("ecoli", "quast.tsv")) + return str(data_path.joinpath("ecoli", "quast.tsv")) @pytest.fixture() -def ecoli_amrfinder_path(data_fpath): +def ecoli_amrfinder_path(data_path): """Get path for ecoli amrfinder file""" - return str(data_fpath.joinpath("ecoli", "amrfinder.out")) + return str(data_path.joinpath("ecoli", "amrfinder.out")) @pytest.fixture() -def ecoli_resfinder_path(data_fpath): +def ecoli_resfinder_path(data_path): """Get path for ecoli resfinder file""" - return str(data_fpath.joinpath("ecoli", "resfinder.json")) + return str(data_path.joinpath("ecoli", "resfinder.json")) @pytest.fixture() -def ecoli_resfinder_meta_path(data_fpath): +def ecoli_resfinder_meta_path(data_path): """Get path for ecoli resfinder meta file""" - return str(data_fpath.joinpath("ecoli", "resfinder_meta.json")) + return str(data_path.joinpath("ecoli", "resfinder_meta.json")) @pytest.fixture() -def ecoli_virulencefinder_wo_stx_path(data_fpath): +def ecoli_virulencefinder_wo_stx_path(data_path): """Get path for ecoli virulencefinder without stx file""" - return str(data_fpath.joinpath("ecoli", "virulencefinder.json")) + return str(data_path.joinpath("ecoli", "virulencefinder.json")) @pytest.fixture() -def ecoli_virulencefinder_stx_pred_stx_path(data_fpath): +def ecoli_virulencefinder_stx_pred_stx_path(data_path): """Get path for ecoli stx prediction file""" - return str(data_fpath.joinpath("ecoli", "virulencefinder.stx_pred.stx.json")) + return str(data_path.joinpath("ecoli", "virulencefinder.stx_pred.stx.json")) @pytest.fixture() -def ecoli_virulencefinder_stx_pred_no_stx_path(data_fpath): +def ecoli_virulencefinder_stx_pred_no_stx_path(data_path): """Get path for ecoli stx prediction no stx file""" - return str(data_fpath.joinpath("ecoli", "virulencefinder.stx_pred.no_stx.json")) + return str(data_path.joinpath("ecoli", "virulencefinder.stx_pred.no_stx.json")) @pytest.fixture() -def ecoli_virulencefinder_meta_path(data_fpath): +def ecoli_virulencefinder_meta_path(data_path): """Get path for ecoli virulencefinder meta file""" - return str(data_fpath.joinpath("ecoli", "virulencefinder_meta.json")) + return str(data_path.joinpath("ecoli", "virulencefinder_meta.json")) @pytest.fixture() -def ecoli_mlst_path(data_fpath): +def ecoli_mlst_path(data_path): """Get path for ecoli mlst file""" - return str(data_fpath.joinpath("ecoli", "mlst.json")) + return str(data_path.joinpath("ecoli", "mlst.json")) @pytest.fixture() -def ecoli_chewbbaca_path(data_fpath): +def ecoli_chewbbaca_path(data_path): """Get path for ecoli chewbbaca file""" - return str(data_fpath.joinpath("ecoli", "chewbbaca.out")) + return str(data_path.joinpath("ecoli", "chewbbaca.out")) @pytest.fixture() -def ecoli_bracken_path(data_fpath): +def ecoli_bracken_path(data_path): """Get path for ecoli bracken file""" - return str(data_fpath.joinpath("ecoli", "bracken.out")) + return str(data_path.joinpath("ecoli", "bracken.out")) @pytest.fixture() -def ecoli_cdm_input(data_fpath): +def ecoli_cdm_input(data_path): """Get path for ecoli cdm file""" - path = data_fpath.joinpath("ecoli", "cdm_input.json") - with open(path) as inpt: + path = data_path.joinpath("ecoli", "cdm_input.json") + with open(path, "rb") as inpt: return json.load(inpt) diff --git a/tests/fixtures/mtuberculosis/__init__.py b/tests/fixtures/mtuberculosis/__init__.py index 1b077f9..5bedbf2 100644 --- a/tests/fixtures/mtuberculosis/__init__.py +++ b/tests/fixtures/mtuberculosis/__init__.py @@ -6,36 +6,36 @@ @pytest.fixture() -def mtuberculosis_analysis_meta_path(data_fpath): +def mtuberculosis_analysis_meta_path(data_path): """Get path for mtuberculosis meta file""" - return str(data_fpath.joinpath("mtuberculosis", "analysis_meta.json")) + return str(data_path.joinpath("mtuberculosis", "analysis_meta.json")) @pytest.fixture() -def mtuberculosis_bracken_path(data_fpath): +def mtuberculosis_bracken_path(data_path): """Get path for mtuberculosis bracken file""" - return str(data_fpath.joinpath("mtuberculosis", "bracken.out")) + return str(data_path.joinpath("mtuberculosis", "bracken.out")) @pytest.fixture() -def mtuberculosis_bwa_path(data_fpath): +def mtuberculosis_bwa_path(data_path): """Get path for mtuberculosis bwa qc file""" - return str(data_fpath.joinpath("mtuberculosis", "bwa.qc")) + return str(data_path.joinpath("mtuberculosis", "bwa.qc")) @pytest.fixture() -def mtuberculosis_mykrobe_path(data_fpath): +def mtuberculosis_mykrobe_path(data_path): """Get path for mtuberculosis mykrobe file""" - return str(data_fpath.joinpath("mtuberculosis", "mykrobe.csv")) + return str(data_path.joinpath("mtuberculosis", "mykrobe.csv")) @pytest.fixture() -def mtuberculosis_quast_path(data_fpath): +def mtuberculosis_quast_path(data_path): """Get path for mtuberculosis quast file""" - return str(data_fpath.joinpath("mtuberculosis", "quast.tsv")) + return str(data_path.joinpath("mtuberculosis", "quast.tsv")) @pytest.fixture() -def mtuberculosis_tbprofiler_path(data_fpath): +def mtuberculosis_tbprofiler_path(data_path): """Get path for mtuberculosis tbprofiler file""" - return str(data_fpath.joinpath("mtuberculosis", "tbprofiler.json")) + return str(data_path.joinpath("mtuberculosis", "tbprofiler.json")) diff --git a/tests/fixtures/saureus/__init__.py b/tests/fixtures/saureus/__init__.py index c28d9d9..6ce22e9 100644 --- a/tests/fixtures/saureus/__init__.py +++ b/tests/fixtures/saureus/__init__.py @@ -6,66 +6,66 @@ @pytest.fixture() -def saureus_analysis_meta_path(data_fpath): +def saureus_analysis_meta_path(data_path): """Get path for saureus meta file""" - return str(data_fpath.joinpath("saureus", "analysis_meta.json")) + return str(data_path.joinpath("saureus", "analysis_meta.json")) @pytest.fixture() -def saureus_bwa_path(data_fpath): +def saureus_bwa_path(data_path): """Get path for saureus bwa qc file""" - return str(data_fpath.joinpath("saureus", "bwa.qc")) + return str(data_path.joinpath("saureus", "bwa.qc")) @pytest.fixture() -def saureus_quast_path(data_fpath): +def saureus_quast_path(data_path): """Get path for saureus quast file""" - return str(data_fpath.joinpath("saureus", "quast.tsv")) + return str(data_path.joinpath("saureus", "quast.tsv")) @pytest.fixture() -def saureus_amrfinder_path(data_fpath): +def saureus_amrfinder_path(data_path): """Get path for saureus amrfinder file""" - return str(data_fpath.joinpath("saureus", "amrfinder.out")) + return str(data_path.joinpath("saureus", "amrfinder.out")) @pytest.fixture() -def saureus_resfinder_path(data_fpath): +def saureus_resfinder_path(data_path): """Get path for saureus resfinder file""" - return str(data_fpath.joinpath("saureus", "resfinder.json")) + return str(data_path.joinpath("saureus", "resfinder.json")) @pytest.fixture() -def saureus_resfinder_meta_path(data_fpath): +def saureus_resfinder_meta_path(data_path): """Get path for saureus resfinder meta file""" - return str(data_fpath.joinpath("saureus", "resfinder_meta.json")) + return str(data_path.joinpath("saureus", "resfinder_meta.json")) @pytest.fixture() -def saureus_virulencefinder_path(data_fpath): +def saureus_virulencefinder_path(data_path): """Get path for saureus virulencefinder file""" - return str(data_fpath.joinpath("saureus", "virulencefinder.json")) + return str(data_path.joinpath("saureus", "virulencefinder.json")) @pytest.fixture() -def saureus_virulencefinder_meta_path(data_fpath): +def saureus_virulencefinder_meta_path(data_path): """Get path for saureus virulencefinder meta file""" - return str(data_fpath.joinpath("saureus", "virulencefinder_meta.json")) + return str(data_path.joinpath("saureus", "virulencefinder_meta.json")) @pytest.fixture() -def saureus_mlst_path(data_fpath): +def saureus_mlst_path(data_path): """Get path for saureus mlst file""" - return str(data_fpath.joinpath("saureus", "mlst.json")) + return str(data_path.joinpath("saureus", "mlst.json")) @pytest.fixture() -def saureus_chewbbaca_path(data_fpath): +def saureus_chewbbaca_path(data_path): """Get path for saureus chewbbaca file""" - return str(data_fpath.joinpath("saureus", "chewbbaca.out")) + return str(data_path.joinpath("saureus", "chewbbaca.out")) @pytest.fixture() -def saureus_bracken_path(data_fpath): +def saureus_bracken_path(data_path): """Get path for saureus bracken file""" - return str(data_fpath.joinpath("saureus", "bracken.out")) + return str(data_path.joinpath("saureus", "bracken.out"))