Skip to content

Commit

Permalink
WIP: parameterize data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Jul 17, 2023
1 parent ece6e43 commit f886fca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def pytest_addoption(parser):
--no-teardown (bool): Default False. Delete pipeline on close.
--no-server (bool): Default False. Run datajoint server in Docker.
--datadir (str): Default './tests/test_data/'. Dir for local input file.
WARNING: not yet implemented.
"""
parser.addoption(
"--quiet-spy",
Expand Down Expand Up @@ -118,14 +119,17 @@ def pytest_unconfigure(config):
def _set_env(base_dir):
"""Set environment variables."""

spyglass_base_dir = pathlib.Path(base_dir)
# TODO: change from tempdir to user supplied dir
# spyglass_base_dir = pathlib.Path(base_dir)
spyglass_base_dir = pathlib.Path(tempfile.mkdtemp())

spike_sorting_storage_dir = spyglass_base_dir / "spikesorting"
tmp_dir = spyglass_base_dir / "tmp"

logger.info("Setting datajoint and kachery environment variables.")
logger.info("SPYGLASS_BASE_DIR set to", spyglass_base_dir)

# TODO: make this a fixture
spy_config_dict = dict(
SPYGLASS_BASE_DIR=str(spyglass_base_dir),
SPYGLASS_RECORDING_DIR=str(spyglass_base_dir / "recording"),
Expand Down

0 comments on commit f886fca

Please sign in to comment.