From 82b9ad3236a4e43235ce2ae05202a0113890a434 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sun, 19 May 2019 16:54:13 +0200 Subject: [PATCH] Testing: Fix test_get_git_refs when run by Travis on tags --- spyder/utils/tests/test_vcs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spyder/utils/tests/test_vcs.py b/spyder/utils/tests/test_vcs.py index 2cabcb163ce..bd3f43f58a3 100644 --- a/spyder/utils/tests/test_vcs.py +++ b/spyder/utils/tests/test_vcs.py @@ -47,10 +47,14 @@ def test_git_revision(): def test_get_git_refs(): - braches_tags, branch, files_modified = get_git_refs(__file__) + branch_tags, branch, files_modified = get_git_refs(__file__) assert bool(branch) # This must always return a branch_name assert len(files_modified) >= 0 - assert any(['master' in b for b in braches_tags]) + + # It seems when Travis run tests on tags, master doesn't + # appear among the list of git branches. + if not os.environ.get('TRAVIS_TAG'): + assert any(['master' in b for b in branch_tags]) if __name__ == "__main__":