summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorXie Yanbo <xieyanbo@gmail.com>2024-08-12 04:16:41 (GMT)
committerGitHub <noreply@github.com>2024-08-12 04:16:41 (GMT)
commit253c6a0b2f88b3327b7113860b99d665346fe43c (patch)
treeb7607792341c71e620151c1c9e4ad8ec6a7dbda5 /Lib/test
parent9375b9ca3a4998678ba74ff5c77ed540a4dcf887 (diff)
downloadcpython-253c6a0b2f88b3327b7113860b99d665346fe43c.zip
cpython-253c6a0b2f88b3327b7113860b99d665346fe43c.tar.gz
cpython-253c6a0b2f88b3327b7113860b99d665346fe43c.tar.bz2
Fix typos in comments and test code (#122846)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/libregrtest/main.py2
-rw-r--r--Lib/test/libregrtest/single.py2
-rw-r--r--Lib/test/support/asynchat.py2
-rw-r--r--Lib/test/support/asyncore.py2
-rw-r--r--Lib/test/support/bytecode_helper.py2
-rw-r--r--Lib/test/test_ast/test_ast.py6
-rw-r--r--Lib/test/test_asyncio/test_locks.py6
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py2
-rw-r--r--Lib/test/test_capi/test_opt.py2
-rw-r--r--Lib/test/test_concurrent_futures/test_deadlock.py2
-rw-r--r--Lib/test/test_email/test__header_value_parser.py2
-rw-r--r--Lib/test/test_import/__init__.py6
12 files changed, 18 insertions, 18 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
index 5148d30..f2292c9 100644
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -536,7 +536,7 @@ class Regrtest:
self._run_tests_mp(runtests, self.num_workers)
else:
# gh-117783: don't immortalize deferred objects when tracking
- # refleaks. Only releveant for the free-threaded build.
+ # refleaks. Only relevant for the free-threaded build.
with suppress_immortalization(runtests.hunt_refleak):
self.run_tests_sequentially(runtests)
diff --git a/Lib/test/libregrtest/single.py b/Lib/test/libregrtest/single.py
index adc8f1f..67cc9db 100644
--- a/Lib/test/libregrtest/single.py
+++ b/Lib/test/libregrtest/single.py
@@ -305,7 +305,7 @@ def run_single_test(test_name: TestName, runtests: RunTests) -> TestResult:
pgo = runtests.pgo
try:
# gh-117783: don't immortalize deferred objects when tracking
- # refleaks. Only releveant for the free-threaded build.
+ # refleaks. Only relevant for the free-threaded build.
with support.suppress_immortalization(runtests.hunt_refleak):
_runtest(result, runtests)
except:
diff --git a/Lib/test/support/asynchat.py b/Lib/test/support/asynchat.py
index 38c47a1..a8c6b28 100644
--- a/Lib/test/support/asynchat.py
+++ b/Lib/test/support/asynchat.py
@@ -1,5 +1,5 @@
# TODO: This module was deprecated and removed from CPython 3.12
-# Now it is a test-only helper. Any attempts to rewrite exising tests that
+# Now it is a test-only helper. Any attempts to rewrite existing tests that
# are using this module and remove it completely are appreciated!
# See: https://github.com/python/cpython/issues/72719
diff --git a/Lib/test/support/asyncore.py b/Lib/test/support/asyncore.py
index b397aca..870e428 100644
--- a/Lib/test/support/asyncore.py
+++ b/Lib/test/support/asyncore.py
@@ -1,5 +1,5 @@
# TODO: This module was deprecated and removed from CPython 3.12
-# Now it is a test-only helper. Any attempts to rewrite exising tests that
+# Now it is a test-only helper. Any attempts to rewrite existing tests that
# are using this module and remove it completely are appreciated!
# See: https://github.com/python/cpython/issues/72719
diff --git a/Lib/test/support/bytecode_helper.py b/Lib/test/support/bytecode_helper.py
index 85bcd1f..f6426c3 100644
--- a/Lib/test/support/bytecode_helper.py
+++ b/Lib/test/support/bytecode_helper.py
@@ -71,7 +71,7 @@ class CompilationStepTestCase(unittest.TestCase):
def assertInstructionsMatch(self, actual_seq, expected):
# get an InstructionSequence and an expected list, where each
- # entry is a label or an instruction tuple. Construct an expcted
+ # entry is a label or an instruction tuple. Construct an expected
# instruction sequence and compare with the one given.
self.assertIsInstance(expected, list)
diff --git a/Lib/test/test_ast/test_ast.py b/Lib/test/test_ast/test_ast.py
index 0a3edef..e83cdbc 100644
--- a/Lib/test/test_ast/test_ast.py
+++ b/Lib/test/test_ast/test_ast.py
@@ -2701,13 +2701,13 @@ class EndPositionTests(unittest.TestCase):
class NodeTransformerTests(ASTTestMixin, unittest.TestCase):
- def assertASTTransformation(self, tranformer_class,
+ def assertASTTransformation(self, transformer_class,
initial_code, expected_code):
initial_ast = ast.parse(dedent(initial_code))
expected_ast = ast.parse(dedent(expected_code))
- tranformer = tranformer_class()
- result_ast = ast.fix_missing_locations(tranformer.visit(initial_ast))
+ transformer = transformer_class()
+ result_ast = ast.fix_missing_locations(transformer.visit(initial_ast))
self.assertASTEqual(result_ast, expected_ast)
diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py
index 3450971..c3bff76 100644
--- a/Lib/test/test_asyncio/test_locks.py
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -1194,14 +1194,14 @@ class SemaphoreTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual([2, 3], result)
async def test_acquire_fifo_order_4(self):
- # Test that a successfule `acquire()` will wake up multiple Tasks
+ # Test that a successful `acquire()` will wake up multiple Tasks
# that were waiting in the Semaphore queue due to FIFO rules.
sem = asyncio.Semaphore(0)
result = []
count = 0
async def c1(result):
- # First task immediatlly waits for semaphore. It will be awoken by c2.
+ # First task immediately waits for semaphore. It will be awoken by c2.
self.assertEqual(sem._value, 0)
await sem.acquire()
# We should have woken up all waiting tasks now.
@@ -1475,7 +1475,7 @@ class BarrierTests(unittest.IsolatedAsyncioTestCase):
# first time waiting
await barrier.wait()
- # after wainting once for all tasks
+ # after waiting once for all tasks
if rewait_n > 0:
rewait_n -= 1
# wait again only for rewait tasks
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index 5450130..ec748b9 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -783,7 +783,7 @@ class SubprocessMixin:
def test_subprocess_protocol_events(self):
# gh-108973: Test that all subprocess protocol methods are called.
- # The protocol methods are not called in a determistic order.
+ # The protocol methods are not called in a deterministic order.
# The order depends on the event loop and the operating system.
events = []
fds = [1, 2]
diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py
index 328b642..81544f5 100644
--- a/Lib/test/test_capi/test_opt.py
+++ b/Lib/test/test_capi/test_opt.py
@@ -176,7 +176,7 @@ class TestExecutorInvalidation(unittest.TestCase):
self.assertTrue(exe.is_valid())
# Assert that the correct executors are invalidated
# and check that nothing crashes when we invalidate
- # an executor mutliple times.
+ # an executor multiple times.
for i in (4,3,2,1,0):
_testinternalcapi.invalidate_executors(objects[i])
for exe in executors[i:]:
diff --git a/Lib/test/test_concurrent_futures/test_deadlock.py b/Lib/test/test_concurrent_futures/test_deadlock.py
index 3c30c45..f60465f 100644
--- a/Lib/test/test_concurrent_futures/test_deadlock.py
+++ b/Lib/test/test_concurrent_futures/test_deadlock.py
@@ -236,7 +236,7 @@ class ExecutorDeadlockTest:
executor_manager.join()
def test_crash_big_data(self):
- # Test that there is a clean exception instad of a deadlock when a
+ # Test that there is a clean exception instead of a deadlock when a
# child process crashes while some data is being written into the
# queue.
# https://github.com/python/cpython/issues/94777
diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py
index 5413319..95224e1 100644
--- a/Lib/test/test_email/test__header_value_parser.py
+++ b/Lib/test/test_email/test__header_value_parser.py
@@ -2773,7 +2773,7 @@ class TestParser(TestParserMixin, TestEmailBase):
parser.get_msg_id("<simplelocal@")
def test_get_msg_id_with_brackets(self):
- # Microsof Outlook generates non-standard one-off addresses:
+ # Microsoft Outlook generates non-standard one-off addresses:
# https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/one-off-addresses
with self.assertRaises(errors.HeaderParseError):
parser.get_msg_id("<[abrakadabra@microsoft.com]>")
diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py
index fd778ec..3d89d69 100644
--- a/Lib/test/test_import/__init__.py
+++ b/Lib/test/test_import/__init__.py
@@ -405,7 +405,7 @@ class ImportTests(unittest.TestCase):
def test_double_const(self):
# Importing double_const checks that float constants
- # serialiazed by marshal as PYC files don't lose precision
+ # serialized by marshal as PYC files don't lose precision
# (SF bug 422177).
from test.test_import.data import double_const
unload('test.test_import.data.double_const')
@@ -2926,7 +2926,7 @@ class SinglephaseInitTests(unittest.TestCase):
# * alive in 1 interpreter (main)
# * module def still in _PyRuntime.imports.extensions
# * mod init func ran again
- # * m_copy is NULL (claered when the interpreter was destroyed)
+ # * m_copy is NULL (cleared when the interpreter was destroyed)
# (was from main interpreter)
# * module's global state was updated, not reset
@@ -3061,7 +3061,7 @@ class SinglephaseInitTests(unittest.TestCase):
# * alive in 0 interpreters
# * module def in _PyRuntime.imports.extensions
# * mod init func ran for the first time (since reset, at least)
- # * m_copy is NULL (claered when the interpreter was destroyed)
+ # * m_copy is NULL (cleared when the interpreter was destroyed)
# * module's global state was initialized, not reset
# Use a subinterpreter that sticks around.