diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2019-09-11 18:49:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-11 18:49:45 (GMT) |
commit | ee536b2020b1f0baad1286dbd4345e13870324af (patch) | |
tree | 2486233603db05a76aaef863bd6639455e3dfef7 /Lib/test/test_clinic.py | |
parent | 9936371af298d465095ae70bc9c2943b4b16eac4 (diff) | |
download | cpython-ee536b2020b1f0baad1286dbd4345e13870324af.zip cpython-ee536b2020b1f0baad1286dbd4345e13870324af.tar.gz cpython-ee536b2020b1f0baad1286dbd4345e13870324af.tar.bz2 |
bpo-36876: Add a tool that identifies unsupported global C variables. (#15877)
Diffstat (limited to 'Lib/test/test_clinic.py')
-rw-r--r-- | Lib/test/test_clinic.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index 244c5fe..3d5dc47 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -2,7 +2,7 @@ # Copyright 2012-2013 by Larry Hastings. # Licensed to the PSF under a contributor agreement. -from test import support +from test import support, test_tools from unittest import TestCase import collections import inspect @@ -10,17 +10,10 @@ import os.path import sys import unittest - -clinic_path = os.path.join(os.path.dirname(__file__), '..', '..', 'Tools', 'clinic') -clinic_path = os.path.normpath(clinic_path) -if not os.path.exists(clinic_path): - raise unittest.SkipTest(f'{clinic_path!r} path does not exist') -sys.path.append(clinic_path) -try: +test_tools.skip_if_missing('clinic') +with test_tools.imports_under_tool('clinic'): import clinic from clinic import DSLParser -finally: - del sys.path[-1] class FakeConverter: |