From da6ae1da8b057220d6b14d684e35a7b08068c935 Mon Sep 17 00:00:00 2001 From: Daniel Kutik Date: Tue, 15 Aug 2023 18:00:10 +0200 Subject: [PATCH] tests: test_git_superproject.py: fix py3.6 & 3.7 tests/test_git_superproject.py::SuperprojectTestCase::test_Fetch was failing in Python 3.6 and 3.7 due to attribute args only being introduced in Python 3.8. Falling back on old way of accessing the arguments. Test: tox with Python 3.6 to 3.11 Change-Id: Iae1934a7bce8cbd6b4519e4dbc92d94e21b43435 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382818 Tested-by: Daniel Kutik Reviewed-by: Mike Frysinger Commit-Queue: Daniel Kutik --- tests/test_git_superproject.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py index f884f507..dc46ec65 100644 --- a/tests/test_git_superproject.py +++ b/tests/test_git_superproject.py @@ -490,7 +490,9 @@ class SuperprojectTestCase(unittest.TestCase): self.assertTrue(self._superproject._Fetch()) self.assertEqual( - mock_git_command.call_args.args, + # TODO: Once we require Python 3.8+, + # use 'mock_git_command.call_args.args'. + mock_git_command.call_args[0], ( None, [ @@ -510,7 +512,9 @@ class SuperprojectTestCase(unittest.TestCase): # If branch for revision exists, set as --negotiation-tip. self.assertTrue(self._superproject._Fetch()) self.assertEqual( - mock_git_command.call_args.args, + # TODO: Once we require Python 3.8+, + # use 'mock_git_command.call_args.args'. + mock_git_command.call_args[0], ( None, [