summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_distutils_adoption.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-08-08 12:15:13 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-08-08 12:15:13 -0400
commit6281bd0917882b930d5923d76cc72ff4ee5a7695 (patch)
treeac73e09e21cf751bf78d7103bb0f888f84cdacb2 /setuptools/tests/test_distutils_adoption.py
parent7c3a3817923de67956656ea058e80669b77bed1f (diff)
downloadpython-setuptools-git-6281bd0917882b930d5923d76cc72ff4ee5a7695.tar.gz
Support Python 3.5 and 3.6 in the tests.
Diffstat (limited to 'setuptools/tests/test_distutils_adoption.py')
-rw-r--r--setuptools/tests/test_distutils_adoption.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/setuptools/tests/test_distutils_adoption.py b/setuptools/tests/test_distutils_adoption.py
index f4c7072d..a945a69f 100644
--- a/setuptools/tests/test_distutils_adoption.py
+++ b/setuptools/tests/test_distutils_adoption.py
@@ -1,7 +1,18 @@
import os
+import sys
+import functools
+
import pytest
+def popen_text(call):
+ """
+ Augment the Popen call with the parameters to ensure unicode text.
+ """
+ return functools.partial(call, universal_newlines=True) \
+ if sys.version_info < (3, 7) else functools.partial(call, text=True)
+
+
@pytest.fixture
def env(virtualenv):
virtualenv.run(['pip', 'uninstall', '-y', 'setuptools'])
@@ -12,7 +23,7 @@ def env(virtualenv):
def find_distutils(env, imports='distutils'):
py_cmd = 'import {imports}; print(distutils.__file__)'.format(**locals())
cmd = ['python', '-c', py_cmd]
- return env.run(cmd, capture=True, text=True)
+ return popen_text(env.run)(cmd, capture=True)
def test_distutils_stdlib(env):