Skip to content
Snippets Groups Projects
Commit 3b182c3b authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Started a startup-script for tests to find test data

parent 17948c61
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,8 @@ test:
imports:
- model_server
commands:
# - echo {{ PREFIX }}
# - set PYTHON_UNITTEST_DATA_ROOT = "{{ PREFIX }}"
- python -m unittest discover
requires:
- pip
......
......@@ -2,9 +2,11 @@ import os
from pathlib import Path
root = os.environ.get(
'PYTHON_UNITTEST_OUTPUT',
Path.home() / 'model_server' / 'testing'
'PYTHON_UNITTEST_DATA_ROOT',
# Path.home() / 'model_server' / 'testing'
)
if root == None:
raise Exception('data directory not specified')
filename = 'D3-selection-01.czi'
czifile = {
......
import os
from pathlib import Path
import sys
import unittest
pa = Path(__file__).parent
runner = unittest.TextTestRunner()
if __name__ == '__main__':
# takes path to test data as first argument
data_dir_arg = sys.argv[1]
data_dir = (Path(os.getcwd()) / sys.argv[1]).resolve()
assert data_dir.exists(), f'Could not find test data'
runner.run(unittest.TestLoader().discover(data_dir))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment