"""Tests for distutils.command.bdist."""
-import os
import unittest
from test.support import run_unittest
from distutils.tests import support
from test.support import run_unittest, swap_item, requires_subprocess, is_wasi
from test.support.os_helper import TESTFN
-from test.support.warnings_helper import check_warnings
class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
# Python imports
import os.path
-import sys
import test.support
import unittest
import bisect
import copy
import decimal
-import functools
import sys
import os
import pickle
"""Adjust the system resource limits (ulimit) if needed."""
try:
import resource
- from resource import RLIMIT_NOFILE, RLIM_INFINITY
+ from resource import RLIMIT_NOFILE
except ImportError:
return
fd_limit, max_fds = resource.getrlimit(RLIMIT_NOFILE)
"""
import sys
-import os
from functools import cmp_to_key
-from test import support, seq_tests
+from test import seq_tests
from test.support import ALWAYS_EQ, NEVER_EQ
Various tests for synchronization primitives.
"""
-import os
import gc
import sys
import time
import asyncio
from asyncio import coroutines
from asyncio import events
-from asyncio import proactor_events
from asyncio import selector_events
from test.test_asyncio import utils as test_utils
from test import support
import _thread
import asyncio
import contextvars
-import gc
import re
import signal
import threading
from asyncio import proactor_events
from itertools import cycle, islice
-from unittest.mock import patch, Mock
+from unittest.mock import Mock
from test.test_asyncio import utils as test_utils
from test import support
from test.support import socket_helper
"""Tests for tasks.py."""
import collections
-import contextlib
import contextvars
-import functools
import gc
import io
import random
import re
import sys
-import textwrap
import traceback
import unittest
from unittest import mock
from types import GenericAlias
import asyncio
-from asyncio import coroutines
from asyncio import futures
from asyncio import tasks
from test.test_asyncio import utils as test_utils
import time
import asyncio
-from asyncio import tasks
def tearDownModule():
import atexit
import os
-import sys
import textwrap
import unittest
from test import support
import binascii
import array
import re
-from test.support import bigmemtest, _1G, _4G, warnings_helper
+from test.support import bigmemtest, _1G, _4G
# Note: "*_hex" functions are aliases for "(un)hexlify"
import unittest
-from test import support
from test.support import os_helper
import io # C implementation.
from test import support
from test.support import os_helper
-from test.support import warnings_helper
try:
import _testcapi
-from test import support
import unittest
from types import MethodType
"""Unit tests for collections.defaultdict."""
-import os
import copy
import pickle
-import tempfile
import unittest
from collections import defaultdict
def test_str_of_str_subclass(self):
# Testing __str__ defined in subclass of str ...
import binascii
- import io
class octetstring(str):
def __str__(self):
import base64
import unittest
import textwrap
-import warnings
from io import StringIO, BytesIO
from itertools import chain
# These imports are documented to work, but we are testing them using a
# different path, so we import them here just to make sure they are importable.
-from email.parser import FeedParser, BytesFeedParser
+from email.parser import FeedParser
NL = '\n'
EMPTYSTRING = ''
import collections.abc
-import traceback
import types
import unittest
# Python test set -- part 5, built-in exceptions
import copy
-import gc
import os
import sys
import unittest
import unittest
from test import support
-from test.support import import_helper
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
INVALID_UNDERSCORE_LITERALS)
from math import isinf, isnan, copysign, ldexp
import __future__
import unittest
-from test import support
class FLUFLTests(unittest.TestCase):
import typing
import unittest
import unittest.mock
-import os
import weakref
import gc
from weakref import proxy
from test.support import import_helper
from test.support import threading_helper
-from test.support.script_helper import assert_python_ok
import functools
import __future__
import ast
import unittest
-from test import support
from test.support import import_helper
from textwrap import dedent
import os
import ntpath
import pathlib
import posixpath
-import sys
import unittest
from test.support import verbose
import unittest
import doctest
-from test import support
from test.support import import_helper
from unittest import TestCase, skipUnless
from operator import itemgetter
import stat
import sys
import re
-import test.support
from test.support import os_helper
from test.support import warnings_helper
import time
import threading
import socket
-from test.support import (verbose,
- run_with_tz, run_with_locale, cpython_only,
- requires_working_socket)
+from test.support import verbose, run_with_tz, run_with_locale, cpython_only
from test.support import hashlib_helper
from test.support import threading_helper
from test.support import warnings_helper
import marshal
import os
import sys
-from test import support
from test.support import import_helper
import types
import unittest
import os.path
import sys
-from test import support
from test.support import import_helper
from test.support import os_helper
import types
import sys
import sysconfig
import tempfile
-import textwrap
import unittest
from pathlib import Path
from test import support
import dis
-import sys
import textwrap
import unittest
import sys
import test.support
import unittest
-import warnings
from test.support import os_helper
from test.support import warnings_helper
-from test import support
from test.support import import_helper
import unittest
import warnings
import sysconfig
import tempfile
import textwrap
-import time
import unittest
from test import libregrtest
from test import support
import errno
-import os
import select
import subprocess
import sys
import unittest
import dbm
import shelve
-import glob
import pickle
import os
-from test import support
from test.support import os_helper
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
from test.support import os_helper
from test.support import socket_helper
from test.support import captured_stderr
-from test.support.os_helper import TESTFN, EnvironmentVarGuard, change_cwd
+from test.support.os_helper import TESTFN, EnvironmentVarGuard
import ast
import builtins
-import encodings
import glob
import io
import os
# Skip test if _sqlite3 module not installed.
import_helper.import_module('_sqlite3')
-import unittest
import os
import sqlite3
from test.support.import_helper import import_module
from test.support.os_helper import (TESTFN, unlink, skip_unless_symlink,
change_cwd)
-from test.support.warnings_helper import check_warnings
import sysconfig
from sysconfig import (get_paths, get_platform, get_config_vars,
import unittest
-import locale
-import re
import subprocess
import sys
import os
-import warnings
from test import support
from test.support import import_helper
from test.support import os_helper
from test import support
from test.support import threading_helper
import weakref
-import gc
# Modules under test
import _thread
"""Tests for the md5sum script in the Tools directory."""
-import sys
import os
import unittest
from test.support import os_helper
import subprocess
import sys
import unittest
-from test import support
from test.support import os_helper
from test.test_tools import scriptsdir, skip_if_missing
import unittest
import subprocess
import textwrap
-from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok
from test.support.os_helper import TESTFN, unlink
from test.support.script_helper import assert_python_ok, assert_python_failure
-import os
import textwrap
import traceback
from functools import partial
import ast
import sys
import unittest
-from test import support
funcdef = """\
import unittest
import os
import sys
-from test import support
from test.support import os_helper
import unittest
from test import support
from test.support import os_helper
-from test.support import socket_helper
from test.support import warnings_helper
from test import test_urllib
import subprocess
import sys
import tempfile
-from test.support import (captured_stdout, captured_stderr, requires_zlib,
+from test.support import (captured_stdout, captured_stderr,
skip_if_broken_multiprocessing_synchronize, verbose,
requires_subprocess, is_emscripten, is_wasi,
requires_venv_with_pip)