def cleanup(self):
import glob
- import shutil
path = os.path.join(self.tmp_dir, 'test_python_*')
print("Cleanup %s directory" % self.tmp_dir)
import collections.abc
import contextlib
-import datetime
import errno
import faulthandler
import fnmatch
import gc
import importlib
import importlib.util
-import io
import logging.handlers
import nntplib
import os
import sys
import struct
import aifc
-import warnings
class AifcTest(audiotests.AudioWriteTests,
# Author: Steven J. Bethard <steven.bethard@gmail.com>.
-import codecs
import inspect
import os
import shutil
import errno
import socket
import sys
-import _thread as thread
import threading
import time
import unittest
import types
import unittest
-from test import support
from unittest import mock
import asyncio
from asyncio import log
from asyncio import protocols
from asyncio import sslproto
-from asyncio import tasks
from test.test_asyncio import utils as test_utils
from test.test_asyncio import functional as func_tests
import asyncio
from asyncio import log
-from asyncio import base_events
from asyncio import events
from asyncio import unix_events
from test.test_asyncio import utils as test_utils
import locale
import os
-import shutil
import subprocess
import sys
import sysconfig
from collections import namedtuple
import test.support
-from test.support.script_helper import (
- run_python_until_end,
- interpreter_requires_environment,
-)
+from test.support.script_helper import run_python_until_end
+
# Set the list of ways we expect to be able to ask for the "C" locale
EXPECTED_C_LOCALE_EQUIVALENTS = ["C", "invalid.ascii"]
import re
import subprocess
import sys
-import sysconfig
import textwrap
import threading
import time
import os
import subprocess
import sys
-import sysconfig
import tempfile
import unittest
from test import support
import collections
import copy
import doctest
-import keyword
import operator
import pickle
from random import choice, randrange
-import re
import string
import sys
from test import support
"""Unit tests for contextlib.py, and other context managers."""
-import asyncio
import io
import sys
import tempfile
import copy
import inspect
import pickle
-import re
import sys
import types
import unittest
import http.client
import sys
import threading
-from test import support
import unittest
def make_request_and_skipIf(condition, reason):
import io
-import sys
import types
import textwrap
import unittest
import errno
from test.support import (TESTFN, captured_stderr, check_impl_detail,
- check_warnings, cpython_only, gc_collect, run_unittest,
+ check_warnings, cpython_only, gc_collect,
no_tracing, unlink, import_module, script_helper,
SuppressCrashReport)
class NaiveException(Exception):
from test import support
from test.support import script_helper, is_android
import tempfile
-import threading
import unittest
from textwrap import dedent
import unittest
from test.fork_wait import ForkWait
-from test.support import (reap_children, get_attribute,
- import_module, verbose)
+from test.support import reap_children, get_attribute, verbose
# Skip test if fork does not exist.
import sys
import unittest
from test.support import captured_stdout
-from importlib import util
class TestFrozen(unittest.TestCase):
# The code for testing gdb was adapted from similar work in Unladen Swallow's
# Lib/test/test_jit_gdb.py
-import locale
import os
import platform
import re
import pickle
import sys
import unittest
-import warnings
import weakref
import inspect
import os
import base64
import gettext
-import locale
import unittest
from test import support
from test.support import check_syntax_error
import inspect
import unittest
-import sys
# testing import *
from sys import *
# with import machinery
import test.ann_module as ann_module
import typing
-from collections import ChainMap
from test import ann_module2
import test
from test import support
from contextlib import contextmanager
-import errno
import imaplib
import os.path
import socketserver
import builtins
import marshal
import os
-import platform
import py_compile
import random
import stat
import test.support
from test.support import (
- EnvironmentVarGuard, TESTFN, check_warnings, forget, is_jython,
- make_legacy_pyc, rmtree, run_unittest, swap_attr, swap_item, temp_umask,
- unlink, unload, create_empty_file, cpython_only, TESTFN_UNENCODABLE,
+ TESTFN, forget, is_jython,
+ make_legacy_pyc, rmtree, swap_attr, swap_item, temp_umask,
+ unlink, unload, cpython_only, TESTFN_UNENCODABLE,
temp_dir, DirsOnSysPath)
from test.support import script_helper
from test.test_importlib.util import uncache
import sys
import threading
-import unittest
import weakref
from test import support
import locale
import sys
import codecs
-import warnings
+
class BaseLocalizedTest(unittest.TestCase):
#
import netrc, os, unittest, sys, tempfile, textwrap
-from unittest import mock
from test import support
import decimal
import errno
import fractions
-import getpass
import itertools
import locale
import mmap
import os
import posixpath
import unittest
-import warnings
from posixpath import realpath, abspath, dirname, basename
from test import support, test_genericpath
from test.support import FakePath
except ImportError:
posix = None
+
# An absolute path to a temporary filename for testing. We can't rely on TESTFN
# being an absolute path, so we need this.
Nick Mathewson
'''
-import os
import sys
from textwrap import dedent
from types import FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase, main as unittest_main
-from test import support
-from functools import partial
StaticMethodType = type(staticmethod(lambda: None))
ClassMethodType = type(classmethod(lambda c: None))
import xml.etree
import xml.etree.ElementTree
import textwrap
-import threading
from io import StringIO
from collections import namedtuple
from test.support.script_helper import assert_python_ok
# Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
-import collections
import itertools
import queue
import random
-import sys
import threading
import time
import unittest
import contextlib
import sys
-import os
import unittest
from test import support
import time
from test.support import (
forget, make_legacy_pyc, unload, verbose, no_tracing,
create_empty_file, temp_dir)
-from test.support.script_helper import (
- make_pkg, make_script, make_zip_pkg, make_zip_script)
+from test.support.script_helper import make_script, make_zip_script
import runpy
from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl
from io import BytesIO, StringIO
import codecs
-import gc
import os.path
import shutil
from urllib.error import URLError
import statistics
import subprocess
import sys
-import threading
import time
import unittest
from test import support
import unittest
from test import support, mock_socket
-from test.support import HOST, HOSTv4, HOSTv6
+from test.support import HOST
from unittest.mock import Mock
from test import support
import subprocess
import sys
-import platform
import signal
import io
import itertools
import textwrap
from test.support import FakePath
-try:
- import ctypes
-except ImportError:
- ctypes = None
-else:
- import ctypes.util
-
try:
import _testcapi
except ImportError:
_testcapi = None
+
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
from test import support
import _thread as thread
import time
-import sys
import weakref
from test import lock_tests
import unittest
from unittest import mock
from test.support import (
- verbose, import_module, run_unittest, TESTFN, reap_threads,
+ verbose, run_unittest, TESTFN, reap_threads,
forget, unlink, rmtree, start_threads)
def task(N, done, done_tasks, errors):
provoking a 2.0 failure under Linux.
"""
-NUM_THREADS = 20
-FILES_PER_THREAD = 50
-
import tempfile
-from test.support import start_threads, import_module
+from test.support import start_threads
import unittest
import io
import threading
from traceback import print_exc
+
+NUM_THREADS = 20
+FILES_PER_THREAD = 50
+
+
startEvent = threading.Event()
+
class TempFileGreedy(threading.Thread):
error_count = 0
ok_count = 0
import time
import threading
import unittest
-import warnings
try:
import _testcapi
except ImportError:
from test import support
from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP,
STRING, ENDMARKER, ENCODING, tok_name, detect_encoding,
- open as tokenize_open, Untokenizer, generate_tokens,
+ open as tokenize_open, Untokenizer,
NEWLINE)
from io import BytesIO
import unittest
# Test that tracebacks are correctly printed for encoded source files:
# - correct line number (Issue2384)
# - respect file encoding (Issue3975)
- import tempfile, sys, subprocess, os
+ import sys, subprocess
# The spawned subprocess has its stdout redirected to a PIPE, and its
# encoding may be different from the current interpreter, on Windows
"""
import locale
-import os
import sys
import textwrap
import unittest
import tempfile
from test.support import (captured_stdout, captured_stderr, requires_zlib,
can_symlink, EnvironmentVarGuard, rmtree)
-import threading
import unittest
import venv