mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Issue 12132 - skip the test_buil_ext test if the xx module is not found
This commit is contained in:
parent
2bc55e482e
commit
3517369894
3 changed files with 12 additions and 2 deletions
|
@ -32,7 +32,8 @@ class BuildExtTestCase(support.TempdirManager,
|
|||
self.sys_path = sys.path, sys.path[:]
|
||||
sys.path.append(self.tmp_dir)
|
||||
filename = _get_source_filename()
|
||||
shutil.copy(filename, self.tmp_dir)
|
||||
if os.path.exists(filename):
|
||||
shutil.copy(filename, self.tmp_dir)
|
||||
self.old_user_base = site.USER_BASE
|
||||
site.USER_BASE = self.mkdtemp()
|
||||
build_ext.USER_BASE = site.USER_BASE
|
||||
|
@ -59,6 +60,9 @@ class BuildExtTestCase(support.TempdirManager,
|
|||
def test_build_ext(self):
|
||||
global ALREADY_TESTED
|
||||
xx_c = os.path.join(self.tmp_dir, 'xxmodule.c')
|
||||
if not os.path.exists(xx_c):
|
||||
# skipping if we cannot find it
|
||||
return
|
||||
xx_ext = Extension('xx', [xx_c])
|
||||
dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]})
|
||||
dist.package_dir = self.tmp_dir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue