1 From 9c7d865e17ec16a847090a3e0d1498b698b99756 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
3 Date: Mon, 14 Nov 2022 12:30:12 +0100
4 Subject: [PATCH] Drop py.code usage from tests, no longer depend on the
11 requirements.txt | 1 -
12 testing/cffi0/test_zintegration.py | 3 ++-
13 testing/cffi1/test_dlopen_unicode_literals.py | 4 ++--
14 4 files changed, 5 insertions(+), 5 deletions(-)
16 diff --git a/testing/cffi0/test_zintegration.py b/testing/cffi0/test_zintegration.py
17 index d6a02ce0..ca2d4642 100644
18 --- a/testing/cffi0/test_zintegration.py
19 +++ b/testing/cffi0/test_zintegration.py
21 import py, os, sys, shutil
24 from testing.udir import udir
27 @@ -66,7 +67,7 @@ def really_run_setup_and_program(dirname, venv_dir_and_paths, python_snippet):
28 remove(os.path.join(basedir, '__pycache__'))
30 python_f = udir.join('x.py')
31 - python_f.write(py.code.Source(python_snippet))
32 + python_f.write(textwrap.dedent(python_snippet))
34 os.chdir(str(SNIPPET_DIR.join(dirname)))
36 diff --git a/testing/cffi1/test_dlopen_unicode_literals.py b/testing/cffi1/test_dlopen_unicode_literals.py
37 index e792866e..dc955a57 100644
38 --- a/testing/cffi1/test_dlopen_unicode_literals.py
39 +++ b/testing/cffi1/test_dlopen_unicode_literals.py
44 s = """from __future__ import unicode_literals
46 @@ -6,4 +6,4 @@ s = """from __future__ import unicode_literals
47 with open(os.path.join(os.path.dirname(__file__), 'test_dlopen.py')) as f:
50 -exec(py.code.compile(s))
51 +exec(compile(s, filename='test_dlopen.py', mode='exec'))