Skip to content

Commit b24a6fe

Browse files
committed
Had to update a couple tests with some minor code changes
1 parent 021abf8 commit b24a6fe

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ jobs:
1919

2020
- name: Run unit tests (pytest)
2121
run: |
22+
poetry install
2223
micromamba run -n test_neat pytest -q tests

tests/test_read_simulator/test_options.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def test_basic_options():
2121
def test_output_prefix_and_paths_single_end(tmp_path: _PathAlias):
2222
ref = _project_root() / "data" / "H1N1.fa"
2323
opts = Options(reference=ref, output_dir=tmp_path, output_prefix="neat_unit", overwrite_output=True)
24-
assert opts.output == tmp_path / "neat_unit"
24+
assert opts.output_dir == tmp_path
25+
assert opts.output_prefix == "neat_unit"
2526
opts.paired_ended = False
2627
opts.produce_fastq = True
2728
opts.produce_bam = False
@@ -99,7 +100,8 @@ def test_from_cli_single_end_with_threads_and_splits(tmp_path: _PathAlias):
99100
assert opts.rng_seed == 42
100101

101102
# Output construction via log_configuration() inside from_cli
102-
assert opts.output == outdir / "fromcli"
103+
assert opts.output_dir == outdir
104+
assert opts.output_prefix == "fromcli"
103105
assert opts.fq1 == outdir / "fromcli.fastq.gz"
104106
assert opts.fq2 is None
105107
assert opts.bam is None
@@ -172,7 +174,6 @@ def test_from_cli_reuse_splits_missing_dir_raises(tmp_path: _PathAlias):
172174
outdir = tmp_path / "out"
173175
outdir.mkdir(parents=True, exist_ok=True)
174176

175-
with _pytest.raises(SystemExit) as exc:
176-
_ = Options.from_cli(outdir, "reuse", yml_path)
177-
# Should exit with code 1 when reuse_splits is True but missing
178-
assert exc.value.code == 1
177+
options = Options.from_cli(outdir, "reuse", yml_path)
178+
# should issue a warning but continue in this case
179+
assert options.reuse_splits == True

0 commit comments

Comments
 (0)