✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python312/lib64/python3.12/test//test_regrtest.py
"""
Tests of regrtest.py.

Note: test_regrtest cannot be run twice in parallel.
"""

import contextlib
import dataclasses
import glob
import io
import locale
import os.path
import platform
import random
import re
import shlex
import signal
import subprocess
import sys
import sysconfig
import tempfile
import textwrap
import unittest
from xml.etree import ElementTree

from test import support
from test.support import os_helper
from test.libregrtest import cmdline
from test.libregrtest import main
from test.libregrtest import setup
from test.libregrtest import utils
from test.libregrtest.filter import get_match_tests, set_match_tests, match_test
from test.libregrtest.result import TestStats
from test.libregrtest.utils import normalize_test_name

if not support.has_subprocess_support:
    raise unittest.SkipTest("test module requires subprocess")

ROOT_DIR = os.path.join(os.path.dirname(__file__), '..', '..')
ROOT_DIR = os.path.abspath(os.path.normpath(ROOT_DIR))
LOG_PREFIX = r'[0-9]+:[0-9]+:[0-9]+ (?:load avg: [0-9]+\.[0-9]{2} )?'
RESULT_REGEX = (
    'passed',
    'failed',
    'skipped',
    'interrupted',
    'env changed',
    'timed out',
    'ran no tests',
    'worker non-zero exit code',
)
RESULT_REGEX = fr'(?:{"|".join(RESULT_REGEX)})'

EXITCODE_BAD_TEST = 2
EXITCODE_ENV_CHANGED = 3
EXITCODE_NO_TESTS_RAN = 4
EXITCODE_RERUN_FAIL = 5
EXITCODE_INTERRUPTED = 130

TEST_INTERRUPTED = textwrap.dedent("""
    from signal import SIGINT, raise_signal
    try:
        raise_signal(SIGINT)
    except ImportError:
        import os
        os.kill(os.getpid(), SIGINT)
    """)


class ParseArgsTestCase(unittest.TestCase):
    """
    Test regrtest's argument parsing, function _parse_args().
    """

    @staticmethod
    def parse_args(args):
        return cmdline._parse_args(args)

    def checkError(self, args, msg):
        with support.captured_stderr() as err, self.assertRaises(SystemExit):
            self.parse_args(args)
        self.assertIn(msg, err.getvalue())

    def test_help(self):
        for opt in '-h', '--help':
            with self.subTest(opt=opt):
                with support.captured_stdout() as out, \
                     self.assertRaises(SystemExit):
                    self.parse_args([opt])
                self.assertIn('Run Python regression tests.', out.getvalue())

    def test_timeout(self):
        ns = self.parse_args(['--timeout', '4.2'])
        self.assertEqual(ns.timeout, 4.2)

        # negative, zero and empty string are treated as "no timeout"
        for value in ('-1', '0', ''):
            with self.subTest(value=value):
                ns = self.parse_args([f'--timeout={value}'])
                self.assertEqual(ns.timeout, None)

        self.checkError(['--timeout'], 'expected one argument')
        self.checkError(['--timeout', 'foo'], 'invalid timeout value:')

    def test_wait(self):
        ns = self.parse_args(['--wait'])
        self.assertTrue(ns.wait)

    def test_start(self):
        for opt in '-S', '--start':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, 'foo'])
                self.assertEqual(ns.start, 'foo')
                self.checkError([opt], 'expected one argument')

    def test_verbose(self):
        ns = self.parse_args(['-v'])
        self.assertEqual(ns.verbose, 1)
        ns = self.parse_args(['-vvv'])
        self.assertEqual(ns.verbose, 3)
        ns = self.parse_args(['--verbose'])
        self.assertEqual(ns.verbose, 1)
        ns = self.parse_args(['--verbose'] * 3)
        self.assertEqual(ns.verbose, 3)
        ns = self.parse_args([])
        self.assertEqual(ns.verbose, 0)

    def test_rerun(self):
        for opt in '-w', '--rerun', '--verbose2':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.rerun)

    def test_verbose3(self):
        for opt in '-W', '--verbose3':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.verbose3)

    def test_quiet(self):
        for opt in '-q', '--quiet':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.quiet)
                self.assertEqual(ns.verbose, 0)

    def test_slowest(self):
        for opt in '-o', '--slowest':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.print_slow)

    def test_header(self):
        ns = self.parse_args(['--header'])
        self.assertTrue(ns.header)

        ns = self.parse_args(['--verbose'])
        self.assertTrue(ns.header)

    def test_randomize(self):
        for opt in ('-r', '--randomize'):
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.randomize)

        with os_helper.EnvironmentVarGuard() as env:
            # with SOURCE_DATE_EPOCH
            env['SOURCE_DATE_EPOCH'] = '1697839080'
            ns = self.parse_args(['--randomize'])
            regrtest = main.Regrtest(ns)
            self.assertFalse(regrtest.randomize)
            self.assertIsInstance(regrtest.random_seed, str)
            self.assertEqual(regrtest.random_seed, '1697839080')

            # without SOURCE_DATE_EPOCH
            del env['SOURCE_DATE_EPOCH']
            ns = self.parse_args(['--randomize'])
            regrtest = main.Regrtest(ns)
            self.assertTrue(regrtest.randomize)
            self.assertIsInstance(regrtest.random_seed, int)

    def test_randseed(self):
        ns = self.parse_args(['--randseed', '12345'])
        self.assertEqual(ns.random_seed, 12345)
        self.assertTrue(ns.randomize)
        self.checkError(['--randseed'], 'expected one argument')
        self.checkError(['--randseed', 'foo'], 'invalid int value')

    def test_fromfile(self):
        for opt in '-f', '--fromfile':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, 'foo'])
                self.assertEqual(ns.fromfile, 'foo')
                self.checkError([opt], 'expected one argument')
                self.checkError([opt, 'foo', '-s'], "don't go together")

    def test_exclude(self):
        for opt in '-x', '--exclude':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.exclude)

    def test_single(self):
        for opt in '-s', '--single':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.single)
                self.checkError([opt, '-f', 'foo'], "don't go together")

    def test_match(self):
        for opt in '-m', '--match':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, 'pattern'])
                self.assertEqual(ns.match_tests, [('pattern', True)])
                self.checkError([opt], 'expected one argument')

        for opt in '-i', '--ignore':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, 'pattern'])
                self.assertEqual(ns.match_tests, [('pattern', False)])
                self.checkError([opt], 'expected one argument')

        ns = self.parse_args(['-m', 'pattern1', '-m', 'pattern2'])
        self.assertEqual(ns.match_tests, [('pattern1', True), ('pattern2', True)])

        ns = self.parse_args(['-m', 'pattern1', '-i', 'pattern2'])
        self.assertEqual(ns.match_tests, [('pattern1', True), ('pattern2', False)])

        ns = self.parse_args(['-i', 'pattern1', '-m', 'pattern2'])
        self.assertEqual(ns.match_tests, [('pattern1', False), ('pattern2', True)])

        self.addCleanup(os_helper.unlink, os_helper.TESTFN)
        with open(os_helper.TESTFN, "w") as fp:
            print('matchfile1', file=fp)
            print('matchfile2', file=fp)

        filename = os.path.abspath(os_helper.TESTFN)
        ns = self.parse_args(['-m', 'match', '--matchfile', filename])
        self.assertEqual(ns.match_tests,
                         [('match', True), ('matchfile1', True), ('matchfile2', True)])

        ns = self.parse_args(['-i', 'match', '--ignorefile', filename])
        self.assertEqual(ns.match_tests,
                         [('match', False), ('matchfile1', False), ('matchfile2', False)])

    def test_failfast(self):
        for opt in '-G', '--failfast':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, '-v'])
                self.assertTrue(ns.failfast)
                ns = self.parse_args([opt, '-W'])
                self.assertTrue(ns.failfast)
                self.checkError([opt], '-G/--failfast needs either -v or -W')

    def test_use(self):
        for opt in '-u', '--use':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, 'gui,network'])
                self.assertEqual(ns.use_resources, ['gui', 'network'])

                ns = self.parse_args([opt, 'gui,none,network'])
                self.assertEqual(ns.use_resources, ['network'])

                expected = list(cmdline.ALL_RESOURCES)
                expected.remove('gui')
                ns = self.parse_args([opt, 'all,-gui'])
                self.assertEqual(ns.use_resources, expected)
                self.checkError([opt], 'expected one argument')
                self.checkError([opt, 'foo'], 'invalid resource')

                # all + a resource not part of "all"
                ns = self.parse_args([opt, 'all,tzdata'])
                self.assertEqual(ns.use_resources,
                                 list(cmdline.ALL_RESOURCES) + ['tzdata'])

                # test another resource which is not part of "all"
                ns = self.parse_args([opt, 'extralargefile'])
                self.assertEqual(ns.use_resources, ['extralargefile'])

    def test_memlimit(self):
        for opt in '-M', '--memlimit':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, '4G'])
                self.assertEqual(ns.memlimit, '4G')
                self.checkError([opt], 'expected one argument')

    def test_testdir(self):
        ns = self.parse_args(['--testdir', 'foo'])
        self.assertEqual(ns.testdir, os.path.join(os_helper.SAVEDCWD, 'foo'))
        self.checkError(['--testdir'], 'expected one argument')

    def test_runleaks(self):
        for opt in '-L', '--runleaks':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.runleaks)

    def test_huntrleaks(self):
        for opt in '-R', '--huntrleaks':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, ':'])
                self.assertEqual(ns.huntrleaks, (5, 4, 'reflog.txt'))
                ns = self.parse_args([opt, '6:'])
                self.assertEqual(ns.huntrleaks, (6, 4, 'reflog.txt'))
                ns = self.parse_args([opt, ':3'])
                self.assertEqual(ns.huntrleaks, (5, 3, 'reflog.txt'))
                ns = self.parse_args([opt, '6:3:leaks.log'])
                self.assertEqual(ns.huntrleaks, (6, 3, 'leaks.log'))
                self.checkError([opt], 'expected one argument')
                self.checkError([opt, '6'],
                                'needs 2 or 3 colon-separated arguments')
                self.checkError([opt, 'foo:'], 'invalid huntrleaks value')
                self.checkError([opt, '6:foo'], 'invalid huntrleaks value')

    def test_multiprocess(self):
        for opt in '-j', '--multiprocess':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, '2'])
                self.assertEqual(ns.use_mp, 2)
                self.checkError([opt], 'expected one argument')
                self.checkError([opt, 'foo'], 'invalid int value')
                self.checkError([opt, '2', '-T'], "don't go together")
                self.checkError([opt, '0', '-T'], "don't go together")

    def test_coverage(self):
        for opt in '-T', '--coverage':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.trace)

    def test_coverdir(self):
        for opt in '-D', '--coverdir':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, 'foo'])
                self.assertEqual(ns.coverdir,
                                 os.path.join(os_helper.SAVEDCWD, 'foo'))
                self.checkError([opt], 'expected one argument')

    def test_nocoverdir(self):
        for opt in '-N', '--nocoverdir':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertIsNone(ns.coverdir)

    def test_threshold(self):
        for opt in '-t', '--threshold':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt, '1000'])
                self.assertEqual(ns.threshold, 1000)
                self.checkError([opt], 'expected one argument')
                self.checkError([opt, 'foo'], 'invalid int value')

    def test_nowindows(self):
        for opt in '-n', '--nowindows':
            with self.subTest(opt=opt):
                with contextlib.redirect_stderr(io.StringIO()) as stderr:
                    ns = self.parse_args([opt])
                self.assertTrue(ns.nowindows)
                err = stderr.getvalue()
                self.assertIn('the --nowindows (-n) option is deprecated', err)

    def test_forever(self):
        for opt in '-F', '--forever':
            with self.subTest(opt=opt):
                ns = self.parse_args([opt])
                self.assertTrue(ns.forever)

    def test_unrecognized_argument(self):
        self.checkError(['--xxx'], 'usage:')

    def test_long_option__partial(self):
        ns = self.parse_args(['--qui'])
        self.assertTrue(ns.quiet)
        self.assertEqual(ns.verbose, 0)

    def test_two_options(self):
        ns = self.parse_args(['--quiet', '--exclude'])
        self.assertTrue(ns.quiet)
        self.assertEqual(ns.verbose, 0)
        self.assertTrue(ns.exclude)

    def test_option_with_empty_string_value(self):
        ns = self.parse_args(['--start', ''])
        self.assertEqual(ns.start, '')

    def test_arg(self):
        ns = self.parse_args(['foo'])
        self.assertEqual(ns.args, ['foo'])

    def test_option_and_arg(self):
        ns = self.parse_args(['--quiet', 'foo'])
        self.assertTrue(ns.quiet)
        self.assertEqual(ns.verbose, 0)
        self.assertEqual(ns.args, ['foo'])

    def test_arg_option_arg(self):
        ns = self.parse_args(['test_unaryop', '-v', 'test_binop'])
        self.assertEqual(ns.verbose, 1)
        self.assertEqual(ns.args, ['test_unaryop', 'test_binop'])

    def test_unknown_option(self):
        self.checkError(['--unknown-option'],
                        'unrecognized arguments: --unknown-option')

    def create_regrtest(self, args):
        ns = cmdline._parse_args(args)

        # Check Regrtest attributes which are more reliable than Namespace
        # which has an unclear API
        with os_helper.EnvironmentVarGuard() as env:
            # Ignore SOURCE_DATE_EPOCH env var if it's set
            del env['SOURCE_DATE_EPOCH']

            regrtest = main.Regrtest(ns)

        return regrtest

    def check_ci_mode(self, args, use_resources, rerun=True):
        regrtest = self.create_regrtest(args)
        self.assertEqual(regrtest.num_workers, -1)
        self.assertEqual(regrtest.want_rerun, rerun)
        self.assertTrue(regrtest.randomize)
        self.assertIsInstance(regrtest.random_seed, int)
        self.assertTrue(regrtest.fail_env_changed)
        self.assertTrue(regrtest.fail_rerun)
        self.assertTrue(regrtest.print_slowest)
        self.assertTrue(regrtest.output_on_failure)
        self.assertEqual(sorted(regrtest.use_resources), sorted(use_resources))
        return regrtest

    def test_fast_ci(self):
        args = ['--fast-ci']
        use_resources = sorted(cmdline.ALL_RESOURCES)
        use_resources.remove('cpu')
        regrtest = self.check_ci_mode(args, use_resources)
        self.assertEqual(regrtest.timeout, 10 * 60)

    def test_fast_ci_python_cmd(self):
        args = ['--fast-ci', '--python', 'python -X dev']
        use_resources = sorted(cmdline.ALL_RESOURCES)
        use_resources.remove('cpu')
        regrtest = self.check_ci_mode(args, use_resources, rerun=False)
        self.assertEqual(regrtest.timeout, 10 * 60)
        self.assertEqual(regrtest.python_cmd, ('python', '-X', 'dev'))

    def test_fast_ci_resource(self):
        # it should be possible to override resources individually
        args = ['--fast-ci', '-u-network']
        use_resources = sorted(cmdline.ALL_RESOURCES)
        use_resources.remove('cpu')
        use_resources.remove('network')
        self.check_ci_mode(args, use_resources)

    def test_slow_ci(self):
        args = ['--slow-ci']
        use_resources = sorted(cmdline.ALL_RESOURCES)
        regrtest = self.check_ci_mode(args, use_resources)
        self.assertEqual(regrtest.timeout, 20 * 60)

    def test_dont_add_python_opts(self):
        args = ['--dont-add-python-opts']
        ns = cmdline._parse_args(args)
        self.assertFalse(ns._add_python_opts)

    def test_bisect(self):
        args = ['--bisect']
        regrtest = self.create_regrtest(args)
        self.assertTrue(regrtest.want_bisect)

    def test_verbose3_huntrleaks(self):
        args = ['-R', '3:10', '--verbose3']
        with support.captured_stderr():
            regrtest = self.create_regrtest(args)
        self.assertIsNotNone(regrtest.hunt_refleak)
        self.assertEqual(regrtest.hunt_refleak.warmups, 3)
        self.assertEqual(regrtest.hunt_refleak.runs, 10)
        self.assertFalse(regrtest.output_on_failure)

    def test_single_process(self):
        args = ['-j2', '--single-process']
        with support.captured_stderr():
            regrtest = self.create_regrtest(args)
        self.assertEqual(regrtest.num_workers, 0)
        self.assertTrue(regrtest.single_process)

        args = ['--fast-ci', '--single-process']
        with support.captured_stderr():
            regrtest = self.create_regrtest(args)
        self.assertEqual(regrtest.num_workers, 0)
        self.assertTrue(regrtest.single_process)


@dataclasses.dataclass(slots=True)
class Rerun:
    name: str
    match: str | None
    success: bool


class BaseTestCase(unittest.TestCase):
    TEST_UNIQUE_ID = 1
    TESTNAME_PREFIX = 'test_regrtest_'
    TESTNAME_REGEX = r'test_[a-zA-Z0-9_]+'

    def setUp(self):
        self.testdir = os.path.realpath(os.path.dirname(__file__))

        self.tmptestdir = tempfile.mkdtemp()
        self.addCleanup(os_helper.rmtree, self.tmptestdir)

    def create_test(self, name=None, code=None):
        if not name:
            name = 'noop%s' % BaseTestCase.TEST_UNIQUE_ID
            BaseTestCase.TEST_UNIQUE_ID += 1

        if code is None:
            code = textwrap.dedent("""
                    import unittest

                    class Tests(unittest.TestCase):
                        def test_empty_test(self):
                            pass
                """)

        # test_regrtest cannot be run twice in parallel because
        # of setUp() and create_test()
        name = self.TESTNAME_PREFIX + name
        path = os.path.join(self.tmptestdir, name + '.py')

        self.addCleanup(os_helper.unlink, path)
        # Use 'x' mode to ensure that we do not override existing tests
        try:
            with open(path, 'x', encoding='utf-8') as fp:
                fp.write(code)
        except PermissionError as exc:
            if not sysconfig.is_python_build():
                self.skipTest("cannot write %s: %s" % (path, exc))
            raise
        return name

    def regex_search(self, regex, output):
        match = re.search(regex, output, re.MULTILINE)
        if not match:
            self.fail("%r not found in %r" % (regex, output))
        return match

    def check_line(self, output, pattern, full=False, regex=True):
        if not regex:
            pattern = re.escape(pattern)
        if full:
            pattern += '\n'
        regex = re.compile(r'^' + pattern, re.MULTILINE)
        self.assertRegex(output, regex)

    def parse_executed_tests(self, output):
        regex = (fr'^{LOG_PREFIX}\[ *[0-9]+(?:/ *[0-9]+)*\] '
                 fr'({self.TESTNAME_REGEX}) {RESULT_REGEX}')
        parser = re.finditer(regex, output, re.MULTILINE)
        return list(match.group(1) for match in parser)

    def check_executed_tests(self, output, tests, *, stats,
                             skipped=(), failed=(),
                             env_changed=(), omitted=(),
                             rerun=None, run_no_tests=(),
                             resource_denied=(),
                             randomize=False, parallel=False, interrupted=False,
                             fail_env_changed=False,
                             forever=False, filtered=False):
        if isinstance(tests, str):
            tests = [tests]
        if isinstance(skipped, str):
            skipped = [skipped]
        if isinstance(resource_denied, str):
            resource_denied = [resource_denied]
        if isinstance(failed, str):
            failed = [failed]
        if isinstance(env_changed, str):
            env_changed = [env_changed]
        if isinstance(omitted, str):
            omitted = [omitted]
        if isinstance(run_no_tests, str):
            run_no_tests = [run_no_tests]
        if isinstance(stats, int):
            stats = TestStats(stats)
        if parallel:
            randomize = True

        rerun_failed = []
        if rerun is not None and not env_changed:
            failed = [rerun.name]
            if not rerun.success:
                rerun_failed.append(rerun.name)

        executed = self.parse_executed_tests(output)
        total_tests = list(tests)
        if rerun is not None:
            total_tests.append(rerun.name)
        if randomize:
            self.assertEqual(set(executed), set(total_tests), output)
        else:
            self.assertEqual(executed, total_tests, output)

        def plural(count):
            return 's' if count != 1 else ''

        def list_regex(line_format, tests):
            count = len(tests)
            names = ' '.join(sorted(tests))
            regex = line_format % (count, plural(count))
            regex = r'%s:\n    %s$' % (regex, names)
            return regex

        if skipped:
            regex = list_regex('%s test%s skipped', skipped)
            self.check_line(output, regex)

        if resource_denied:
            regex = list_regex(r'%s test%s skipped \(resource denied\)', resource_denied)
            self.check_line(output, regex)

        if failed:
            regex = list_regex('%s test%s failed', failed)
            self.check_line(output, regex)

        if env_changed:
            regex = list_regex(r'%s test%s altered the execution environment '
                               r'\(env changed\)',
                               env_changed)
            self.check_line(output, regex)

        if omitted:
            regex = list_regex('%s test%s omitted', omitted)
            self.check_line(output, regex)

        if rerun is not None:
            regex = list_regex('%s re-run test%s', [rerun.name])
            self.check_line(output, regex)
            regex = LOG_PREFIX + r"Re-running 1 failed tests in verbose mode"
            self.check_line(output, regex)
            regex = fr"Re-running {rerun.name} in verbose mode"
            if rerun.match:
                regex = fr"{regex} \(matching: {rerun.match}\)"
            self.check_line(output, regex)

        if run_no_tests:
            regex = list_regex('%s test%s run no tests', run_no_tests)
            self.check_line(output, regex)

        good = (len(tests) - len(skipped) - len(resource_denied) - len(failed)
                - len(omitted) - len(env_changed) - len(run_no_tests))
        if good:
            regex = r'%s test%s OK\.' % (good, plural(good))
            if not skipped and not failed and (rerun is None or rerun.success) and good > 1:
                regex = 'All %s' % regex
            self.check_line(output, regex, full=True)

        if interrupted:
            self.check_line(output, 'Test suite interrupted by signal SIGINT.')

        # Total tests
        text = f'run={stats.tests_run:,}'
        if filtered:
            text = fr'{text} \(filtered\)'
        parts = [text]
        if stats.failures:
            parts.append(f'failures={stats.failures:,}')
        if stats.skipped:
            parts.append(f'skipped={stats.skipped:,}')
        line = fr'Total tests: {" ".join(parts)}'
        self.check_line(output, line, full=True)

        # Total test files
        run = len(total_tests) - len(resource_denied)
        if rerun is not None:
            total_failed = len(rerun_failed)
            total_rerun = 1
        else:
            total_failed = len(failed)
            total_rerun = 0
        if interrupted:
            run = 0
        text = f'run={run}'
        if not forever:
            text = f'{text}/{len(tests)}'
        if filtered:
            text = fr'{text} \(filtered\)'
        report = [text]
        for name, ntest in (
            ('failed', total_failed),
            ('env_changed', len(env_changed)),
            ('skipped', len(skipped)),
            ('resource_denied', len(resource_denied)),
            ('rerun', total_rerun),
            ('run_no_tests', len(run_no_tests)),
        ):
            if ntest:
                report.append(f'{name}={ntest}')
        line = fr'Total test files: {" ".join(report)}'
        self.check_line(output, line, full=True)

        # Result
        state = []
        if failed:
            state.append('FAILURE')
        elif fail_env_changed and env_changed:
            state.append('ENV CHANGED')
        if interrupted:
            state.append('INTERRUPTED')
        if not any((good, failed, interrupted, skipped,
                    env_changed, fail_env_changed)):
            state.append("NO TESTS RAN")
        elif not state:
            state.append('SUCCESS')
        state = ', '.join(state)
        if rerun is not None:
            new_state = 'SUCCESS' if rerun.success else 'FAILURE'
            state = f'{state} then {new_state}'
        self.check_line(output, f'Result: {state}', full=True)

    def parse_random_seed(self, output: str) -> str:
        match = self.regex_search(r'Using random seed: (.*)', output)
        return match.group(1)

    def run_command(self, args, input=None, exitcode=0, **kw):
        if not input:
            input = ''
        if 'stderr' not in kw:
            kw['stderr'] = subprocess.STDOUT

        env = kw.pop('env', None)
        if env is None:
            env = dict(os.environ)
            env.pop('SOURCE_DATE_EPOCH', None)

        proc = subprocess.run(args,
                              text=True,
                              input=input,
                              stdout=subprocess.PIPE,
                              env=env,
                              **kw)
        if proc.returncode != exitcode:
            msg = ("Command %s failed with exit code %s, but exit code %s expected!\n"
                   "\n"
                   "stdout:\n"
                   "---\n"
                   "%s\n"
                   "---\n"
                   % (str(args), proc.returncode, exitcode, proc.stdout))
            if proc.stderr:
                msg += ("\n"
                        "stderr:\n"
                        "---\n"
                        "%s"
                        "---\n"
                        % proc.stderr)
            self.fail(msg)
        return proc

    def run_python(self, args, **kw):
        extraargs = []
        if 'uops' in sys._xoptions:
            # Pass -X uops along
            extraargs.extend(['-X', 'uops'])
        args = [sys.executable, *extraargs, '-X', 'faulthandler', '-I', *args]
        proc = self.run_command(args, **kw)
        return proc.stdout


class CheckActualTests(BaseTestCase):
    def test_finds_expected_number_of_tests(self):
        """
        Check that regrtest appears to find the expected set of tests.
        """
        args = ['-Wd', '-E', '-bb', '-m', 'test.regrtest', '--list-tests']
        output = self.run_python(args)
        rough_number_of_tests_found = len(output.splitlines())
        actual_testsuite_glob = os.path.join(glob.escape(os.path.dirname(__file__)),
                                             'test*.py')
        rough_counted_test_py_files = len(glob.glob(actual_testsuite_glob))
        # We're not trying to duplicate test finding logic in here,
        # just give a rough estimate of how many there should be and
        # be near that.  This is a regression test to prevent mishaps
        # such as https://bugs.python.org/issue37667 in the future.
        # If you need to change the values in here during some
        # mythical future test suite reorganization, don't go
        # overboard with logic and keep that goal in mind.
        self.assertGreater(rough_number_of_tests_found,
                           rough_counted_test_py_files*9//10,
                           msg='Unexpectedly low number of tests found in:\n'
                           f'{", ".join(output.splitlines())}')


class ProgramsTestCase(BaseTestCase):
    """
    Test various ways to run the Python test suite. Use options close
    to options used on the buildbot.
    """

    NTEST = 4

    def setUp(self):
        super().setUp()

        # Create NTEST tests doing nothing
        self.tests = [self.create_test() for index in range(self.NTEST)]

        self.python_args = ['-Wd', '-E', '-bb']
        self.regrtest_args = ['-uall', '-rwW',
                              '--testdir=%s' % self.tmptestdir]
        self.regrtest_args.extend(('--timeout', '3600', '-j4'))
        if sys.platform == 'win32':
            self.regrtest_args.append('-n')

    def check_output(self, output):
        randseed = self.parse_random_seed(output)
        self.assertTrue(randseed.isdigit(), randseed)

        self.check_executed_tests(output, self.tests,
                                  randomize=True, stats=len(self.tests))

    def run_tests(self, args, env=None):
        output = self.run_python(args, env=env)
        self.check_output(output)

    def test_script_regrtest(self):
        # Lib/test/regrtest.py
        script = os.path.join(self.testdir, 'regrtest.py')

        args = [*self.python_args, script, *self.regrtest_args, *self.tests]
        self.run_tests(args)

    def test_module_test(self):
        # -m test
        args = [*self.python_args, '-m', 'test',
                *self.regrtest_args, *self.tests]
        self.run_tests(args)

    def test_module_regrtest(self):
        # -m test.regrtest
        args = [*self.python_args, '-m', 'test.regrtest',
                *self.regrtest_args, *self.tests]
        self.run_tests(args)

    def test_module_autotest(self):
        # -m test.autotest
        args = [*self.python_args, '-m', 'test.autotest',
                *self.regrtest_args, *self.tests]
        self.run_tests(args)

    def test_module_from_test_autotest(self):
        # from test import autotest
        code = 'from test import autotest'
        args = [*self.python_args, '-c', code,
                *self.regrtest_args, *self.tests]
        self.run_tests(args)

    def test_script_autotest(self):
        # Lib/test/autotest.py
        script = os.path.join(self.testdir, 'autotest.py')
        args = [*self.python_args, script, *self.regrtest_args, *self.tests]
        self.run_tests(args)

    def run_batch(self, *args):
        proc = self.run_command(args)
        self.check_output(proc.stdout)

    @unittest.skipUnless(sysconfig.is_python_build(),
                         'test.bat script is not installed')
    @unittest.skipUnless(sys.platform == 'win32', 'Windows only')
    def test_tools_buildbot_test(self):
        # Tools\buildbot\test.bat
        script = os.path.join(ROOT_DIR, 'Tools', 'buildbot', 'test.bat')
        test_args = ['--testdir=%s' % self.tmptestdir]
        if platform.machine() == 'ARM64':
            test_args.append('-arm64') # ARM 64-bit build
        elif platform.machine() == 'ARM':
            test_args.append('-arm32')   # 32-bit ARM build
        elif platform.architecture()[0] == '64bit':
            test_args.append('-x64')   # 64-bit build
        if not support.Py_DEBUG:
            test_args.append('+d')     # Release build, use python.exe
        self.run_batch(script, *test_args, *self.tests)

    @unittest.skipUnless(sys.platform == 'win32', 'Windows only')
    def test_pcbuild_rt(self):
        # PCbuild\rt.bat
        script = os.path.join(ROOT_DIR, r'PCbuild\rt.bat')
        if not os.path.isfile(script):
            self.skipTest(f'File "{script}" does not exist')
        rt_args = ["-q"]             # Quick, don't run tests twice
        if platform.machine() == 'ARM64':
            rt_args.append('-arm64') # ARM 64-bit build
        elif platform.machine() == 'ARM':
            rt_args.append('-arm32')   # 32-bit ARM build
        elif platform.architecture()[0] == '64bit':
            rt_args.append('-x64')   # 64-bit build
        if support.Py_DEBUG:
            rt_args.append('-d')     # Debug build, use python_d.exe
        self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests)


class ArgsTestCase(BaseTestCase):
    """
    Test arguments of the Python test suite.
    """

    def run_tests(self, *testargs, **kw):
        cmdargs = ['-m', 'test', '--testdir=%s' % self.tmptestdir, *testargs]
        return self.run_python(cmdargs, **kw)

    def test_success(self):
        code = textwrap.dedent("""
            import unittest

            class PassingTests(unittest.TestCase):
                def test_test1(self):
                    pass

                def test_test2(self):
                    pass

                def test_test3(self):
                    pass
        """)
        tests = [self.create_test(f'ok{i}', code=code) for i in range(1, 6)]

        output = self.run_tests(*tests)
        self.check_executed_tests(output, tests,
                                  stats=3 * len(tests))

    def test_skip(self):
        code = textwrap.dedent("""
            import unittest
            raise unittest.SkipTest("nope")
        """)
        test_ok = self.create_test('ok')
        test_skip = self.create_test('skip', code=code)
        tests = [test_ok, test_skip]

        output = self.run_tests(*tests)
        self.check_executed_tests(output, tests,
                                  skipped=[test_skip],
                                  stats=1)

    def test_failing_test(self):
        # test a failing test
        code = textwrap.dedent("""
            import unittest

            class FailingTest(unittest.TestCase):
                def test_failing(self):
                    self.fail("bug")
        """)
        test_ok = self.create_test('ok')
        test_failing = self.create_test('failing', code=code)
        tests = [test_ok, test_failing]

        output = self.run_tests(*tests, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, tests, failed=test_failing,
                                  stats=TestStats(2, 1))

    def test_resources(self):
        # test -u command line option
        tests = {}
        for resource in ('audio', 'network'):
            code = textwrap.dedent("""
                        from test import support; support.requires(%r)
                        import unittest
                        class PassingTest(unittest.TestCase):
                            def test_pass(self):
                                pass
                    """ % resource)

            tests[resource] = self.create_test(resource, code)
        test_names = sorted(tests.values())

        # -u all: 2 resources enabled
        output = self.run_tests('-u', 'all', *test_names)
        self.check_executed_tests(output, test_names, stats=2)

        # -u audio: 1 resource enabled
        output = self.run_tests('-uaudio', *test_names)
        self.check_executed_tests(output, test_names,
                                  resource_denied=tests['network'],
                                  stats=1)

        # no option: 0 resources enabled
        output = self.run_tests(*test_names, exitcode=EXITCODE_NO_TESTS_RAN)
        self.check_executed_tests(output, test_names,
                                  resource_denied=test_names,
                                  stats=0)

    def test_random(self):
        # test -r and --randseed command line option
        code = textwrap.dedent("""
            import random
            print("TESTRANDOM: %s" % random.randint(1, 1000))
        """)
        test = self.create_test('random', code)

        # first run to get the output with the random seed
        output = self.run_tests('-r', test, exitcode=EXITCODE_NO_TESTS_RAN)
        randseed = self.parse_random_seed(output)
        match = self.regex_search(r'TESTRANDOM: ([0-9]+)', output)
        test_random = int(match.group(1))

        # try to reproduce with the random seed
        output = self.run_tests('-r', f'--randseed={randseed}', test,
                                exitcode=EXITCODE_NO_TESTS_RAN)
        randseed2 = self.parse_random_seed(output)
        self.assertEqual(randseed2, randseed)

        match = self.regex_search(r'TESTRANDOM: ([0-9]+)', output)
        test_random2 = int(match.group(1))
        self.assertEqual(test_random2, test_random)

        # check that random.seed is used by default
        output = self.run_tests(test, exitcode=EXITCODE_NO_TESTS_RAN)
        randseed = self.parse_random_seed(output)
        self.assertTrue(randseed.isdigit(), randseed)

        # check SOURCE_DATE_EPOCH (integer)
        timestamp = '1697839080'
        env = dict(os.environ, SOURCE_DATE_EPOCH=timestamp)
        output = self.run_tests('-r', test, exitcode=EXITCODE_NO_TESTS_RAN,
                                env=env)
        randseed = self.parse_random_seed(output)
        self.assertEqual(randseed, timestamp)
        self.check_line(output, 'TESTRANDOM: 520')

        # check SOURCE_DATE_EPOCH (string)
        env = dict(os.environ, SOURCE_DATE_EPOCH='XYZ')
        output = self.run_tests('-r', test, exitcode=EXITCODE_NO_TESTS_RAN,
                                env=env)
        randseed = self.parse_random_seed(output)
        self.assertEqual(randseed, 'XYZ')
        self.check_line(output, 'TESTRANDOM: 22')

        # check SOURCE_DATE_EPOCH (empty string): ignore the env var
        env = dict(os.environ, SOURCE_DATE_EPOCH='')
        output = self.run_tests('-r', test, exitcode=EXITCODE_NO_TESTS_RAN,
                                env=env)
        randseed = self.parse_random_seed(output)
        self.assertTrue(randseed.isdigit(), randseed)

    def test_fromfile(self):
        # test --fromfile
        tests = [self.create_test() for index in range(5)]

        # Write the list of files using a format similar to regrtest output:
        # [1/2] test_1
        # [2/2] test_2
        filename = os_helper.TESTFN
        self.addCleanup(os_helper.unlink, filename)

        # test format '0:00:00 [2/7] test_opcodes -- test_grammar took 0 sec'
        with open(filename, "w") as fp:
            previous = None
            for index, name in enumerate(tests, 1):
                line = ("00:00:%02i [%s/%s] %s"
                        % (index, index, len(tests), name))
                if previous:
                    line += " -- %s took 0 sec" % previous
                print(line, file=fp)
                previous = name

        output = self.run_tests('--fromfile', filename)
        stats = len(tests)
        self.check_executed_tests(output, tests, stats=stats)

        # test format '[2/7] test_opcodes'
        with open(filename, "w") as fp:
            for index, name in enumerate(tests, 1):
                print("[%s/%s] %s" % (index, len(tests), name), file=fp)

        output = self.run_tests('--fromfile', filename)
        self.check_executed_tests(output, tests, stats=stats)

        # test format 'test_opcodes'
        with open(filename, "w") as fp:
            for name in tests:
                print(name, file=fp)

        output = self.run_tests('--fromfile', filename)
        self.check_executed_tests(output, tests, stats=stats)

        # test format 'Lib/test/test_opcodes.py'
        with open(filename, "w") as fp:
            for name in tests:
                print('Lib/test/%s.py' % name, file=fp)

        output = self.run_tests('--fromfile', filename)
        self.check_executed_tests(output, tests, stats=stats)

    def test_interrupted(self):
        code = TEST_INTERRUPTED
        test = self.create_test('sigint', code=code)
        output = self.run_tests(test, exitcode=EXITCODE_INTERRUPTED)
        self.check_executed_tests(output, test, omitted=test,
                                  interrupted=True, stats=0)

    def test_slowest(self):
        # test --slowest
        tests = [self.create_test() for index in range(3)]
        output = self.run_tests("--slowest", *tests)
        self.check_executed_tests(output, tests, stats=len(tests))
        regex = ('10 slowest tests:\n'
                 '(?:- %s: .*\n){%s}'
                 % (self.TESTNAME_REGEX, len(tests)))
        self.check_line(output, regex)

    def test_slowest_interrupted(self):
        # Issue #25373: test --slowest with an interrupted test
        code = TEST_INTERRUPTED
        test = self.create_test("sigint", code=code)

        for multiprocessing in (False, True):
            with self.subTest(multiprocessing=multiprocessing):
                if multiprocessing:
                    args = ("--slowest", "-j2", test)
                else:
                    args = ("--slowest", test)
                output = self.run_tests(*args, exitcode=EXITCODE_INTERRUPTED)
                self.check_executed_tests(output, test,
                                          omitted=test, interrupted=True,
                                          stats=0)

                regex = ('10 slowest tests:\n')
                self.check_line(output, regex)

    def test_coverage(self):
        # test --coverage
        test = self.create_test('coverage')
        output = self.run_tests("--coverage", test)
        self.check_executed_tests(output, [test], stats=1)
        regex = (r'lines +cov% +module +\(path\)\n'
                 r'(?: *[0-9]+ *[0-9]{1,2}% *[^ ]+ +\([^)]+\)+)+')
        self.check_line(output, regex)

    def test_wait(self):
        # test --wait
        test = self.create_test('wait')
        output = self.run_tests("--wait", test, input='key')
        self.check_line(output, 'Press any key to continue')

    def test_forever(self):
        # test --forever
        code = textwrap.dedent("""
            import builtins
            import unittest

            class ForeverTester(unittest.TestCase):
                def test_run(self):
                    # Store the state in the builtins module, because the test
                    # module is reload at each run
                    if 'RUN' in builtins.__dict__:
                        builtins.__dict__['RUN'] += 1
                        if builtins.__dict__['RUN'] >= 3:
                            self.fail("fail at the 3rd runs")
                    else:
                        builtins.__dict__['RUN'] = 1
        """)
        test = self.create_test('forever', code=code)

        # --forever
        output = self.run_tests('--forever', test, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, [test]*3, failed=test,
                                  stats=TestStats(3, 1),
                                  forever=True)

        # --forever --rerun
        output = self.run_tests('--forever', '--rerun', test, exitcode=0)
        self.check_executed_tests(output, [test]*3,
                                  rerun=Rerun(test,
                                              match='test_run',
                                              success=True),
                                  stats=TestStats(4, 1),
                                  forever=True)

    def check_leak(self, code, what, *, run_workers=False):
        test = self.create_test('huntrleaks', code=code)

        filename = 'reflog.txt'
        self.addCleanup(os_helper.unlink, filename)
        cmd = ['--huntrleaks', '3:3:']
        if run_workers:
            cmd.append('-j1')
        cmd.append(test)
        output = self.run_tests(*cmd,
                                exitcode=EXITCODE_BAD_TEST,
                                stderr=subprocess.STDOUT)
        self.check_executed_tests(output, [test], failed=test, stats=1)

        line = r'beginning 6 repetitions. .*\n123:456\n[.0-9X]{3} 111\n'
        self.check_line(output, line)

        line2 = '%s leaked [1, 1, 1] %s, sum=3\n' % (test, what)
        self.assertIn(line2, output)

        with open(filename) as fp:
            reflog = fp.read()
            self.assertIn(line2, reflog)

    @unittest.skipUnless(support.Py_DEBUG, 'need a debug build')
    def check_huntrleaks(self, *, run_workers: bool):
        # test --huntrleaks
        code = textwrap.dedent("""
            import unittest

            GLOBAL_LIST = []

            class RefLeakTest(unittest.TestCase):
                def test_leak(self):
                    GLOBAL_LIST.append(object())
        """)
        self.check_leak(code, 'references', run_workers=run_workers)

    def test_huntrleaks(self):
        self.check_huntrleaks(run_workers=False)

    def test_huntrleaks_mp(self):
        self.check_huntrleaks(run_workers=True)

    @unittest.skipUnless(support.Py_DEBUG, 'need a debug build')
    def test_huntrleaks_bisect(self):
        # test --huntrleaks --bisect
        code = textwrap.dedent("""
            import unittest

            GLOBAL_LIST = []

            class RefLeakTest(unittest.TestCase):
                def test1(self):
                    pass

                def test2(self):
                    pass

                def test3(self):
                    GLOBAL_LIST.append(object())

                def test4(self):
                    pass
        """)

        test = self.create_test('huntrleaks', code=code)

        filename = 'reflog.txt'
        self.addCleanup(os_helper.unlink, filename)
        cmd = ['--huntrleaks', '3:3:', '--bisect', test]
        output = self.run_tests(*cmd,
                                exitcode=EXITCODE_BAD_TEST,
                                stderr=subprocess.STDOUT)

        self.assertIn(f"Bisect {test}", output)
        self.assertIn(f"Bisect {test}: exit code 0", output)

        # test3 is the one which leaks
        self.assertIn("Bisection completed in", output)
        self.assertIn(
            "Tests (1):\n"
            f"* {test}.RefLeakTest.test3\n",
            output)

    @unittest.skipUnless(support.Py_DEBUG, 'need a debug build')
    def test_huntrleaks_fd_leak(self):
        # test --huntrleaks for file descriptor leak
        code = textwrap.dedent("""
            import os
            import unittest

            class FDLeakTest(unittest.TestCase):
                def test_leak(self):
                    fd = os.open(__file__, os.O_RDONLY)
                    # bug: never close the file descriptor
        """)
        self.check_leak(code, 'file descriptors')

    def test_list_tests(self):
        # test --list-tests
        tests = [self.create_test() for i in range(5)]
        output = self.run_tests('--list-tests', *tests)
        self.assertEqual(output.rstrip().splitlines(),
                         tests)

    def test_list_cases(self):
        # test --list-cases
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_method1(self):
                    pass
                def test_method2(self):
                    pass
        """)
        testname = self.create_test(code=code)

        # Test --list-cases
        all_methods = ['%s.Tests.test_method1' % testname,
                       '%s.Tests.test_method2' % testname]
        output = self.run_tests('--list-cases', testname)
        self.assertEqual(output.splitlines(), all_methods)

        # Test --list-cases with --match
        all_methods = ['%s.Tests.test_method1' % testname]
        output = self.run_tests('--list-cases',
                                '-m', 'test_method1',
                                testname)
        self.assertEqual(output.splitlines(), all_methods)

    @support.cpython_only
    def test_crashed(self):
        # Any code which causes a crash
        code = 'import faulthandler; faulthandler._sigsegv()'
        crash_test = self.create_test(name="crash", code=code)

        tests = [crash_test]
        output = self.run_tests("-j2", *tests, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, tests, failed=crash_test,
                                  parallel=True, stats=0)

    def parse_methods(self, output):
        regex = re.compile("^(test[^ ]+).*ok$", flags=re.MULTILINE)
        return [match.group(1) for match in regex.finditer(output)]

    def test_ignorefile(self):
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_method1(self):
                    pass
                def test_method2(self):
                    pass
                def test_method3(self):
                    pass
                def test_method4(self):
                    pass
        """)
        testname = self.create_test(code=code)

        # only run a subset
        filename = os_helper.TESTFN
        self.addCleanup(os_helper.unlink, filename)

        subset = [
            # only ignore the method name
            'test_method1',
            # ignore the full identifier
            '%s.Tests.test_method3' % testname]
        with open(filename, "w") as fp:
            for name in subset:
                print(name, file=fp)

        output = self.run_tests("-v", "--ignorefile", filename, testname)
        methods = self.parse_methods(output)
        subset = ['test_method2', 'test_method4']
        self.assertEqual(methods, subset)

    def test_matchfile(self):
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_method1(self):
                    pass
                def test_method2(self):
                    pass
                def test_method3(self):
                    pass
                def test_method4(self):
                    pass
        """)
        all_methods = ['test_method1', 'test_method2',
                       'test_method3', 'test_method4']
        testname = self.create_test(code=code)

        # by default, all methods should be run
        output = self.run_tests("-v", testname)
        methods = self.parse_methods(output)
        self.assertEqual(methods, all_methods)

        # only run a subset
        filename = os_helper.TESTFN
        self.addCleanup(os_helper.unlink, filename)

        subset = [
            # only match the method name
            'test_method1',
            # match the full identifier
            '%s.Tests.test_method3' % testname]
        with open(filename, "w") as fp:
            for name in subset:
                print(name, file=fp)

        output = self.run_tests("-v", "--matchfile", filename, testname)
        methods = self.parse_methods(output)
        subset = ['test_method1', 'test_method3']
        self.assertEqual(methods, subset)

    def test_env_changed(self):
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_env_changed(self):
                    open("env_changed", "w").close()
        """)
        testname = self.create_test(code=code)

        # don't fail by default
        output = self.run_tests(testname)
        self.check_executed_tests(output, [testname],
                                  env_changed=testname, stats=1)

        # fail with --fail-env-changed
        output = self.run_tests("--fail-env-changed", testname,
                                exitcode=EXITCODE_ENV_CHANGED)
        self.check_executed_tests(output, [testname], env_changed=testname,
                                  fail_env_changed=True, stats=1)

        # rerun
        output = self.run_tests("--rerun", testname)
        self.check_executed_tests(output, [testname],
                                  env_changed=testname,
                                  rerun=Rerun(testname,
                                              match=None,
                                              success=True),
                                  stats=2)

    def test_rerun_fail(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_succeed(self):
                    return

                def test_fail_always(self):
                    # test that always fails
                    self.fail("bug")
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, [testname],
                                  rerun=Rerun(testname,
                                              "test_fail_always",
                                              success=False),
                                  stats=TestStats(3, 2))

    def test_rerun_success(self):
        # FAILURE then SUCCESS
        marker_filename = os.path.abspath("regrtest_marker_filename")
        self.addCleanup(os_helper.unlink, marker_filename)
        self.assertFalse(os.path.exists(marker_filename))

        code = textwrap.dedent(f"""
            import os.path
            import unittest

            marker_filename = {marker_filename!r}

            class Tests(unittest.TestCase):
                def test_succeed(self):
                    return

                def test_fail_once(self):
                    if not os.path.exists(marker_filename):
                        open(marker_filename, "w").close()
                        self.fail("bug")
        """)
        testname = self.create_test(code=code)

        # FAILURE then SUCCESS => exit code 0
        output = self.run_tests("--rerun", testname, exitcode=0)
        self.check_executed_tests(output, [testname],
                                  rerun=Rerun(testname,
                                              match="test_fail_once",
                                              success=True),
                                  stats=TestStats(3, 1))
        os_helper.unlink(marker_filename)

        # with --fail-rerun, exit code EXITCODE_RERUN_FAIL
        # on "FAILURE then SUCCESS" state.
        output = self.run_tests("--rerun", "--fail-rerun", testname,
                                exitcode=EXITCODE_RERUN_FAIL)
        self.check_executed_tests(output, [testname],
                                  rerun=Rerun(testname,
                                              match="test_fail_once",
                                              success=True),
                                  stats=TestStats(3, 1))
        os_helper.unlink(marker_filename)

    def test_rerun_setup_class_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            class ExampleTests(unittest.TestCase):
                @classmethod
                def setUpClass(self):
                    raise RuntimeError('Fail')

                def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  failed=[testname],
                                  rerun=Rerun(testname,
                                              match="ExampleTests",
                                              success=False),
                                  stats=0)

    def test_rerun_teardown_class_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            class ExampleTests(unittest.TestCase):
                @classmethod
                def tearDownClass(self):
                    raise RuntimeError('Fail')

                def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  failed=[testname],
                                  rerun=Rerun(testname,
                                              match="ExampleTests",
                                              success=False),
                                  stats=2)

    def test_rerun_setup_module_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            def setUpModule():
                raise RuntimeError('Fail')

            class ExampleTests(unittest.TestCase):
                def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  failed=[testname],
                                  rerun=Rerun(testname,
                                              match=None,
                                              success=False),
                                  stats=0)

    def test_rerun_teardown_module_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            def tearDownModule():
                raise RuntimeError('Fail')

            class ExampleTests(unittest.TestCase):
                def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, [testname],
                                  failed=[testname],
                                  rerun=Rerun(testname,
                                              match=None,
                                              success=False),
                                  stats=2)

    def test_rerun_setup_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            class ExampleTests(unittest.TestCase):
                def setUp(self):
                    raise RuntimeError('Fail')

                def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  failed=[testname],
                                  rerun=Rerun(testname,
                                              match="test_success",
                                              success=False),
                                  stats=2)

    def test_rerun_teardown_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            class ExampleTests(unittest.TestCase):
                def tearDown(self):
                    raise RuntimeError('Fail')

                def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  failed=[testname],
                                  rerun=Rerun(testname,
                                              match="test_success",
                                              success=False),
                                  stats=2)

    def test_rerun_async_setup_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            class ExampleTests(unittest.IsolatedAsyncioTestCase):
                async def asyncSetUp(self):
                    raise RuntimeError('Fail')

                async def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  rerun=Rerun(testname,
                                              match="test_success",
                                              success=False),
                                  stats=2)

    def test_rerun_async_teardown_hook_failure(self):
        # FAILURE then FAILURE
        code = textwrap.dedent("""
            import unittest

            class ExampleTests(unittest.IsolatedAsyncioTestCase):
                async def asyncTearDown(self):
                    raise RuntimeError('Fail')

                async def test_success(self):
                    return
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  failed=[testname],
                                  rerun=Rerun(testname,
                                              match="test_success",
                                              success=False),
                                  stats=2)

    def test_no_tests_ran(self):
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_bug(self):
                    pass
        """)
        testname = self.create_test(code=code)

        output = self.run_tests(testname, "-m", "nosuchtest",
                                exitcode=EXITCODE_NO_TESTS_RAN)
        self.check_executed_tests(output, [testname],
                                  run_no_tests=testname,
                                  stats=0, filtered=True)

    def test_no_tests_ran_skip(self):
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_skipped(self):
                    self.skipTest("because")
        """)
        testname = self.create_test(code=code)

        output = self.run_tests(testname)
        self.check_executed_tests(output, [testname],
                                  stats=TestStats(1, skipped=1))

    def test_no_tests_ran_multiple_tests_nonexistent(self):
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_bug(self):
                    pass
        """)
        testname = self.create_test(code=code)
        testname2 = self.create_test(code=code)

        output = self.run_tests(testname, testname2, "-m", "nosuchtest",
                                exitcode=EXITCODE_NO_TESTS_RAN)
        self.check_executed_tests(output, [testname, testname2],
                                  run_no_tests=[testname, testname2],
                                  stats=0, filtered=True)

    def test_no_test_ran_some_test_exist_some_not(self):
        code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_bug(self):
                    pass
        """)
        testname = self.create_test(code=code)
        other_code = textwrap.dedent("""
            import unittest

            class Tests(unittest.TestCase):
                def test_other_bug(self):
                    pass
        """)
        testname2 = self.create_test(code=other_code)

        output = self.run_tests(testname, testname2, "-m", "nosuchtest",
                                "-m", "test_other_bug", exitcode=0)
        self.check_executed_tests(output, [testname, testname2],
                                  run_no_tests=[testname],
                                  stats=1, filtered=True)

    @support.cpython_only
    def test_uncollectable(self):
        code = textwrap.dedent(r"""
            import _testcapi
            import gc
            import unittest

            @_testcapi.with_tp_del
            class Garbage:
                def __tp_del__(self):
                    pass

            class Tests(unittest.TestCase):
                def test_garbage(self):
                    # create an uncollectable object
                    obj = Garbage()
                    obj.ref_cycle = obj
                    obj = None
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--fail-env-changed", testname,
                                exitcode=EXITCODE_ENV_CHANGED)
        self.check_executed_tests(output, [testname],
                                  env_changed=[testname],
                                  fail_env_changed=True,
                                  stats=1)

    def test_multiprocessing_timeout(self):
        code = textwrap.dedent(r"""
            import time
            import unittest
            try:
                import faulthandler
            except ImportError:
                faulthandler = None

            class Tests(unittest.TestCase):
                # test hangs and so should be stopped by the timeout
                def test_sleep(self):
                    # we want to test regrtest multiprocessing timeout,
                    # not faulthandler timeout
                    if faulthandler is not None:
                        faulthandler.cancel_dump_traceback_later()

                    time.sleep(60 * 5)
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("-j2", "--timeout=1.0", testname,
                                exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, [testname],
                                  failed=testname, stats=0)
        self.assertRegex(output,
                         re.compile('%s timed out' % testname, re.MULTILINE))

    def test_unraisable_exc(self):
        # --fail-env-changed must catch unraisable exception.
        # The exception must be displayed even if sys.stderr is redirected.
        code = textwrap.dedent(r"""
            import unittest
            import weakref
            from test.support import captured_stderr

            class MyObject:
                pass

            def weakref_callback(obj):
                raise Exception("weakref callback bug")

            class Tests(unittest.TestCase):
                def test_unraisable_exc(self):
                    obj = MyObject()
                    ref = weakref.ref(obj, weakref_callback)
                    with captured_stderr() as stderr:
                        # call weakref_callback() which logs
                        # an unraisable exception
                        obj = None
                    self.assertEqual(stderr.getvalue(), '')
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--fail-env-changed", "-v", testname,
                                exitcode=EXITCODE_ENV_CHANGED)
        self.check_executed_tests(output, [testname],
                                  env_changed=[testname],
                                  fail_env_changed=True,
                                  stats=1)
        self.assertIn("Warning -- Unraisable exception", output)
        self.assertIn("Exception: weakref callback bug", output)

    def test_threading_excepthook(self):
        # --fail-env-changed must catch uncaught thread exception.
        # The exception must be displayed even if sys.stderr is redirected.
        code = textwrap.dedent(r"""
            import threading
            import unittest
            from test.support import captured_stderr

            class MyObject:
                pass

            def func_bug():
                raise Exception("bug in thread")

            class Tests(unittest.TestCase):
                def test_threading_excepthook(self):
                    with captured_stderr() as stderr:
                        thread = threading.Thread(target=func_bug)
                        thread.start()
                        thread.join()
                    self.assertEqual(stderr.getvalue(), '')
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--fail-env-changed", "-v", testname,
                                exitcode=EXITCODE_ENV_CHANGED)
        self.check_executed_tests(output, [testname],
                                  env_changed=[testname],
                                  fail_env_changed=True,
                                  stats=1)
        self.assertIn("Warning -- Uncaught thread exception", output)
        self.assertIn("Exception: bug in thread", output)

    def test_print_warning(self):
        # bpo-45410: The order of messages must be preserved when -W and
        # support.print_warning() are used.
        code = textwrap.dedent(r"""
            import sys
            import unittest
            from test import support

            class MyObject:
                pass

            def func_bug():
                raise Exception("bug in thread")

            class Tests(unittest.TestCase):
                def test_print_warning(self):
                    print("msg1: stdout")
                    support.print_warning("msg2: print_warning")
                    # Fail with ENV CHANGED to see print_warning() log
                    support.environment_altered = True
        """)
        testname = self.create_test(code=code)

        # Expect an output like:
        #
        #   test_threading_excepthook (test.test_x.Tests) ... msg1: stdout
        #   Warning -- msg2: print_warning
        #   ok
        regex = (r"test_print_warning.*msg1: stdout\n"
                 r"Warning -- msg2: print_warning\n"
                 r"ok\n")
        for option in ("-v", "-W"):
            with self.subTest(option=option):
                cmd = ["--fail-env-changed", option, testname]
                output = self.run_tests(*cmd, exitcode=EXITCODE_ENV_CHANGED)
                self.check_executed_tests(output, [testname],
                                          env_changed=[testname],
                                          fail_env_changed=True,
                                          stats=1)
                self.assertRegex(output, regex)

    def test_unicode_guard_env(self):
        guard = os.environ.get(setup.UNICODE_GUARD_ENV)
        self.assertIsNotNone(guard, f"{setup.UNICODE_GUARD_ENV} not set")
        if guard.isascii():
            # Skip to signify that the env var value was changed by the user;
            # possibly to something ASCII to work around Unicode issues.
            self.skipTest("Modified guard")

    def test_cleanup(self):
        dirname = os.path.join(self.tmptestdir, "test_python_123")
        os.mkdir(dirname)
        filename = os.path.join(self.tmptestdir, "test_python_456")
        open(filename, "wb").close()
        names = [dirname, filename]

        cmdargs = ['-m', 'test',
                   '--tempdir=%s' % self.tmptestdir,
                   '--cleanup']
        self.run_python(cmdargs)

        for name in names:
            self.assertFalse(os.path.exists(name), name)

    @unittest.skipIf(support.is_wasi,
                     'checking temp files is not implemented on WASI')
    def test_leak_tmp_file(self):
        code = textwrap.dedent(r"""
            import os.path
            import tempfile
            import unittest

            class FileTests(unittest.TestCase):
                def test_leak_tmp_file(self):
                    filename = os.path.join(tempfile.gettempdir(), 'mytmpfile')
                    with open(filename, "wb") as fp:
                        fp.write(b'content')
        """)
        testnames = [self.create_test(code=code) for _ in range(3)]

        output = self.run_tests("--fail-env-changed", "-v", "-j2", *testnames,
                                exitcode=EXITCODE_ENV_CHANGED)
        self.check_executed_tests(output, testnames,
                                  env_changed=testnames,
                                  fail_env_changed=True,
                                  parallel=True,
                                  stats=len(testnames))
        for testname in testnames:
            self.assertIn(f"Warning -- {testname} leaked temporary "
                          f"files (1): mytmpfile",
                          output)

    def test_worker_decode_error(self):
        # gh-109425: Use "backslashreplace" error handler to decode stdout.
        if sys.platform == 'win32':
            encoding = locale.getencoding()
        else:
            encoding = sys.stdout.encoding
            if encoding is None:
                encoding = sys.__stdout__.encoding
                if encoding is None:
                    self.skipTest("cannot get regrtest worker encoding")

        nonascii = bytes(ch for ch in range(128, 256))
        corrupted_output = b"nonascii:%s\n" % (nonascii,)
        # gh-108989: On Windows, assertion errors are written in UTF-16: when
        # decoded each letter is follow by a NUL character.
        assertion_failed = 'Assertion failed: tstate_is_alive(tstate)\n'
        corrupted_output += assertion_failed.encode('utf-16-le')
        try:
            corrupted_output.decode(encoding)
        except UnicodeDecodeError:
            pass
        else:
            self.skipTest(f"{encoding} can decode non-ASCII bytes")

        expected_line = corrupted_output.decode(encoding, 'backslashreplace')

        code = textwrap.dedent(fr"""
            import sys
            import unittest

            class Tests(unittest.TestCase):
                def test_pass(self):
                    pass

            # bytes which cannot be decoded from UTF-8
            corrupted_output = {corrupted_output!a}
            sys.stdout.buffer.write(corrupted_output)
            sys.stdout.buffer.flush()
        """)
        testname = self.create_test(code=code)

        output = self.run_tests("--fail-env-changed", "-v", "-j1", testname)
        self.check_executed_tests(output, [testname],
                                  parallel=True,
                                  stats=1)
        self.check_line(output, expected_line, regex=False)

    def test_doctest(self):
        code = textwrap.dedent(r'''
            import doctest
            import sys
            from test import support

            def my_function():
                """
                Pass:

                >>> 1 + 1
                2

                Failure:

                >>> 2 + 3
                23
                >>> 1 + 1
                11

                Skipped test (ignored):

                >>> id(1.0)  # doctest: +SKIP
                7948648
                """

            def load_tests(loader, tests, pattern):
                tests.addTest(doctest.DocTestSuite())
                return tests
        ''')
        testname = self.create_test(code=code)

        output = self.run_tests("--fail-env-changed", "-v", "-j1", testname,
                                exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, [testname],
                                  failed=[testname],
                                  parallel=True,
                                  stats=TestStats(1, 1, 0))

    def _check_random_seed(self, run_workers: bool):
        # gh-109276: When -r/--randomize is used, random.seed() is called
        # with the same random seed before running each test file.
        code = textwrap.dedent(r'''
            import random
            import unittest

            class RandomSeedTest(unittest.TestCase):
                def test_randint(self):
                    numbers = [random.randint(0, 1000) for _ in range(10)]
                    print(f"Random numbers: {numbers}")
        ''')
        tests = [self.create_test(name=f'test_random{i}', code=code)
                 for i in range(1, 3+1)]

        random_seed = 856_656_202
        cmd = ["--randomize", f"--randseed={random_seed}"]
        if run_workers:
            # run as many worker processes than the number of tests
            cmd.append(f'-j{len(tests)}')
        cmd.extend(tests)
        output = self.run_tests(*cmd)

        random.seed(random_seed)
        # Make the assumption that nothing consume entropy between libregrest
        # setup_tests() which calls random.seed() and RandomSeedTest calling
        # random.randint().
        numbers = [random.randint(0, 1000) for _ in range(10)]
        expected = f"Random numbers: {numbers}"

        regex = r'^Random numbers: .*$'
        matches = re.findall(regex, output, flags=re.MULTILINE)
        self.assertEqual(matches, [expected] * len(tests))

    def test_random_seed(self):
        self._check_random_seed(run_workers=False)

    def test_random_seed_workers(self):
        self._check_random_seed(run_workers=True)

    def test_python_command(self):
        code = textwrap.dedent(r"""
            import sys
            import unittest

            class WorkerTests(unittest.TestCase):
                def test_dev_mode(self):
                    self.assertTrue(sys.flags.dev_mode)
        """)
        tests = [self.create_test(code=code) for _ in range(3)]

        # Custom Python command: "python -X dev"
        python_cmd = [sys.executable, '-X', 'dev']
        # test.libregrtest.cmdline uses shlex.split() to parse the Python
        # command line string
        python_cmd = shlex.join(python_cmd)

        output = self.run_tests("--python", python_cmd, "-j0", *tests)
        self.check_executed_tests(output, tests,
                                  stats=len(tests), parallel=True)

    def test_unload_tests(self):
        # Test that unloading test modules does not break tests
        # that import from other tests.
        # The test execution order matters for this test.
        # Both test_regrtest_a and test_regrtest_c which are executed before
        # and after test_regrtest_b import a submodule from the test_regrtest_b
        # package and use it in testing. test_regrtest_b itself does not import
        # that submodule.
        # Previously test_regrtest_c failed because test_regrtest_b.util in
        # sys.modules was left after test_regrtest_a (making the import
        # statement no-op), but new test_regrtest_b without the util attribute
        # was imported for test_regrtest_b.
        testdir = os.path.join(os.path.dirname(__file__),
                               'regrtestdata', 'import_from_tests')
        tests = [f'test_regrtest_{name}' for name in ('a', 'b', 'c')]
        args = ['-Wd', '-E', '-bb', '-m', 'test', '--testdir=%s' % testdir, *tests]
        output = self.run_python(args)
        self.check_executed_tests(output, tests, stats=3)

    def check_add_python_opts(self, option):
        # --fast-ci and --slow-ci add "-u -W default -bb -E" options to Python
        code = textwrap.dedent(r"""
            import sys
            import unittest
            from test import support
            try:
                from _testinternalcapi import get_config
            except ImportError:
                get_config = None

            # WASI/WASM buildbots don't use -E option
            use_environment = (support.is_emscripten or support.is_wasi)

            class WorkerTests(unittest.TestCase):
                @unittest.skipUnless(get_config is None, 'need get_config()')
                def test_config(self):
                    config = get_config()['config']
                    # -u option
                    self.assertEqual(config['buffered_stdio'], 0)
                    # -W default option
                    self.assertTrue(config['warnoptions'], ['default'])
                    # -bb option
                    self.assertTrue(config['bytes_warning'], 2)
                    # -E option
                    self.assertTrue(config['use_environment'], use_environment)

                def test_python_opts(self):
                    # -u option
                    self.assertTrue(sys.__stdout__.write_through)
                    self.assertTrue(sys.__stderr__.write_through)

                    # -W default option
                    self.assertTrue(sys.warnoptions, ['default'])

                    # -bb option
                    self.assertEqual(sys.flags.bytes_warning, 2)

                    # -E option
                    self.assertEqual(not sys.flags.ignore_environment,
                                     use_environment)
        """)
        testname = self.create_test(code=code)

        # Use directly subprocess to control the exact command line
        cmd = [sys.executable,
               "-m", "test", option,
               f'--testdir={self.tmptestdir}',
               testname]
        proc = subprocess.run(cmd,
                              stdout=subprocess.PIPE,
                              stderr=subprocess.STDOUT,
                              text=True)
        self.assertEqual(proc.returncode, 0, proc)

    def test_add_python_opts(self):
        for opt in ("--fast-ci", "--slow-ci"):
            with self.subTest(opt=opt):
                self.check_add_python_opts(opt)

    # gh-76319: Raising SIGSEGV on Android may not cause a crash.
    @unittest.skipIf(support.is_android,
                     'raising SIGSEGV on Android is unreliable')
    def test_worker_output_on_failure(self):
        try:
            from faulthandler import _sigsegv
        except ImportError:
            self.skipTest("need faulthandler._sigsegv")

        code = textwrap.dedent(r"""
            import faulthandler
            import unittest
            from test import support

            class CrashTests(unittest.TestCase):
                def test_crash(self):
                    print("just before crash!", flush=True)

                    with support.SuppressCrashReport():
                        faulthandler._sigsegv(True)
        """)
        testname = self.create_test(code=code)

        # Sanitizers must not handle SIGSEGV (ex: for test_enable_fd())
        env = dict(os.environ)
        option = 'handle_segv=0'
        support.set_sanitizer_env_var(env, option)

        output = self.run_tests("-j1", testname,
                                exitcode=EXITCODE_BAD_TEST,
                                env=env)
        self.check_executed_tests(output, testname,
                                  failed=[testname],
                                  stats=0, parallel=True)
        if not support.MS_WINDOWS:
            exitcode = -int(signal.SIGSEGV)
            self.assertIn(f"Exit code {exitcode} (SIGSEGV)", output)
        self.check_line(output, "just before crash!", full=True, regex=False)

    def test_verbose3(self):
        code = textwrap.dedent(r"""
            import unittest
            from test import support

            class VerboseTests(unittest.TestCase):
                def test_pass(self):
                    print("SPAM SPAM SPAM")
        """)
        testname = self.create_test(code=code)

        # Run sequentially
        output = self.run_tests("--verbose3", testname)
        self.check_executed_tests(output, testname, stats=1)
        self.assertNotIn('SPAM SPAM SPAM', output)

        # -R option needs a debug build
        if support.Py_DEBUG:
            # Check for reference leaks, run in parallel
            output = self.run_tests("-R", "3:3", "-j1", "--verbose3", testname)
            self.check_executed_tests(output, testname, stats=1, parallel=True)
            self.assertNotIn('SPAM SPAM SPAM', output)

    def test_xml(self):
        code = textwrap.dedent(r"""
            import unittest
            from test import support

            class VerboseTests(unittest.TestCase):
                def test_failed(self):
                    print("abc \x1b def")
                    self.fail()
        """)
        testname = self.create_test(code=code)

        # Run sequentially
        filename = os_helper.TESTFN
        self.addCleanup(os_helper.unlink, filename)

        output = self.run_tests(testname, "--junit-xml", filename,
                                exitcode=EXITCODE_BAD_TEST)
        self.check_executed_tests(output, testname,
                                  failed=testname,
                                  stats=TestStats(1, 1, 0))

        # Test generated XML
        with open(filename, encoding="utf8") as fp:
            content = fp.read()

        testsuite = ElementTree.fromstring(content)
        self.assertEqual(int(testsuite.get('tests')), 1)
        self.assertEqual(int(testsuite.get('errors')), 0)
        self.assertEqual(int(testsuite.get('failures')), 1)

        testcase = testsuite[0][0]
        self.assertEqual(testcase.get('status'), 'run')
        self.assertEqual(testcase.get('result'), 'completed')
        self.assertGreater(float(testcase.get('time')), 0)
        for out in testcase.iter('system-out'):
            self.assertEqual(out.text, r"abc \x1b def")


class TestUtils(unittest.TestCase):
    def test_format_duration(self):
        self.assertEqual(utils.format_duration(0),
                         '0 ms')
        self.assertEqual(utils.format_duration(1e-9),
                         '1 ms')
        self.assertEqual(utils.format_duration(10e-3),
                         '10 ms')
        self.assertEqual(utils.format_duration(1.5),
                         '1.5 sec')
        self.assertEqual(utils.format_duration(1),
                         '1.0 sec')
        self.assertEqual(utils.format_duration(2 * 60),
                         '2 min')
        self.assertEqual(utils.format_duration(2 * 60 + 1),
                         '2 min 1 sec')
        self.assertEqual(utils.format_duration(3 * 3600),
                         '3 hour')
        self.assertEqual(utils.format_duration(3 * 3600  + 2 * 60 + 1),
                         '3 hour 2 min')
        self.assertEqual(utils.format_duration(3 * 3600 + 1),
                         '3 hour 1 sec')

    def test_normalize_test_name(self):
        normalize = normalize_test_name
        self.assertEqual(normalize('test_access (test.test_os.FileTests.test_access)'),
                         'test_access')
        self.assertEqual(normalize('setUpClass (test.test_os.ChownFileTests)', is_error=True),
                         'ChownFileTests')
        self.assertEqual(normalize('test_success (test.test_bug.ExampleTests.test_success)', is_error=True),
                         'test_success')
        self.assertIsNone(normalize('setUpModule (test.test_x)', is_error=True))
        self.assertIsNone(normalize('tearDownModule (test.test_module)', is_error=True))

    def test_get_signal_name(self):
        for exitcode, expected in (
            (-int(signal.SIGINT), 'SIGINT'),
            (-int(signal.SIGSEGV), 'SIGSEGV'),
            (3221225477, "STATUS_ACCESS_VIOLATION"),
            (0xC00000FD, "STATUS_STACK_OVERFLOW"),
        ):
            self.assertEqual(utils.get_signal_name(exitcode), expected, exitcode)

    def test_format_resources(self):
        format_resources = utils.format_resources
        ALL_RESOURCES = utils.ALL_RESOURCES
        self.assertEqual(
            format_resources(("network",)),
            'resources (1): network')
        self.assertEqual(
            format_resources(("audio", "decimal", "network")),
            'resources (3): audio,decimal,network')
        self.assertEqual(
            format_resources(ALL_RESOURCES),
            'resources: all')
        self.assertEqual(
            format_resources(tuple(name for name in ALL_RESOURCES
                                   if name != "cpu")),
            'resources: all,-cpu')
        self.assertEqual(
            format_resources((*ALL_RESOURCES, "tzdata")),
            'resources: all,tzdata')

    def test_match_test(self):
        class Test:
            def __init__(self, test_id):
                self.test_id = test_id

            def id(self):
                return self.test_id

        # Restore patterns once the test completes
        patterns = get_match_tests()
        self.addCleanup(set_match_tests, patterns)

        test_access = Test('test.test_os.FileTests.test_access')
        test_chdir = Test('test.test_os.Win32ErrorTests.test_chdir')
        test_copy = Test('test.test_shutil.TestCopy.test_copy')

        # Test acceptance
        with support.swap_attr(support, '_test_matchers', ()):
            # match all
            set_match_tests([])
            self.assertTrue(match_test(test_access))
            self.assertTrue(match_test(test_chdir))

            # match all using None
            set_match_tests(None)
            self.assertTrue(match_test(test_access))
            self.assertTrue(match_test(test_chdir))

            # match the full test identifier
            set_match_tests([(test_access.id(), True)])
            self.assertTrue(match_test(test_access))
            self.assertFalse(match_test(test_chdir))

            # match the module name
            set_match_tests([('test_os', True)])
            self.assertTrue(match_test(test_access))
            self.assertTrue(match_test(test_chdir))
            self.assertFalse(match_test(test_copy))

            # Test '*' pattern
            set_match_tests([('test_*', True)])
            self.assertTrue(match_test(test_access))
            self.assertTrue(match_test(test_chdir))

            # Test case sensitivity
            set_match_tests([('filetests', True)])
            self.assertFalse(match_test(test_access))
            set_match_tests([('FileTests', True)])
            self.assertTrue(match_test(test_access))

            # Test pattern containing '.' and a '*' metacharacter
            set_match_tests([('*test_os.*.test_*', True)])
            self.assertTrue(match_test(test_access))
            self.assertTrue(match_test(test_chdir))
            self.assertFalse(match_test(test_copy))

            # Multiple patterns
            set_match_tests([(test_access.id(), True), (test_chdir.id(), True)])
            self.assertTrue(match_test(test_access))
            self.assertTrue(match_test(test_chdir))
            self.assertFalse(match_test(test_copy))

            set_match_tests([('test_access', True), ('DONTMATCH', True)])
            self.assertTrue(match_test(test_access))
            self.assertFalse(match_test(test_chdir))

        # Test rejection
        with support.swap_attr(support, '_test_matchers', ()):
            # match the full test identifier
            set_match_tests([(test_access.id(), False)])
            self.assertFalse(match_test(test_access))
            self.assertTrue(match_test(test_chdir))

            # match the module name
            set_match_tests([('test_os', False)])
            self.assertFalse(match_test(test_access))
            self.assertFalse(match_test(test_chdir))
            self.assertTrue(match_test(test_copy))

            # Test '*' pattern
            set_match_tests([('test_*', False)])
            self.assertFalse(match_test(test_access))
            self.assertFalse(match_test(test_chdir))

            # Test case sensitivity
            set_match_tests([('filetests', False)])
            self.assertTrue(match_test(test_access))
            set_match_tests([('FileTests', False)])
            self.assertFalse(match_test(test_access))

            # Test pattern containing '.' and a '*' metacharacter
            set_match_tests([('*test_os.*.test_*', False)])
            self.assertFalse(match_test(test_access))
            self.assertFalse(match_test(test_chdir))
            self.assertTrue(match_test(test_copy))

            # Multiple patterns
            set_match_tests([(test_access.id(), False), (test_chdir.id(), False)])
            self.assertFalse(match_test(test_access))
            self.assertFalse(match_test(test_chdir))
            self.assertTrue(match_test(test_copy))

            set_match_tests([('test_access', False), ('DONTMATCH', False)])
            self.assertFalse(match_test(test_access))
            self.assertTrue(match_test(test_chdir))

        # Test mixed filters
        with support.swap_attr(support, '_test_matchers', ()):
            set_match_tests([('*test_os', False), ('test_access', True)])
            self.assertTrue(match_test(test_access))
            self.assertFalse(match_test(test_chdir))
            self.assertTrue(match_test(test_copy))

            set_match_tests([('*test_os', True), ('test_access', False)])
            self.assertFalse(match_test(test_access))
            self.assertTrue(match_test(test_chdir))
            self.assertFalse(match_test(test_copy))

    def test_sanitize_xml(self):
        sanitize_xml = utils.sanitize_xml

        # escape invalid XML characters
        self.assertEqual(sanitize_xml('abc \x1b\x1f def'),
                         r'abc \x1b\x1f def')
        self.assertEqual(sanitize_xml('nul:\x00, bell:\x07'),
                         r'nul:\x00, bell:\x07')
        self.assertEqual(sanitize_xml('surrogate:\uDC80'),
                         r'surrogate:\udc80')
        self.assertEqual(sanitize_xml('illegal \uFFFE and \uFFFF'),
                         r'illegal \ufffe and \uffff')

        # no escape for valid XML characters
        self.assertEqual(sanitize_xml('a\n\tb'),
                         'a\n\tb')
        self.assertEqual(sanitize_xml('valid t\xe9xt \u20ac'),
                         'valid t\xe9xt \u20ac')


if __name__ == '__main__':
    unittest.main()


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
21 Aug 2026 4.01 AM
root / linksafe
0755
__pycache__
--
21 Aug 2026 4.01 AM
root / linksafe
0755
audiodata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
certdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
cjkencodings
--
21 Aug 2026 4.01 AM
root / linksafe
0755
configdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
crashers
--
21 Aug 2026 4.01 AM
root / linksafe
0755
data
--
21 Aug 2026 4.01 AM
root / linksafe
0755
decimaltestdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
dtracedata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
encoded_modules
--
21 Aug 2026 4.01 AM
root / linksafe
0755
imghdrdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
leakers
--
21 Aug 2026 4.01 AM
root / linksafe
0755
libregrtest
--
21 Aug 2026 4.01 AM
root / linksafe
0755
regrtestdata
--
17 Aug 2026 3.13 PM
root / linksafe
0755
sndhdrdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
subprocessdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
support
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_ast
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_asyncio
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_capi
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_cext
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_concurrent_futures
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_cppext
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_ctypes
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_dataclasses
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_doctest
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_email
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_future_stmt
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_gdb
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_import
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_importlib
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_inspect
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_json
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_lib2to3
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_module
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_multiprocessing_fork
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_multiprocessing_forkserver
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_multiprocessing_spawn
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_peg_generator
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_pydoc
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_sqlite3
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_tkinter
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_tomllib
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_tools
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_ttk
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_unittest
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_warnings
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_zipfile
--
21 Aug 2026 4.01 AM
root / linksafe
0755
test_zoneinfo
--
21 Aug 2026 4.01 AM
root / linksafe
0755
tokenizedata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
tracedmodules
--
21 Aug 2026 4.01 AM
root / linksafe
0755
translationdata
--
17 Aug 2026 3.13 PM
root / linksafe
0755
typinganndata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
wheeldata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
xmltestdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
ziptestdata
--
21 Aug 2026 4.01 AM
root / linksafe
0755
Sine-1000Hz-300ms.aif
60.25 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
__init__.py
0.046 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
__main__.py
0.065 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
_test_atexit.py
3.614 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
_test_eintr.py
17.72 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
_test_embed_set_config.py
8.64 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
_test_embed_structseq.py
1.988 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
_test_multiprocessing.py
216.264 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
_test_venv_multiprocessing.py
0.777 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
archiver_tests.py
6.104 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
audiotest.au
27.484 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
audiotests.py
12.134 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
audit-tests.py
13.758 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
autotest.py
0.209 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
bisect_cmd.py
5.355 KB
17 Aug 2026 3.08 PM
root / linksafe
0755
clinic.test.c
139.104 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
cmath_testcases.txt
141.197 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
curses_tests.py
1.227 KB
17 Aug 2026 3.08 PM
root / linksafe
0755
datetimetester.py
265.734 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
dis_module.py
0.074 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
empty.vbs
0.068 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
exception_hierarchy.txt
2.331 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
floating_points.txt
15.92 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
fork_wait.py
2.294 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
formatfloat_testcases.txt
7.451 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
ieee754.txt
3.15 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
levenshtein_examples.json
406.437 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
list_tests.py
16.899 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
lock_tests.py
35.642 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
mailcap.txt
1.24 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
mapping_tests.py
21.869 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
math_testcases.txt
23.186 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
memory_watchdog.py
0.694 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
mime.types
47.372 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
mock_socket.py
3.687 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
mp_fork_bomb.py
0.438 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
mp_preload.py
0.343 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
multibytecodec_support.py
14.187 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
pickletester.py
172.369 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
profilee.py
2.97 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
pstats.pck
65.046 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
pyclbr_input.py
1.63 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
pythoninfo.py
28.477 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
randv2_32.pck
7.341 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
randv2_64.pck
7.192 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
randv3.pck
7.816 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
re_tests.py
25.943 KB
17 Aug 2026 3.08 PM
root / linksafe
0755
recursion.tar
0.504 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
regrtest.py
1.282 KB
17 Aug 2026 3.08 PM
root / linksafe
0755
relimport.py
0.026 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
reperf.py
0.525 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
seq_tests.py
14.958 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
signalinterproctester.py
3.122 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
ssl_servers.py
7.12 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
ssltests.py
1.026 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
string_tests.py
71.244 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test___all__.py
5.042 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test__locale.py
12.521 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test__opcode.py
4.141 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test__osx_support.py
13.534 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test__xxinterpchannels.py
52.186 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test__xxsubinterpreters.py
27.497 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_abc.py
23.814 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_abstract_numbers.py
5.813 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_aifc.py
17.838 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_argparse.py
218.49 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_array.py
55.438 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_asdl_parser.py
4.442 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_asyncgen.py
53.944 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_atexit.py
3.2 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_audioop.py
28.317 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_audit.py
9.217 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_augassign.py
7.684 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_base64.py
35.055 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_baseexception.py
7.773 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bdb.py
44.168 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bigaddrspace.py
2.83 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bigmem.py
45.008 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_binascii.py
20.095 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_binop.py
14.14 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bisect.py
16.625 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bool.py
14.247 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_buffer.py
171.878 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bufio.py
2.558 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_builtin.py
96.658 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bytes.py
82.015 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_bz2.py
43.288 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_c_locale_coercion.py
20.992 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_calendar.py
51.782 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_call.py
35.212 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_cgi.py
22.271 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_cgitb.py
2.62 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_charmapcodec.py
1.771 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_class.py
22.016 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_clinic.py
85.406 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_cmath.py
22.47 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_cmd.py
6.491 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_cmd_line.py
39.512 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_cmd_line_script.py
34.928 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_code.py
25.695 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_code_module.py
12.728 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codeccallbacks.py
49.229 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecencodings_cn.py
3.857 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecencodings_hk.py
0.685 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecencodings_iso2022.py
3.654 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecencodings_jp.py
4.792 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecencodings_kr.py
2.957 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecencodings_tw.py
0.665 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecmaps_cn.py
0.729 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecmaps_hk.py
0.377 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecmaps_jp.py
1.703 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecmaps_kr.py
1.16 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecmaps_tw.py
0.688 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codecs.py
137.42 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_codeop.py
8.676 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_collections.py
93.466 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_colorsys.py
4.268 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_compare.py
17.459 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_compile.py
81.241 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_compileall.py
48.528 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_compiler_assemble.py
2.458 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_compiler_codegen.py
1.725 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_complex.py
35.211 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_configparser.py
86.702 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_contains.py
3.352 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_context.py
31.099 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_contextlib.py
43.077 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_contextlib_async.py
23.988 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_copy.py
26.522 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_copyreg.py
4.363 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_coroutines.py
67.469 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_cprofile.py
9.442 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_crashers.py
1.169 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_crypt.py
4.191 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_csv.py
63.761 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_curses.py
50.14 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_datetime.py
2.671 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dbm.py
6.828 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dbm_dumb.py
11.076 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dbm_gnu.py
7.643 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dbm_ndbm.py
5.907 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_decimal.py
217.939 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_decorators.py
14.626 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_defaultdict.py
6.102 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_deque.py
33.163 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_descr.py
196.202 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_descrtut.py
10.982 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_devpoll.py
4.442 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dict.py
51.329 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dict_version.py
6.096 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dictcomps.py
6.548 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dictviews.py
14.821 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_difflib.py
21.475 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_difflib_expect.html
100.904 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
test_dis.py
83.447 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_docxmlrpc.py
9.099 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dtrace.py
7.979 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dynamic.py
5.995 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_dynamicclassattribute.py
9.565 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_eintr.py
0.612 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_embed.py
69.878 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ensurepip.py
11.494 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_enum.py
188.151 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_enumerate.py
9.137 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_eof.py
7.94 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_epoll.py
9.404 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_errno.py
1.044 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_except_star.py
39.702 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_exception_group.py
34.026 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_exception_hierarchy.py
7.54 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_exception_variations.py
13.738 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_exceptions.py
83.625 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_extcall.py
14.689 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_faulthandler.py
30.311 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fcntl.py
7.762 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_file.py
11.782 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_file_eintr.py
10.735 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_filecmp.py
11.979 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fileinput.py
37.858 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fileio.py
19.976 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fileutils.py
0.929 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_finalization.py
14.657 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_float.py
64.649 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_flufl.py
2.807 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fnmatch.py
10.683 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fork1.py
3.305 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_format.py
28.442 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fractions.py
65.65 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_frame.py
14.044 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_frozen.py
2.198 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_fstring.py
64.739 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ftplib.py
43.549 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_funcattrs.py
15.711 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_functools.py
114.021 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_gc.py
47.711 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_generator_stop.py
0.921 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_generators.py
66.484 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_genericalias.py
17.775 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_genericclass.py
9.439 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_genericpath.py
23.254 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_genexps.py
7.305 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_getopt.py
6.938 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_getpass.py
6.37 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_getpath.py
44.361 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_gettext.py
41.958 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_glob.py
18.21 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_global.py
1.196 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_grammar.py
66.311 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_graphlib.py
8.313 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_grp.py
3.67 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_gzip.py
41.479 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_hash.py
12.113 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_hashlib.py
46.708 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_heapq.py
16.422 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_hmac.py
26.063 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_html.py
4.234 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_htmlparser.py
46.474 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_http_cookiejar.py
81.548 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_http_cookies.py
25.245 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_httplib.py
102.987 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_httpservers.py
57.947 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_idle.py
0.812 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_imaplib.py
42.111 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_imghdr.py
4.813 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_index.py
8.371 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_int.py
33.975 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_int_literal.py
6.888 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_interpreters.py
32.11 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_io.py
183.891 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ioctl.py
3.24 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ipaddress.py
126.692 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_isinstance.py
12.949 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_iter.py
38.229 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_iterlen.py
7.096 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_itertools.py
113.531 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_keyword.py
2.002 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_keywordonlyarg.py
6.893 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_kqueue.py
9.364 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_largefile.py
11.054 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_launcher.py
28.752 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_linecache.py
12.56 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_list.py
9.599 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_listcomps.py
24.017 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_lltrace.py
3.706 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_locale.py
24.691 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_logging.py
251.698 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_long.py
63.403 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_longexp.py
0.228 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_lzma.py
93.004 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_mailbox.py
93.909 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_mailcap.py
11.476 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_marshal.py
23.148 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_math.py
108.303 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_math_property.py
1.153 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_memoryio.py
32.651 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_memoryview.py
22.229 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_metaclass.py
6.193 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_mimetypes.py
15.741 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_minidom.py
69.564 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_mmap.py
38.563 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_modulefinder.py
12.21 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_monitoring.py
55.757 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_msilib.py
5.516 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_multibytecodec.py
15.793 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_multiprocessing_main_handling.py
11.482 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_named_expressions.py
29.622 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_netrc.py
11.857 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_nis.py
1.255 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_nntplib.py
62.697 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ntpath.py
64.113 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_numeric_tower.py
7.996 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_opcache.py
10.893 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_opcodes.py
3.62 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_openpty.py
0.586 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_operator.py
26.716 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_optparse.py
61.393 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ordered_dict.py
39.957 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_os.py
181.055 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ossaudiodev.py
7.271 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_osx_env.py
1.307 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pathlib.py
138.013 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_patma.py
86.602 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pdb.py
92.917 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_peepholer.py
40.604 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pep646_syntax.py
7.795 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_perf_profiler.py
11.411 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_perfmaps.py
0.669 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pickle.py
21.243 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_picklebuffer.py
4.989 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pickletools.py
16.78 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pipes.py
6.787 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pkg.py
9.594 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pkgutil.py
26.221 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_platform.py
21.531 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_plistlib.py
42.615 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_poll.py
7.394 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_popen.py
2.363 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_poplib.py
18.016 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_positional_only_arg.py
18.444 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_posix.py
96.253 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_posixpath.py
44.923 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pow.py
6.385 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pprint.py
50.586 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_print.py
8.053 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_profile.py
8.692 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_property.py
19.325 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pstats.py
4.312 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pty.py
16.18 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pulldom.py
12.332 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pwd.py
4.324 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_py_compile.py
11.933 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pyclbr.py
10.246 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_pyexpat.py
42.823 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_queue.py
20.614 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_quopri.py
7.868 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_raise.py
13.442 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_random.py
57.006 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_range.py
26.53 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_re.py
144.786 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_readline.py
15.721 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_regrtest.py
92.506 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_repl.py
6.344 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_reprlib.py
29.071 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_resource.py
7.115 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_richcmp.py
11.945 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_rlcompleter.py
7.398 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_robotparser.py
11.017 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_runpy.py
33.989 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sax.py
54.633 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sched.py
7.378 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_scope.py
21.941 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_script_helper.py
5.82 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_secrets.py
4.278 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_select.py
3.422 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_selectors.py
19.638 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_set.py
71.309 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_setcomps.py
5.244 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_shelve.py
6.419 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_shlex.py
13.392 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_shutil.py
140.348 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_signal.py
52.581 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_site.py
29.771 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_slice.py
9.46 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_smtplib.py
60.02 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_smtpnet.py
3.027 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sndhdr.py
1.506 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_socket.py
261.133 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_socketserver.py
17.395 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sort.py
13.591 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_source_encoding.py
12.653 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_spwd.py
2.835 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ssl.py
216.517 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_stable_abi_ctypes.py
24.748 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_startfile.py
1.695 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_stat.py
8.922 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_statistics.py
120.024 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_strftime.py
7.404 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_string.py
21.858 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_string_literals.py
14.101 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_stringprep.py
3.04 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_strptime.py
41.948 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_strtod.py
20.056 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_struct.py
39.18 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_structseq.py
7.722 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_subclassinit.py
8.043 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_subprocess.py
161.374 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sunau.py
6.093 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sundry.py
1.022 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_super.py
14.787 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_support.py
27.052 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_symtable.py
17.559 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_syntax.py
73.954 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sys.py
67.373 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sys_setprofile.py
14.534 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sys_settrace.py
84.558 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_sysconfig.py
26.078 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_syslog.py
4.704 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tabnanny.py
13.899 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tarfile.py
190.533 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tcl.py
30.301 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_telnetlib.py
12.848 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tempfile.py
75.505 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_termios.py
10.96 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_textwrap.py
41.886 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_thread.py
8.866 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_threadedtempfile.py
1.929 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_threading.py
74.212 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_threading_local.py
7.011 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_threadsignals.py
9.871 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_time.py
44.651 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_timeit.py
15.195 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_timeout.py
10.74 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tix.py
1.049 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tokenize.py
118.005 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_trace.py
21.521 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_traceback.py
144.404 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tracemalloc.py
40.971 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ttk_textonly.py
16.693 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tty.py
3.63 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_tuple.py
19.801 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_turtle.py
14.038 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_type_aliases.py
12.743 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_type_annotations.py
6.233 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_type_cache.py
6.596 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_type_comments.py
10.501 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_type_params.py
38.866 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_typechecks.py
2.554 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_types.py
82.379 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_typing.py
343.332 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_ucn.py
9.712 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unary.py
1.524 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unicode.py
125.435 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unicode_file.py
5.719 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unicode_file_functions.py
6.908 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unicode_identifiers.py
0.974 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unicodedata.py
18.564 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_univnewlines.py
3.854 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unpack.py
3.507 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unpack_ex.py
9.977 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_unparse.py
27.962 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_urllib.py
73.042 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_urllib2.py
80.817 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_urllib2_localnet.py
25.64 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_urllib2net.py
13.958 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_urllib_response.py
2.04 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_urllibnet.py
9.407 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_urlparse.py
81.411 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_userdict.py
7.563 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_userlist.py
1.969 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_userstring.py
2.519 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_utf8_mode.py
10.312 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_utf8source.py
1.081 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_uu.py
9.195 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_uuid.py
44.279 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_venv.py
37.424 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_wait3.py
1.739 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_wait4.py
1.14 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_wave.py
7.641 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_weakref.py
74.318 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_weakset.py
16.304 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_webbrowser.py
13.363 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_winapi.py
2.627 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_winconsoleio.py
7.6 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_winreg.py
22.479 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_winsound.py
5.172 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_with.py
27.778 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_wmi.py
3.311 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_wsgiref.py
31.005 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xdrlib.py
2.253 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xml_dom_minicompat.py
4.182 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xml_dom_xmlbuilder.py
3.098 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xml_etree.py
170.074 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xml_etree_c.py
9.337 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xmlrpc.py
58.079 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xmlrpc_net.py
0.932 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xxlimited.py
2.462 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_xxtestfuzz.py
0.674 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_yield_from.py
50.227 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_zipapp.py
16.702 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_zipfile64.py
5.784 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_zipimport.py
31.879 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_zipimport_support.py
10.567 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
test_zlib.py
41.657 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
testcodec.py
1.021 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
testtar.tar
425 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
testtar.tar.xz
0.168 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
tf_inherit_check.py
0.697 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
time_hashlib.py
2.874 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
win_console_handler.py
1.383 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
xmltests.py
0.487 KB
17 Aug 2026 3.08 PM
root / linksafe
0644
zip_cp437_header.zip
0.264 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
zipdir.zip
0.365 KB
12 Aug 2026 1.57 PM
root / linksafe
0644
zipdir_backslash.zip
0.188 KB
12 Aug 2026 1.57 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF