FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.12] gh-127906: Skip limited C API test_cext tests if Py_TRACE_REFS by vstinner · Pull Request #127993 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions Lib/test/test_cext/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import shlex
import shutil
import subprocess
import sys
import unittest
from test import support


SOURCE = os.path.join(os.path.dirname(__file__), 'extension.c')
SETUP = os.path.join(os.path.dirname(__file__), 'setup.py')
Py_TRACE_REFS = hasattr(sys, 'getobjects')


# With MSVC on a debug build, the linker fails with: cannot open file
Expand Down Expand Up @@ -47,6 +49,9 @@ def test_build_limited_c11(self):
self.check_build('_test_limited_c11_cext', limited=True, std='c11')

def check_build(self, extension_name, std=None, limited=False):
if limited and Py_TRACE_REFS:
self.skipTest('Py_LIMITED_API is incompatible with Py_TRACE_REFS')

venv_dir = 'env'
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
self._check_build(extension_name, python_exe,
Expand Down
5 changes: 5 additions & 0 deletions Lib/test/test_cppext/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import shlex
import shutil
import subprocess
import sys
import unittest
from test import support


SOURCE = os.path.join(os.path.dirname(__file__), 'extension.cpp')
SETUP = os.path.join(os.path.dirname(__file__), 'setup.py')
Py_TRACE_REFS = hasattr(sys, 'getobjects')


# With MSVC on a debug build, the linker fails with: cannot open file
Expand Down Expand Up @@ -45,6 +47,9 @@ def test_build_limited(self):
self.check_build('_testcppext_limited', limited=True)

def check_build(self, extension_name, std=None, limited=False):
if limited and Py_TRACE_REFS:
self.skipTest('Py_LIMITED_API is incompatible with Py_TRACE_REFS')

venv_dir = 'env'
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
self._check_build(extension_name, python_exe,
Expand Down

Back | FazBrowse Home | New Git URL