From 1d6d9a796f8228bd7e6ea7d03b7ec1e1f0903093 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 21 Jan 2019 15:53:55 +0100 Subject: [PATCH 1/4] Skip failing test if platform.dist() is Xenial Fixes #827 --- git/test/test_remote.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 7c1711c27..110c32a9d 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -4,6 +4,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php +import platform import random import tempfile from unittest import skipIf @@ -34,6 +35,7 @@ from git.util import IterableList, rmtree, HIDE_WINDOWS_FREEZE_ERRORS import os.path as osp +IS_DIST_XENIAL = 'stretch' in platform.dist()[1] # assure we have repeatable results random.seed(0) @@ -398,6 +400,7 @@ def _assert_push_and_pull(self, remote, rw_repo, remote_repo): remote.push(":%s" % other_tag.path) @skipIf(HIDE_WINDOWS_FREEZE_ERRORS, "FIXME: Freezes!") + @skipIf(IS_DIST_XENIAL, "Test fails when dist is Xenial. #827") @with_rw_and_rw_remote_repo('0.1.6') def test_base(self, rw_repo, remote_repo): num_remotes = 0 From c79762bce4de753682676067197256d6ed58490d Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 21 Jan 2019 17:15:20 +0100 Subject: [PATCH 2/4] Use platform.uname().version because platform.dest() is deprecated --- git/test/test_remote.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 110c32a9d..a0677b54c 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -35,7 +35,8 @@ from git.util import IterableList, rmtree, HIDE_WINDOWS_FREEZE_ERRORS import os.path as osp -IS_DIST_XENIAL = 'stretch' in platform.dist()[1] +uname_version = platform.uname().version +IS_DIST_XENIAL = '-Ubuntu' in uname_version and '16.04' in uname_version # assure we have repeatable results random.seed(0) From a6938fe385e5e42c46b425edef63400c767ddd9d Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 21 Jan 2019 17:32:54 +0100 Subject: [PATCH 3/4] uname_version = platform.uname()[3] for Python 2 --- git/test/test_remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/test/test_remote.py b/git/test/test_remote.py index a0677b54c..9a62e640a 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -35,7 +35,7 @@ from git.util import IterableList, rmtree, HIDE_WINDOWS_FREEZE_ERRORS import os.path as osp -uname_version = platform.uname().version +uname_version = platform.uname()[3] # platform.uname().version on Py3 IS_DIST_XENIAL = '-Ubuntu' in uname_version and '16.04' in uname_version # assure we have repeatable results From 75a5f0eb8dbd0ee7a498e8876a094ae7145ccc52 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 21 Jan 2019 19:45:47 +0100 Subject: [PATCH 4/4] platform_version = platform.version() --- git/test/test_remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 9a62e640a..b7a57d0be 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -35,8 +35,8 @@ from git.util import IterableList, rmtree, HIDE_WINDOWS_FREEZE_ERRORS import os.path as osp -uname_version = platform.uname()[3] # platform.uname().version on Py3 -IS_DIST_XENIAL = '-Ubuntu' in uname_version and '16.04' in uname_version +platform_version = platform.version() +IS_DIST_XENIAL = '-Ubuntu' in platform_version and '16.04' in platform_version # assure we have repeatable results random.seed(0)