Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip tests when ran as root #593

Merged
merged 1 commit into from
Jan 12, 2024
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: 2 additions & 0 deletions datalad_next/annexremotes/tests/test_uncurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from datalad_next.tests.utils import (
create_tree,
skip_if_on_windows,
skip_if_root,
)
from datalad_next.constraints.dataset import EnsureDataset
from datalad_next.exceptions import (
Expand Down Expand Up @@ -309,6 +310,7 @@ def test_uncurl_ria_access(tmp_path, no_result_rendering):
assert (ds.pathobj / target_fname).read_text() == testfile_content


@skip_if_root # see https://github.com/datalad/datalad-next/issues/525
def test_uncurl_store(tmp_path, existing_dataset, no_result_rendering):
ds = existing_dataset
testfile = ds.pathobj / 'testfile1.txt'
Expand Down
3 changes: 3 additions & 0 deletions datalad_next/commands/tests/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
get_deeply_nested_structure,
skip_wo_symlink_capability,
skip_if_on_windows,
skip_if_root,
ok_good_symlink,
ok_broken_symlink,
run_main,
Expand Down Expand Up @@ -732,6 +733,7 @@ def test_print_tree_fails_for_nonexistent_directory(self, tmp_path):
with assert_raises(ValueError):
Tree(tmp_path / 'nonexistent_dir', max_depth=1)

@skip_if_root # see https://github.com/datalad/datalad-next/issues/525
@skip_if_on_windows
@skip_wo_symlink_capability
def test_print_tree_permission_denied(self, tmp_path):
Expand Down Expand Up @@ -823,6 +825,7 @@ def test_tree_with_broken_symlinks(self, tmp_path, include_files):
]
assert set(expected) == set(actual)

@skip_if_root # see https://github.com/datalad/datalad-next/issues/525
@skip_if_on_windows
@skip_wo_symlink_capability
@pytest.mark.parametrize("include_files", (True, False))
Expand Down
3 changes: 3 additions & 0 deletions datalad_next/gitremotes/tests/test_datalad_annex.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
assert_status,
eq_,
rmtree,
skip_if_root,
)
from datalad_next.consts import on_windows
from datalad_next.exceptions import CommandError
Expand All @@ -52,6 +53,7 @@ def eq_dla_branch_state(state, path, branch=DEFAULT_BRANCH):
assert None, f'Could not find state for branch {branch} at {path}'


@skip_if_root # see https://github.com/datalad/datalad-next/issues/525
def test_annex_remote(existing_noannex_dataset, tmp_path, no_result_rendering):
remotepath = tmp_path / 'remote'
# bypass the complications of folding a windows path into a file URL
Expand All @@ -63,6 +65,7 @@ def test_annex_remote(existing_noannex_dataset, tmp_path, no_result_rendering):
_check_push_fetch_cycle(ds, dlaurl, remotepath, tmp_path)


@skip_if_root # see https://github.com/datalad/datalad-next/issues/525
def test_export_remote(existing_noannex_dataset, tmp_path, no_result_rendering):
remotepath = tmp_path / 'remote'
# bypass the complications of folding a windows path into a file URL
Expand Down
1 change: 1 addition & 0 deletions datalad_next/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
ok_good_symlink,
rmtree,
skip_if_on_windows,
skip_if_root,
skip_wo_symlink_capability,
swallow_logs,
)
Expand Down