diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/cffi0/test_zintegration.py | 3 | ||||
-rw-r--r-- | testing/cffi1/test_dlopen_unicode_literals.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/testing/cffi0/test_zintegration.py b/testing/cffi0/test_zintegration.py index d6a02ce..ca2d464 100644 --- a/testing/cffi0/test_zintegration.py +++ b/testing/cffi0/test_zintegration.py @@ -1,5 +1,6 @@ import py, os, sys, shutil import subprocess +import textwrap from testing.udir import udir import pytest @@ -66,7 +67,7 @@ def really_run_setup_and_program(dirname, venv_dir_and_paths, python_snippet): remove(os.path.join(basedir, '__pycache__')) olddir = os.getcwd() python_f = udir.join('x.py') - python_f.write(py.code.Source(python_snippet)) + python_f.write(textwrap.dedent(python_snippet)) try: os.chdir(str(SNIPPET_DIR.join(dirname))) if os.name == 'nt': diff --git a/testing/cffi1/test_dlopen_unicode_literals.py b/testing/cffi1/test_dlopen_unicode_literals.py index e792866..dc955a5 100644 --- a/testing/cffi1/test_dlopen_unicode_literals.py +++ b/testing/cffi1/test_dlopen_unicode_literals.py @@ -1,4 +1,4 @@ -import py, os +import os s = """from __future__ import unicode_literals """ @@ -6,4 +6,4 @@ s = """from __future__ import unicode_literals with open(os.path.join(os.path.dirname(__file__), 'test_dlopen.py')) as f: s += f.read() -exec(py.code.compile(s)) +exec(compile(s, filename='test_dlopen.py', mode='exec')) |