diff options
author | Xavier Verges <xavier.verges@es.ibm.com> | 2020-10-04 20:46:01 +0200 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-10-05 08:12:04 +0800 |
commit | 4ba76d683df326f2e6d4f519675baf86d0373abf (patch) | |
tree | bae28927f8589cd1cc4a5a122526896ecc6388ca /test | |
parent | 7cd47aeea822c484342e3f0632ae5cf8d332797d (diff) | |
download | gitpython-4ba76d683df326f2e6d4f519675baf86d0373abf.tar.gz |
Do not break convention when updating sys.path
Diffstat (limited to 'test')
-rw-r--r-- | test/test_installation.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_installation.py b/test/test_installation.py index db14bc84..3b39a328 100644 --- a/test/test_installation.py +++ b/test/test_installation.py @@ -1,6 +1,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php +import ast import os import subprocess from test.lib import TestBase @@ -27,3 +28,8 @@ class TestInstallation(TestBase): self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Can't build - setup.py failed") result = subprocess.run([self.python, '-c', 'import git'], stdout=subprocess.PIPE, cwd=self.sources) self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Selftest failed") + result = subprocess.run([self.python, '-c', 'import sys;import git; print(sys.path)'], stdout=subprocess.PIPE, cwd=self.sources) + syspath = result.stdout.decode('utf-8').splitlines()[0] + syspath = ast.literal_eval(syspath) + self.assertEqual('', syspath[0], msg='Failed to follow the conventions for https://docs.python.org/3/library/sys.html#sys.path') + self.assertTrue(syspath[1].endswith('gitdb'), msg='Failed to add gitdb to sys.path') |