summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <armin.rigo@gmail.com>2022-11-15 10:42:25 +0000
committerArmin Rigo <armin.rigo@gmail.com>2022-11-15 10:42:25 +0000
commit5701750b89042b73af15630f4561f0d81f206ce2 (patch)
tree8372ab5cfa8a05f19f6975dd3e53a911e4771926
parentea92abe896f3763205bd281a40824b89746bebb3 (diff)
parent1969cb85c45342b0ffa75bd9ab0ca2100b67b2ea (diff)
downloadcffi-5701750b89042b73af15630f4561f0d81f206ce2.tar.gz
Merge branch 'branch/py.code' into 'branch/default'
Drop py.code usage from tests, no longer depend on the deprecated py package See merge request pypy/cffi!116
-rw-r--r--README.md2
-rw-r--r--requirements.txt1
-rw-r--r--testing/cffi0/test_zintegration.py3
-rw-r--r--testing/cffi1/test_dlopen_unicode_literals.py4
4 files changed, 5 insertions, 5 deletions
diff --git a/README.md b/README.md
index b4b8488..21c82b8 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ Testing/development tips
To run tests under CPython, run::
- pip install pytest py # if you don't have pytest and py already
+ pip install pytest # if you don't have pytest already
pip install pycparser
python setup.py build_ext -f -i
pytest c/ testing/
diff --git a/requirements.txt b/requirements.txt
index 881a093..a97f028 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,2 @@
pycparser
pytest
-py
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'))