From 257ea5f4cbb18a98eac065a376ced21534fa78b0 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:16:59 +0545 Subject: [PATCH] tests: use default branch for rev (#10332) `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`. --- dvc/testing/api_tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dvc/testing/api_tests.py b/dvc/testing/api_tests.py index 311e6c041..e78147004 100644 --- a/dvc/testing/api_tests.py +++ b/dvc/testing/api_tests.py @@ -33,9 +33,9 @@ class TestAPI: [ {}, {"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"], ) @@ -61,6 +61,8 @@ class TestAPI: 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)