Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
e1d4001
Use new test.support helper submodules in tests
shihai1991 Jul 12, 2020
104060d
remove unused module
shihai1991 Jul 12, 2020
62a6061
Merge branch 'master' into bpo_40275_helper_replace_13
shihai1991 Jul 12, 2020
bc385bc
bpo-20181: Convert the readline module to the Argument Clinic (#14326)
ZackerySpytz Jul 12, 2020
bc3d804
bpo-20175: Convert Modules/_multiprocessing to the Argument Clinic (G…
ZackerySpytz Jul 12, 2020
c2819d3
bpo-41146: Convert signal.default_int_handler() to Argument Clinic (G…
serhiy-storchaka Jul 12, 2020
26c9c70
bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458)
serhiy-storchaka Jul 13, 2020
56c4331
bpo-32192: A basic lazy importer example (GH-21330)
nanjekyejoannah Jul 13, 2020
170a8a8
Fix repeated words in Classes tutorial (GH-21455)
PaulMcMillan Jul 14, 2020
b3aef83
bpo-32528: Document the change in inheritance of asyncio.CancelledErr…
JustAnotherArchivist Jul 14, 2020
a2d9d5d
bpo-41273: asyncio's proactor read transport's better performance by …
tontinton Jul 14, 2020
0675e5f
bpo-20183: Convert _locale to the Argument Clinic (GH-14201)
ZackerySpytz Jul 15, 2020
3c3411b
bpo-39017: Avoid infinite loop in the tarfile module (GH-21454)
rishi93 Jul 15, 2020
f25bfa2
bpo-41302: Fix build with system libmpdec (GH-21481)
felixonmars Jul 15, 2020
bde9b72
Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477)
benjaminp Jul 15, 2020
cddbe8e
Fix -Wstring-prototypes warnings in _zoneinfo.c. (GH-21478)
benjaminp Jul 15, 2020
6d537b4
bpo-40150: Fix mismatched argument in RegisterWaitForSingleObject() c…
ZackerySpytz Jul 15, 2020
9f11bcc
bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495)
zooba Jul 15, 2020
5303bf8
bpo-31844: Remove _markupbase.ParserBase.error() (GH-8562)
berkerpeksag Jul 16, 2020
6ecd55a
bpo-31844: Move whatsnew note to 3.10.rst (GH-21504)
berkerpeksag Jul 16, 2020
4b9dfef
Remove unnecessary spaces in code blocks in urllib.parse.rst (GH-21500)
chrisyeh96 Jul 16, 2020
f2197cb
Fix possibly-unitialized warning in string_parser.c. (GH-21503)
benjaminp Jul 16, 2020
e57f75d
Fix trivial typo in the PEG string parser (GH-21508)
ericvsmith Jul 16, 2020
1349c97
bpo-41300: IDLE - save files with non-ascii chars (GH-21512)
terryjreedy Jul 16, 2020
ee26dc3
bpo-41195: Add getter for Openssl security level (GH-21282)
matthewhughes934 Jul 17, 2020
4134617
bpo-40941: Unify implicit and explicit state in the frame and generat…
markshannon Jul 17, 2020
d9f6d8b
bpo-43104: Update NEWS to include CVE-2020-15801 reference (GH-21521)
zooba Jul 17, 2020
19141a1
Fix a small grammatical mistake in a comment (GH-21526)
brettcannon Jul 17, 2020
61feac4
bpo-41288: Refactor of unpickling NEWOBJ and NEWOBJ_EX opcodes. (GH-2…
serhiy-storchaka Jul 18, 2020
77c28b1
bpo-41262: Convert memoryview to Argument Clinic. (GH-21421)
serhiy-storchaka Jul 18, 2020
5837652
bpo-41325: Add version note for args and kwargs property in call obje…
uSpike Jul 18, 2020
d6258af
bpo-39603: Prevent header injection in http methods (GH-18485)
amiremohamadi Jul 18, 2020
f0d0237
bpo-41295: Reimplement the Carlo Verre "hackcheck" (GH-21528)
scoder Jul 18, 2020
6f297a3
bpo-41333: Convert OrderedDict.pop() to Argument Clinic (GH-21534)
serhiy-storchaka Jul 19, 2020
de846a1
bpo-41205: Document Decimal power 0 to the 0 (GH-21386)
srinivasreddy Jul 19, 2020
ebbe4cf
bpo-38169: Increase code coverage for SharedMemory and ShareableList …
vinay0410 Jul 19, 2020
36a8204
bpo-41338: Fix DeprecationWarning in tests (GH-21542)
methane Jul 20, 2020
fed528f
bpo-40741: Update macOS installer to use SQLite 3.32.3 (GH-20979)
Jul 20, 2020
9264f19
Doc: fix import of asdl.py when called from outside Doc/. (GH-21529)
JulienPalard Jul 20, 2020
a2425a2
bpo-37703: improve asyncio.gather documentation regarding cancellatio…
vinay0410 Jul 20, 2020
833cd79
Simple Documentation fix: Missing link to return type class. (GH-21291)
Volker-Weissmann Jul 20, 2020
185ac7d
bpo-41336: Fix the error handling in zoneinfo_new_instance() (GH-21546)
ZackerySpytz Jul 20, 2020
ca8d63e
bpo-41343: Convert methods of complex to Argument Clinic (GH-21550)
corona10 Jul 20, 2020
93ccf70
bpo-41334: Convert constructors of str, bytes and bytearray to Argume…
serhiy-storchaka Jul 20, 2020
a597f0a
bpo-41342: Convert int.__round__ to Argument Clinic (GH-21549)
serhiy-storchaka Jul 20, 2020
ccbc2bc
bpo-40741: Update Windows build to include SQLite 3.32.3 (GH-21570)
zooba Jul 20, 2020
1bf47e5
bpo-41283: Fix mismatched argument name for imghdr.what (GH-21501)
ammaraskar Jul 21, 2020
808203d
bpo-41364: Reduce import overhead of uuid module (GH-21586)
zooba Jul 21, 2020
f766adc
bpo-41341: Recursive evaluation of ForwardRef in get_type_hints (#21553)
wyfo Jul 22, 2020
4ce1885
bpo-41369 Update to libmpdec-2.5.1: new features (GH-21593)
skrah Jul 22, 2020
e45c083
Stick with the phrase "default parameter value" (GH-21590)
andresdelfino Jul 22, 2020
b1bac9c
bpo-41182 selector: use DefaultSelector based upon implementation (GH…
Akasurde Jul 23, 2020
b5ffc5c
bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594)
ZackerySpytz Jul 23, 2020
5a7e588
bpo-41366: Fix clang warning for sign conversion (GH-21592)
henryiii Jul 23, 2020
e89752d
bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept(…
agronholm Jul 23, 2020
aaac3b5
bpo-41373: IDLE: Fix saving files loaded with no newlines or mixed ne…
serhiy-storchaka Jul 25, 2020
0454fd7
bpo-37309: NEWS for #41373 (GH-21612)
terryjreedy Jul 25, 2020
b9063e5
bpo-38731: Add --quiet option to py_compile CLI (GH-17134)
gvsheva Jul 25, 2020
1ca7578
bpo-41314: fixed annotations __future__ version (GH-21616)
YoSTEALTH Jul 25, 2020
004e82b
bpo-39868: Add documentation for Assignment Expressions (walrus, PEP …
shankarj67 Jul 25, 2020
d481884
bpo-41385: Fix test_executable_without_cwd on Windows (GH-21608)
serhiy-storchaka Jul 26, 2020
3b83635
Delete remaining references to Grammar/Grammar from docs (#21624)
gvanrossum Jul 26, 2020
505d16d
Fix atexitmodule doc (GH-21456)
linchiwei123 Jul 26, 2020
36457bb
bpo-41384: Raise TclError in tkinter.OptionMenu (GH-21601)
Akuli Jul 27, 2020
e93448a
bpo-41340: Removed fallback implementation for strdup (GH-21634)
Jul 27, 2020
d2b0cab
bpo-31904: Fix test_ftplib failures for VxWorks RTOS (GH-19447)
pxinwr Jul 27, 2020
aa7c22e
bpo-41401: Fix test_fspath_support in test_io. (GH-21640)
serhiy-storchaka Jul 27, 2020
ae085b1
bpo-40939: Use the new grammar for the grammar specification document…
pablogsal Jul 27, 2020
dbdeaa2
bpo-40939: Remove even more references to the old parser (GH-21642)
lysnikolaou Jul 27, 2020
68732c1
bpo-41045: Document debug feature of f-strings ('=') (GH-21509)
amaajemyfren Jul 27, 2020
d00400d
Validate the AST produced by the parser in debug mode (GH-21643)
pablogsal Jul 27, 2020
f45a004
bpo-35328: Set VIRTUAL_ENV_PROMPT at venv activation (GH-21587)
ZackerySpytz Jul 28, 2020
7655ae8
bpo-41328: Replace mention of Hudson CI with Travis CI and AppVeyor (…
Jul 28, 2020
97ac216
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
zooba Jul 28, 2020
7fff0da
Fix `List_Append` description, list is extracted at TOS1[-i] (GH-21465)
zhangyangyu Jul 28, 2020
fa966e2
Remove incorrect mention of method.__class__ in descriptor docs (GH-2…
Jongy Jul 28, 2020
744a9c5
closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH…
benjaminp Jul 29, 2020
953733b
bpo-41426 Fix grammar in curses.getmouse() documentation (GH-21677)
s3bw Jul 29, 2020
2c6db7b
bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-…
markshannon Jul 30, 2020
88c59f6
bpo-40360: Handle PendingDeprecationWarning in test_lib2to3. (GH-21694)
tirkarthi Jul 31, 2020
b9c5c17
bpo-41421: Algebraic simplification for random.paretovariate() (GH-21…
rhettinger Aug 1, 2020
577fbbd
random module: Convert a "while 1" to "while True (GH-21700)
rhettinger Aug 2, 2020
51a9b9e
bpo-40979: refactored typing.rst; (mostly) same content, new sub-sect…
ramalho Aug 2, 2020
dd7378e
bpo-41424: Remove extra words in Tkinter-Packer documentation (GH-21707)
nmaynes Aug 3, 2020
78aeea9
bpo-41425: Make tkinter doc example runnable (GH-21706)
nerandell Aug 3, 2020
2edc37a
A (very) slight speed improvement for iterating over bytes (#21705)
gvanrossum Aug 3, 2020
d23a13f
bpo-40275: Use new test.support helper submodules in tests (GH-21449)
shihai1991 Aug 3, 2020
f491296
bpo-40275: Use new test.support helper submodules in tests (GH-21451)
shihai1991 Aug 3, 2020
7ad643a
bpo-40275: Use new test.support helper submodules in tests (GH-21448)
shihai1991 Aug 3, 2020
4c461ad
bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH…
vstinner Aug 3, 2020
587f073
bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
vstinner Aug 4, 2020
11c2ff2
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
vstinner Aug 4, 2020
58220f0
bpo-41431: Optimize dict_merge for copy (GH-21674)
methane Aug 4, 2020
b568ebb
bpo-36982: Add support for extended color functions in ncurses 6.1 (G…
hpjansson Aug 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-40275: Use new test.support helper submodules in tests (GH-21448)
  • Loading branch information
shihai1991 committed Aug 4, 2020
commit 7ad643a6373452dbc8050f9f7345d85825b1af28
5 changes: 3 additions & 2 deletions Lib/test/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from io import StringIO

from test import support
from test.support import os_helper
from unittest import mock
class StdIOBuffer(StringIO):
pass
Expand All @@ -23,7 +24,7 @@ def setUp(self):
# The tests assume that line wrapping occurs at 80 columns, but this
# behaviour can be overridden by setting the COLUMNS environment
# variable. To ensure that this width is used, set COLUMNS to 80.
env = support.EnvironmentVarGuard()
env = os_helper.EnvironmentVarGuard()
env['COLUMNS'] = '80'
self.addCleanup(env.__exit__)

Expand Down Expand Up @@ -3244,7 +3245,7 @@ class TestShortColumns(HelpTestCase):
but we don't want any exceptions thrown in such cases. Only ugly representation.
'''
def setUp(self):
env = support.EnvironmentVarGuard()
env = os_helper.EnvironmentVarGuard()
env.set("COLUMNS", '15')
self.addCleanup(env.__exit__)

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_asyncgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import types
import unittest

from test.support import import_module
from test.support.import_helper import import_module
asyncio = import_module("asyncio")


Expand Down
3 changes: 2 additions & 1 deletion Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed to the PSF under a contributor agreement.

from test import support, test_tools
from test.support import os_helper
from unittest import TestCase
import collections
import inspect
Expand Down Expand Up @@ -797,7 +798,7 @@ def test_external(self):
source = support.findfile('clinic.test')
with open(source, 'r', encoding='utf-8') as f:
original = f.read()
with support.temp_dir() as testdir:
with os_helper.temp_dir() as testdir:
testfile = os.path.join(testdir, 'clinic.test.c')
with open(testfile, 'w', encoding='utf-8') as f:
f.write(original)
Expand Down
28 changes: 15 additions & 13 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from unittest import mock

from test import support
from test.support import os_helper
from test.support import warnings_helper

try:
import _testcapi
Expand Down Expand Up @@ -709,11 +711,11 @@ def test_bug691291(self):
s1 = 'Hello\r\nworld\r\n'

s = s1.encode(self.encoding)
self.addCleanup(support.unlink, support.TESTFN)
with open(support.TESTFN, 'wb') as fp:
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
with open(os_helper.TESTFN, 'wb') as fp:
fp.write(s)
with support.check_warnings(('', DeprecationWarning)):
reader = codecs.open(support.TESTFN, 'U', encoding=self.encoding)
with warnings_helper.check_warnings(('', DeprecationWarning)):
reader = codecs.open(os_helper.TESTFN, 'U', encoding=self.encoding)
with reader:
self.assertEqual(reader.read(), s1)

Expand Down Expand Up @@ -1697,10 +1699,10 @@ def test_all(self):
getattr(codecs, api)

def test_open(self):
self.addCleanup(support.unlink, support.TESTFN)
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
for mode in ('w', 'r', 'r+', 'w+', 'a', 'a+'):
with self.subTest(mode), \
codecs.open(support.TESTFN, mode, 'ascii') as file:
codecs.open(os_helper.TESTFN, mode, 'ascii') as file:
self.assertIsInstance(file, codecs.StreamReaderWriter)

def test_undefined(self):
Expand All @@ -1718,7 +1720,7 @@ def test_file_closes_if_lookup_error_raised(self):
mock_open = mock.mock_open()
with mock.patch('builtins.open', mock_open) as file:
with self.assertRaises(LookupError):
codecs.open(support.TESTFN, 'wt', 'invalid-encoding')
codecs.open(os_helper.TESTFN, 'wt', 'invalid-encoding')

file().close.assert_called()

Expand Down Expand Up @@ -2516,10 +2518,10 @@ def test_seek0(self):
"utf-32",
"utf-32-le",
"utf-32-be")
self.addCleanup(support.unlink, support.TESTFN)
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
for encoding in tests:
# Check if the BOM is written only once
with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f:
with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f:
f.write(data)
f.write(data)
f.seek(0)
Expand All @@ -2528,7 +2530,7 @@ def test_seek0(self):
self.assertEqual(f.read(), data * 2)

# Check that the BOM is written after a seek(0)
with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f:
with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f:
f.write(data[0])
self.assertNotEqual(f.tell(), 0)
f.seek(0)
Expand All @@ -2537,7 +2539,7 @@ def test_seek0(self):
self.assertEqual(f.read(), data)

# (StreamWriter) Check that the BOM is written after a seek(0)
with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f:
with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f:
f.writer.write(data[0])
self.assertNotEqual(f.writer.tell(), 0)
f.writer.seek(0)
Expand All @@ -2547,7 +2549,7 @@ def test_seek0(self):

# Check that the BOM is not written after a seek() at a position
# different than the start
with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f:
with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f:
f.write(data)
f.seek(f.tell())
f.write(data)
Expand All @@ -2556,7 +2558,7 @@ def test_seek0(self):

# (StreamWriter) Check that the BOM is not written after a seek()
# at a position different than the start
with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f:
with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f:
f.writer.write(data)
f.writer.seek(f.writer.tell())
f.writer.write(data)
Expand Down
16 changes: 10 additions & 6 deletions Lib/test/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"""

from test import support
from test.support import import_helper
from test.support import os_helper
import doctest
import functools
import os
Expand Down Expand Up @@ -441,7 +443,7 @@ def basics(): r"""
>>> tests = finder.find(sample_func)

>>> print(tests) # doctest: +ELLIPSIS
[<DocTest sample_func from ...:25 (1 example)>]
[<DocTest sample_func from ...:27 (1 example)>]

The exact name depends on how test_doctest was invoked, so allow for
leading path components.
Expand Down Expand Up @@ -705,7 +707,7 @@ def test_empty_namespace_package(self):
try:
mod = importlib.import_module(pkg_name)
finally:
support.forget(pkg_name)
import_helper.forget(pkg_name)
sys.path.pop()

include_empty_finder = doctest.DocTestFinder(exclude_empty=False)
Expand Down Expand Up @@ -2758,7 +2760,7 @@ def test_lineendings(): r"""
>>> dn = tempfile.mkdtemp()
>>> pkg = os.path.join(dn, "doctest_testpkg")
>>> os.mkdir(pkg)
>>> support.create_empty_file(os.path.join(pkg, "__init__.py"))
>>> os_helper.create_empty_file(os.path.join(pkg, "__init__.py"))
>>> fn = os.path.join(pkg, "doctest_testfile.txt")
>>> with open(fn, 'wb') as f:
... f.write(
Expand Down Expand Up @@ -2840,7 +2842,8 @@ def test_CLI(): r"""
simple tests and no errors. We'll run both the unadorned doctest command, and
the verbose version, and then check the output:

>>> from test.support import script_helper, temp_dir
>>> from test.support import script_helper
>>> from test.support.os_helper import temp_dir
>>> with temp_dir() as tmpdir:
... fn = os.path.join(tmpdir, 'myfile.doc')
... with open(fn, 'w') as f:
Expand Down Expand Up @@ -2891,7 +2894,8 @@ def test_CLI(): r"""
file ends in '.py', its handling of python module files (as opposed to straight
text files).

>>> from test.support import script_helper, temp_dir
>>> from test.support import script_helper
>>> from test.support.os_helper import temp_dir
>>> with temp_dir() as tmpdir:
... fn = os.path.join(tmpdir, 'myfile.doc')
... with open(fn, 'w') as f:
Expand Down Expand Up @@ -3109,7 +3113,7 @@ def test_main():


def test_coverage(coverdir):
trace = support.import_module('trace')
trace = import_helper.import_module('trace')
tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
trace=0, count=1)
tracer.run('test_main()')
Expand Down
9 changes: 6 additions & 3 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
import weakref
import errno

from test.support import (TESTFN, captured_stderr, check_impl_detail,
check_warnings, cpython_only, gc_collect,
no_tracing, unlink, import_module, script_helper,
from test.support import (captured_stderr, check_impl_detail,
cpython_only, gc_collect,
no_tracing, script_helper,
SuppressCrashReport)
from test.support.import_helper import import_module
from test.support.os_helper import TESTFN, unlink
from test.support.warnings_helper import check_warnings
from test import support


Expand Down
3 changes: 2 additions & 1 deletion Lib/test/test_ftplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from test import support
from test.support import threading_helper
from test.support import socket_helper
from test.support import warnings_helper
from test.support.socket_helper import HOST, HOSTv6

TIMEOUT = support.LOOPBACK_TIMEOUT
Expand Down Expand Up @@ -623,7 +624,7 @@ def test_storlines(self):

f = io.StringIO(RETR_DATA.replace('\r\n', '\n'))
# storlines() expects a binary file, not a text file
with support.check_warnings(('', BytesWarning), quiet=True):
with warnings_helper.check_warnings(('', BytesWarning), quiet=True):
self.assertRaises(TypeError, self.client.storlines, 'stor foo', f)

def test_nlst(self):
Expand Down
5 changes: 3 additions & 2 deletions Lib/test/test_gc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import unittest
import unittest.mock
from test.support import (verbose, refcount_test, run_unittest,
cpython_only, temp_dir, TESTFN, unlink,
import_module)
cpython_only)
from test.support.import_helper import import_module
from test.support.os_helper import temp_dir, TESTFN, unlink
from test.support.script_helper import assert_python_ok, make_script
from test.support import threading_helper

Expand Down
Loading