diff options
author | Min ho Kim <minho42@gmail.com> | 2019-07-21 20:12:33 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2019-07-21 20:12:33 (GMT) |
commit | 96e12d5f4f3c5a20986566038ee763dff3c228a1 (patch) | |
tree | ae4039f978a155a295903e084f4531d42b8cf7a8 /Lib/test | |
parent | 8e3a7380ecb310b50e48f47d1f26190cc9c45eb6 (diff) | |
download | cpython-96e12d5f4f3c5a20986566038ee763dff3c228a1.zip cpython-96e12d5f4f3c5a20986566038ee763dff3c228a1.tar.gz cpython-96e12d5f4f3c5a20986566038ee763dff3c228a1.tar.bz2 |
Fix typos in docs, comments and test assert messages (#14872)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/support/__init__.py | 2 | ||||
-rwxr-xr-x | Lib/test/test_dataclasses.py | 6 | ||||
-rw-r--r-- | Lib/test/test_eintr.py | 2 | ||||
-rw-r--r-- | Lib/test/test_fstring.py | 2 | ||||
-rw-r--r-- | Lib/test/test_importlib/test_main.py | 2 | ||||
-rw-r--r-- | Lib/test/test_math.py | 4 | ||||
-rw-r--r-- | Lib/test/test_random.py | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 4bf42e0..9efb3d9 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2978,7 +2978,7 @@ def fd_count(): if sys.platform.startswith(('linux', 'freebsd')): try: names = os.listdir("/proc/self/fd") - # Substract one because listdir() opens internally a file + # Subtract one because listdir() internally opens a file # descriptor to list the content of the /proc/self/fd/ directory. return len(names) - 1 except FileNotFoundError: diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py index 53e8443..ea42904 100755 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses.py @@ -3043,11 +3043,11 @@ class TestMakeDataclass(unittest.TestCase): def test_non_identifier_field_names(self): for field in ['()', 'x,y', '*', '2@3', '', 'little johnny tables']: with self.subTest(field=field): - with self.assertRaisesRegex(TypeError, 'must be valid identifers'): + with self.assertRaisesRegex(TypeError, 'must be valid identifiers'): make_dataclass('C', ['a', field]) - with self.assertRaisesRegex(TypeError, 'must be valid identifers'): + with self.assertRaisesRegex(TypeError, 'must be valid identifiers'): make_dataclass('C', [field]) - with self.assertRaisesRegex(TypeError, 'must be valid identifers'): + with self.assertRaisesRegex(TypeError, 'must be valid identifiers'): make_dataclass('C', [field, 'a']) def test_underscore_field_names(self): diff --git a/Lib/test/test_eintr.py b/Lib/test/test_eintr.py index f61efa3..a5f8f64 100644 --- a/Lib/test/test_eintr.py +++ b/Lib/test/test_eintr.py @@ -22,7 +22,7 @@ class EINTRTests(unittest.TestCase): print() print("--- run eintr_tester.py ---", flush=True) # In verbose mode, the child process inherit stdout and stdout, - # to see output in realtime and reduce the risk of loosing output. + # to see output in realtime and reduce the risk of losing output. args = [sys.executable, "-E", "-X", "faulthandler", *args] proc = subprocess.run(args) print(f"--- eintr_tester.py completed: " diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index c9e6e7d..fb76144 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -1161,7 +1161,7 @@ non-important content # These next lines contains tabs. Backslash escapes don't # work in f-strings. - # patchcheck doens't like these tabs. So the only way to test + # patchcheck doesn't like these tabs. So the only way to test # this will be to dynamically created and exec the f-strings. But # that's such a hassle I'll save it for another day. For now, convert # the tabs to spaces just to shut up patchcheck. diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py index 844ed26..5e2cb26 100644 --- a/Lib/test/test_importlib/test_main.py +++ b/Lib/test/test_importlib/test_main.py @@ -32,7 +32,7 @@ class BasicTests(fixtures.DistInfoPkg, unittest.TestCase): class ImportTests(fixtures.DistInfoPkg, unittest.TestCase): def test_import_nonexistent_module(self): # Ensure that the MetadataPathFinder does not crash an import of a - # non-existant module. + # nonexistent module. with self.assertRaises(ImportError): importlib.import_module('does_not_exist') diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index 393cdaf..567a5c6 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -1875,7 +1875,7 @@ class IsCloseTests(unittest.TestCase): def testPerm(self): perm = math.perm factorial = math.factorial - # Test if factorial defintion is satisfied + # Test if factorial definition is satisfied for n in range(100): for k in range(n + 1): self.assertEqual(perm(n, k), @@ -1939,7 +1939,7 @@ class IsCloseTests(unittest.TestCase): def testComb(self): comb = math.comb factorial = math.factorial - # Test if factorial defintion is satisfied + # Test if factorial definition is satisfied for n in range(100): for k in range(n + 1): self.assertEqual(comb(n, k), factorial(n) diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index ff1ddca..899ca10 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -228,7 +228,7 @@ class TestBasicOps: choices([], cum_weights=[], k=5) def test_choices_subnormal(self): - # Subnormal weights would occassionally trigger an IndexError + # Subnormal weights would occasionally trigger an IndexError # in choices() when the value returned by random() was large # enough to make `random() * total` round up to the total. # See https://bugs.python.org/msg275594 for more detail. |