summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiro Hrončok <miro@hroncok.cz>2022-11-14 12:30:12 +0100
committerMiro Hrončok <miro@hroncok.cz>2022-11-14 12:30:12 +0100
commit96e5108f5d7c68f46dcd23f8e03878b1e94c395f (patch)
tree4eaa0eada31353035cc1c4f2150f84fe8e01469c
parentea92abe896f3763205bd281a40824b89746bebb3 (diff)
downloadcffi-96e5108f5d7c68f46dcd23f8e03878b1e94c395f.tar.gz
Drop py.code usage from tests, no longer depend on the deprecated py package
-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..d39d88d 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'))