cpython: cbdd56d07123 (original) (raw)

Mercurial > cpython

changeset 95657:cbdd56d07123

issue9859: Document test.support.detect_api_mismatch() and simplify its test. [#9859]

Gregory P. Smith greg@krypto.org
date Tue, 14 Apr 2015 13:26:06 -0700
parents 9903368b9d7b
children 4286afa7b63e
files Doc/library/test.rst Lib/test/support/__init__.py Lib/test/test_support.py
diffstat 3 files changed, 29 insertions(+), 30 deletions(-)[+] [-] Doc/library/test.rst 9 Lib/test/support/__init__.py 2 Lib/test/test_support.py 48

line wrap: on

line diff

--- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -568,6 +568,15 @@ The :mod:test.support module defines t def load_tests(*args): return load_package_tests(os.path.dirname(file), *args) +.. function:: detect_api_mismatch(ref_api, other_api, *, ignore=()): +

The :mod:test.support module defines the following classes:

--- a/Lib/test/support/init.py +++ b/Lib/test/support/init.py @@ -2184,7 +2184,7 @@ def fs_is_case_insensitive(directory): return False -def detect_api_mismatch(ref_api, other_api, *, ignore=None): +def detect_api_mismatch(ref_api, other_api, *, ignore=()): """Returns the set of items in ref_api not in other_api, except for a defined list of items to be ignored in this check.

--- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -280,46 +280,36 @@ class TestSupport(unittest.TestCase): self.assertEqual(D["item"], 5) self.assertEqual(D["item"], 1)

def test_detect_api_mismatch__ignore(self):

-

- ignore = ['attribute1', 'attribute3', 'magic_2', 'not_in_either']

# XXX -follows a list of untested API