Skip to content

Commit 38e0f99

Browse files
committed
fix(test_docs): deterministic remote test
The remote test relied on a full repo clone that included all branches, which isn't guaranteed, especially in CI environments and when using repo forks. Use the cloned repo instead, since it will still test the desired functionality but will always have the necessary upstream branch.
1 parent d5d86e7 commit 38e0f99

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

test/test_docs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ def test_init_repo_object(self, rw_dir):
8383
self.assertEqual(repo.tags["0.3.5"], repo.tag("refs/tags/0.3.5")) # You can access tags in various ways too.
8484
self.assertEqual(repo.refs.master, repo.heads["master"]) # .refs provides all refs, i.e. heads...
8585

86-
if "TRAVIS" not in os.environ:
87-
self.assertEqual(repo.refs["origin/master"], repo.remotes.origin.refs.master) # ... remotes ...
86+
self.assertEqual(cloned_repo.refs["origin/master"], cloned_repo.remotes.origin.refs.master) # ... remotes ...
8887
self.assertEqual(repo.refs["0.3.5"], repo.tags["0.3.5"]) # ... and tags.
8988
# ![8-test_init_repo_object]
9089

0 commit comments

Comments
 (0)