Skip to content

Commit

Permalink
Merge pull request #27 from matt-sd-watson/opt_pytest
Browse files Browse the repository at this point in the history
Opt pytest
  • Loading branch information
matt-sd-watson authored May 27, 2022
2 parents 3cf10fb + cf63b1e commit 09877eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
1 change: 1 addition & 0 deletions environments/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies:
- r-heatmaply
- r-markdown
- r-essentials
- r-plotly
- r-traminer
- scipy=1.6.3
- snakemake
Expand Down
1 change: 1 addition & 0 deletions outbreaker/workflows/outbreaker_summary_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ library(tidyverse)
library(magrittr)
library(heatmaply)
library(stringr)
library(plotly)
```


Expand Down
29 changes: 7 additions & 22 deletions tests/test_outbreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@
import pytest


@pytest.fixture
@pytest.fixture(scope = "module")
def get_data_dir():
return str(os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'data/')))

@pytest.fixture
@pytest.fixture(scope = "module")
def get_alignment_reference(get_data_dir):
return str(os.path.join(get_data_dir, 'reference', 'ncov_reference.gb'))

@pytest.fixture
@pytest.fixture(scope = "module")
def get_focal_sequences(get_data_dir):
return str(os.path.join(get_data_dir, 'tests/', 'focal_seqs.fa'))

@pytest.fixture
@pytest.fixture(scope = "module")
def get_background_sequences(get_data_dir):
return str(os.path.join(get_data_dir, 'tests/', 'background_seqs.fa'))

@pytest.fixture
@pytest.fixture(scope = "module")
def get_names_csv(get_data_dir):
return str(os.path.join(get_data_dir, 'tests/', 'names.csv'))

@pytest.fixture
# need to keep fixtures that call built-in tmp_path within same scope as tmp_path (function
@pytest.fixture(scope = "function")
def get_renamed_fasta(tmp_path):
return str(os.path.join(tmp_path, 'pytest_renamed.fa'))

Expand Down Expand Up @@ -83,19 +84,3 @@ def test_run_with_console_output(self, tmp_path, get_focal_sequences, get_backgr
assert 'WARNING: the following record has no match in samples IDs and will be kept with the original name: Focal_4' \
in results.stdout.decode('utf-8')

















0 comments on commit 09877eb

Please sign in to comment.