Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
run: uv pip install --editable ./

- name: Run tests with uv
run: uv run pytest
run: uv run pytest tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ empty_log_process_temp.py

tests/**/bids/
tests/test_main_functionality/data/projects/test-project/sub-100
tests/pytest-autobids_config.yaml
tests/data
# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
3 changes: 2 additions & 1 deletion lslautobids/datalad_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def create_and_add_files_to_datalad_dataset(dataset_path,logger):
#if flag==0:

try:
dl.Dataset(dataset_path)
dl.Dataset(dataset_path).status()
except:
message ="LSL Auto BIDS: new datalad dataset created"
# Create a new dataset
Expand All @@ -30,5 +30,6 @@ def create_and_add_files_to_datalad_dataset(dataset_path,logger):

# commit current files
logger.info('Committing current changes........')
os.chdir(dataset_path) # bug in datalad that requires to be in the same folder to save the datalad thingy
dl.save(path = dataset_path, message=message)

4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def setup_project(monkeypatch):

from lslautobids.gen_project_config import main as gen_project_config_main

# Create dummy user config for the test
config_file_test = ("tests/pytest-autobids_config.yaml")
# Create dummy user config for the test using absolute path
config_file_test = os.path.join(PROJECT_ROOT, "pytest-autobids_config.yaml")

#os.makedirs(os.path.dirname(config_file_test), exist_ok=True)
config_data = {
Expand Down
3 changes: 0 additions & 3 deletions tests/pytest-autobids_config.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion tests/test_main_functionality/test_main_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ def test_process_main_functionality(setup_project, monkeypatch):
fixture_path = os.path.join(paths["bids_root"],project_name,"sub-100","ses-001","eeg","sub-100_ses-001_task-freeviewing_run-2_eeg.set")
assert os.path.exists(fixture_path)

# cleanup
# cleanup
shutil.rmtree(os.path.join(paths["project_root"], project_name,"sub-100"))

# # does not work for some reason with git-annex, needs sudo
#shutil.rmtree(paths["bids_root"])


1 change: 1 addition & 0 deletions tests/test_old_suffix/test_old_suffix.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_process_new_files_with_old_suffix(setup_project, monkeypatch):
logger = get_logger(project_name)
logger.debug(f" Starting test_process_new_files_with_old_suffix in {project_name} ")


# Reset sys.argv to something that lslautobids.main.main() expects
sys.argv = [
"lslautobids.main",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_otherfiles-renaming/test_otherfiles-renaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_process_otherfiles_renaming(setup_project, monkeypatch):
import lslautobids.main
lslautobids.main.main()

# cleanup
shutil.rmtree(paths["bids_root"])
# cleanup # does not work for some reason with git-annex, needs sudo
#shutil.rmtree(paths["bids_root"])