Skip to content

Commit

Permalink
tests: use default branch for rev (iterative#10332)
Browse files Browse the repository at this point in the history
`isolate` fixture don't run in plugin's tests.
So the tests will fail to run if you have `init.defaultBranch`
something other than `master`.
  • Loading branch information
skshetry authored Mar 1, 2024
1 parent 5f7acd4 commit 257ea5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dvc/testing/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def test_open(self, tmp_dir, dvc, remote):
[
{},
{"url": "{path}"},
{"url": "{path}", "rev": "master"},
{"url": "{path}", "rev": "{default_branch}"},
{"url": "file://{posixpath}"},
{"url": "file://{posixpath}", "rev": "master"},
{"url": "file://{posixpath}", "rev": "{default_branch}"},
],
ids=["current", "local", "local_rev", "git", "git_rev"],
)
Expand All @@ -61,6 +61,8 @@ def test_filesystem(

if url := fs_kwargs.get("url"):
fs_kwargs["url"] = url.format(path=tmp_dir, posixpath=tmp_dir.as_posix())
if rev := fs_kwargs.get("rev"):
fs_kwargs["rev"] = rev.format(default_branch=scm.active_branch())

fs = DVCFileSystem(**fs_kwargs)

Expand Down

0 comments on commit 257ea5f

Please sign in to comment.