path
stringlengths
14
112
content
stringlengths
0
6.32M
size
int64
0
6.32M
max_lines
int64
1
100k
repo_name
stringclasses
2 values
autogenerated
bool
1 class
cosmopolitan/third_party/python/Lib/test/SHIFT_JISX0213.TXT
00 0000 01 0001 02 0002 03 0003 04 0004 05 0005 06 0006 07 0007 08 0008 09 0009 0A 000A 0B 000B 0C 000C 0D 000D 0E 000E 0F 000F 10 0010 11 0011 12 0012 13 0013 14 0014 15 0015 16 0016 17 0017 18 0018 19 0019 1A 001A 1B 001B 1C 001C 1D 001D 1E 001E 1F 001F 20 0020 21 0021 22 0022 23 0023 24 0024 25 0025 26 0026 27 0027 ...
114,135
11,410
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/reperf.py
import re import time def main(): s = "\13hello\14 \13world\14 " * 1000 p = re.compile(r"([\13\14])") timefunc(10, p.sub, "", s) timefunc(10, p.split, s) timefunc(10, p.findall, s) def timefunc(n, func, *args, **kw): t0 = time.perf_counter() try: for i in range(n): resu...
538
24
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_range.py
# Python test set -- built-in functions import unittest import sys import pickle import itertools import test.support # pure Python implementations (3 args only), for comparison def pyrange(start, stop, step): if (start - stop) // step < 0: # replace stop with next element in the sequence of integers ...
24,999
694
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_complex.py
import unittest from test import support from test.test_grammar import (VALID_UNDERSCORE_LITERALS, INVALID_UNDERSCORE_LITERALS) from random import random from math import atan2, isnan, copysign import operator INF = float("inf") NAN = float("nan") # These tests ensure that complex math ...
30,346
692
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/inspect_fodder2.py
# line 1 def wrap(foo=None): def wrapper(func): return func return wrapper # line 7 def replace(func): def insteadfunc(): print('hello') return insteadfunc # line 13 @wrap() @wrap(wrap) def wrapped(): pass # line 19 @replace def gone(): pass # line 24 oll = lambda m: m # lin...
1,816
140
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_marshal.py
from test import support import array import io import marshal import sys import unittest import os import types try: import _testcapi except ImportError: _testcapi = None if __name__ == 'PYOBJ.COM': import _testcapi class HelperMixin: def helper(self, sample, *extra): new = marshal.loads(mar...
19,986
572
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_site.py
"""Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. """ import unittest import test.support from test import support from test.support import (captured_stderr, TESTFN, EnvironmentVarGuard, change_cwd) import builtins...
26,162
648
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_typing.py
import contextlib import collections import pickle import re import sys from unittest import TestCase, main, skipUnless, SkipTest, expectedFailure from copy import copy, deepcopy from typing import Any, NoReturn from typing import TypeVar, AnyStr from typing import T, KT, VT # Not in __all__. from typing import Union...
86,730
2,654
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_threadedtempfile.py
""" Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile) in each of NUM_THREADS threads, recording the number of successes and failures. A failure is a bug in tempfile, and may be due to: + Trying to create more than one tempfile with the same name. + Trying to delete a tempfile that doesn't sti...
1,932
63
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/eintrdata/eintr_tester.py
""" This test suite exercises some system calls subject to interruption with EINTR, to check that it is actually handled transparently. It is intended to be run by the main test suite within a child process, to ensure there is no background thread running (so that signals are delivered to the correct thread). Signals a...
17,948
530
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/capath/5ed36f99.0
-----BEGIN CERTIFICATE----- MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290 IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsT...
2,569
42
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/capath/6e88d7b8.0
-----BEGIN CERTIFICATE----- MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAz...
814
15
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/capath/99d0fa06.0
-----BEGIN CERTIFICATE----- MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290 IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsT...
2,569
42
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/capath/4e1295a3.0
-----BEGIN CERTIFICATE----- MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAz...
814
15
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/capath/ceff1710.0
-----BEGIN CERTIFICATE----- MIIEbTCCAtWgAwIBAgIJAMstgJlaaVJbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNV BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODA4MjkxNDIzMTZaFw0yODA4MjYx NDIzMTZaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwN...
1,594
27
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/capath/b1930218.0
-----BEGIN CERTIFICATE----- MIIEbTCCAtWgAwIBAgIJAMstgJlaaVJbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNV BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODA4MjkxNDIzMTZaFw0yODA4MjYx NDIzMTZaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwN...
1,594
27
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.8svx
FORMf8SVXVHDR¬DANNO File created by Sound Exchange CHANBODY ÿÿ
110
2
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.wav
RIFF8WAVEfmt D±data
64
1
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/README
Sound file samples used by Lib/test/test_sndhdr.py and generated using the following commands: dd if=/dev/zero of=sndhdr.raw bs=20 count=1 sox -s -2 -c 2 -r 44100 sndhdr.raw sndhdr.<format>
197
6
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.aiff
FORMdAIFFCOMTÈb7ÍProcessed by SoXCOMM@¬DSSND
108
1
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.sndt
SOUNDD¬ Processed by SoX€€€
129
2
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.hcom
AFSSDHCOMÿÿ€
256
1
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.au
.snd,¬DProcessed by SoX
64
1
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.voc
Creative Voice File ) D¬
63
2
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sndhdrdata/sndhdr.aifc
FORMbAIFCFVER¢€Q@COMM&@¬DNONEnot compressedSSND
106
1
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_queues.py
"""Tests for queues.py""" import unittest from unittest import mock import asyncio from asyncio import test_utils class _QueueTestBase(test_utils.TestCase): def setUp(self): super().setUp() self.loop = self.new_test_loop() class QueueBasicTests(_QueueTestBase): def _test_repr_or_str(self...
18,382
644
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/echo.py
import os if __name__ == '__main__': while True: buf = os.read(0, 1024) if not buf: break os.write(1, buf)
148
9
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_transports.py
"""Tests for transports.py.""" import unittest from unittest import mock import asyncio from asyncio import transports class TransportTests(unittest.TestCase): def test_ctor_extra_is_none(self): transport = asyncio.Transport() self.assertEqual(transport._extra, {}) def test_get_extra_info(...
3,471
92
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_windows_utils.py
"""Tests for window_utils""" import socket import sys import unittest import warnings from unittest import mock if sys.platform != 'win32': raise unittest.SkipTest('Windows only') import _winapi from asyncio import _overlapped from asyncio import windows_utils try: from test import support except ImportErro...
6,274
183
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_pep492.py
"""Tests support for new syntax introduced by PEP 492.""" import collections.abc import types import unittest try: from test import support except ImportError: from asyncio import test_support as support from unittest import mock import asyncio from asyncio import test_utils class BaseTest(test_utils.TestC...
6,713
233
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_proactor_events.py
"""Tests for proactor_events.py""" import socket import unittest from unittest import mock import asyncio from asyncio.proactor_events import BaseProactorEventLoop from asyncio.proactor_events import _ProactorSocketTransport from asyncio.proactor_events import _ProactorWritePipeTransport from asyncio.proactor_events ...
21,043
606
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_base_events.py
"""Tests for base_events.py""" import errno import logging import math import os import socket import sys import threading import time import unittest from unittest import mock import asyncio from asyncio import base_events from asyncio import constants from asyncio import test_utils try: from test import support...
69,091
1,876
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/echo2.py
import os if __name__ == '__main__': buf = os.read(0, 1024) os.write(1, b'OUT:'+buf) os.write(2, b'ERR:'+buf)
123
7
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_subprocess.py
import signal import sys import unittest import warnings from unittest import mock import asyncio from asyncio import base_subprocess from asyncio import subprocess from asyncio import test_utils try: from test import support except ImportError: from asyncio import test_support as support if sys.platform != 'w...
20,451
534
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_windows_events.py
import os import sys import unittest from unittest import mock if sys.platform != 'win32': raise unittest.SkipTest('Windows only') import _winapi import asyncio from asyncio import _overlapped from asyncio import test_utils from asyncio import windows_events class UpperProto(asyncio.Protocol): def __init__...
5,475
165
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_unix_events.py
"""Tests for unix_events.py.""" import collections import errno import io import os import pathlib import signal import socket import stat import sys import tempfile import threading import unittest import warnings from unittest import mock if sys.platform == 'win32': raise unittest.SkipTest('UNIX only') import...
55,549
1,639
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/__main__.py
from . import load_tests import unittest unittest.main()
58
5
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_selector_events.py
"""Tests for selector_events.py""" import errno import socket import unittest from unittest import mock try: import ssl except ImportError: ssl = None import asyncio from asyncio import selectors from asyncio import test_utils from asyncio.selector_events import BaseSelectorEventLoop from asyncio.selector_eve...
67,144
1,862
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_streams.py
"""Tests for streams.py.""" import gc import os import queue import pickle import socket import sys import threading import unittest from unittest import mock try: import ssl except ImportError: ssl = None import asyncio from asyncio import test_utils class StreamReaderTests(test_utils.TestCase): DATA ...
32,350
869
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_locks.py
"""Tests for lock.py""" import unittest from unittest import mock import re import asyncio from asyncio import test_utils STR_RGX_REPR = ( r'^<(?P<class>.*?) object at (?P<address>.*?)' r'\[(?P<extras>' r'(set|unset|locked|unlocked)(,value:\d)?(,waiters:\d+)?' r')\]>\Z' ) RGX_REPR = re.compile(STR_RG...
30,147
1,017
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_tasks.py
"""Tests for tasks.py.""" import collections import contextlib import functools import gc import io import os import re import sys import time import types import unittest import weakref from unittest import mock import asyncio from asyncio import coroutines from asyncio import futures from asyncio import tasks from ...
85,839
2,680
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_sslproto.py
"""Tests for asyncio/sslproto.py.""" import logging import unittest from unittest import mock try: import ssl except ImportError: ssl = None import asyncio from asyncio import log from asyncio import sslproto from asyncio import test_utils @unittest.skipIf(ssl is None, 'No ssl module') class SslProtoHandsha...
5,427
152
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_events.py
"""Tests for events.py.""" import collections.abc import concurrent.futures import functools import gc import io import os import platform import re import signal import socket try: import ssl except ImportError: ssl = None import subprocess import sys import threading import time import errno import unittest ...
104,975
2,833
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/test_futures.py
"""Tests for futures.py.""" import concurrent.futures import gc import re import sys import threading import unittest from unittest import mock import asyncio from asyncio import test_utils from asyncio import futures try: from test import support except ImportError: from asyncio import test_support as suppor...
22,511
693
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/__init__.py
import os from test.support import load_package_tests, import_module # Skip tests if we don't have threading. import_module('threading') # Skip tests if we don't have concurrent.futures. import_module('concurrent.futures') def load_tests(*args): return load_package_tests(os.path.dirname(__file__), *args)
312
11
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncio/echo3.py
import os if __name__ == '__main__': while True: buf = os.read(0, 1024) if not buf: break try: os.write(1, b'OUT:'+buf) except OSError as ex: os.write(2, b'ERR:' + ex.__class__.__name__.encode('ascii'))
276
12
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/encoded_modules/module_iso_8859_1.py
# test iso-8859-1 encoding # -*- encoding: iso-8859-1 -*- test = ("Les hommes ont oublié cette vérité, " "dit le renard. Mais tu ne dois pas l'oublier. Tu deviens " "responsable pour toujours de ce que tu as apprivoisé.")
238
6
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/encoded_modules/module_koi8_r.py
# test koi8-r encoding # -*- encoding: koi8-r -*- test = "ðÏÚÎÁÎÉÅ ÂÅÓËÏÎÅÞÎÏÓÔÉ ÔÒÅÂÕÅÔ ÂÅÓËÏÎÅÞÎÏÇÏ ×ÒÅÍÅÎÉ."
113
4
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/encoded_modules/__init__.py
# -*- encoding: utf-8 -*- # This is a package that contains a number of modules that are used to # test import from the source files that have different encodings. # This file (the __init__ module of the package), is encoded in utf-8 # and contains a list of strings from various unicode planes that are # encoded diffe...
1,274
24
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/leakers/README.txt
This directory contains test cases that are known to leak references. The idea is that you can import these modules while in the interpreter and call the leak function repeatedly. This will only be helpful if the interpreter was built in debug mode. If the total ref count doesn't increase, the bug has been fixed and ...
1,090
33
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/leakers/test_selftype.py
# Reference cycles involving only the ob_type field are rather uncommon # but possible. Inspired by SF bug 1469629. import gc def leak(): class T(type): pass class U(type, metaclass=T): pass U.__class__ = U del U gc.collect(); gc.collect(); gc.collect()
293
14
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/leakers/test_ctypes.py
# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test(). from ctypes import Structure, c_int, POINTER import gc def leak_inner(): class POINT(Structure): _fields_ = [("x", c_int)] class RECT(Structure): _fields_ = [("a", POINTER(POINT))] def leak(): leak_inner() gc.c...
329
16
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/leakers/__init__.py
0
1
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_warnings/__main__.py
import unittest unittest.main('test.test_warnings')
53
4
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_warnings/__init__.py
from contextlib import contextmanager import linecache import os import cosmo from io import StringIO import re import sys import textwrap import unittest from test import support from test.support.script_helper import assert_python_ok, assert_python_failure from test.test_warnings.data import stacklevel as warning_te...
51,447
1,223
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_warnings/data/import_warning.py
import warnings warnings.warn('module-level warning', DeprecationWarning, stacklevel=2)
89
4
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_warnings/data/stacklevel.py
# Helper module for testing the skipmodules argument of warnings.warn() import warnings def outer(message, stacklevel=1): inner(message, stacklevel) def inner(message, stacklevel=1): warnings.warn(message, stacklevel=stacklevel)
240
10
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_warnings/data/__init__.py
0
1
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/trace_at_recursion_limit.py
""" From http://bugs.python.org/issue6717 A misbehaving trace hook can trigger a segfault by exceeding the recursion limit. """ import sys def x(): pass def g(*args): if True: # change to True to crash interpreter try: x() except: pass return g def f(): print...
376
28
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/mutation_inside_cyclegc.py
# The cycle GC collector can be executed when any GC-tracked object is # allocated, e.g. during a call to PyList_New(), PyDict_New(), ... # Moreover, it can invoke arbitrary Python code via a weakref callback. # This means that there are many places in the source where an arbitrary # mutation could unexpectedly occur....
753
32
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/underlying_dict.py
import gc thingy = object() class A(object): def f(self): return 1 x = thingy r = gc.get_referrers(thingy) if "__module__" in r[0]: dct = r[0] else: dct = r[1] a = A() for i in range(10): a.f() dct["f"] = lambda self: 2 print(a.f()) # should print 1
282
21
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/recursive_call.py
#!/usr/bin/env python3 # No bug report AFAIK, mail on python-dev on 2006-01-10 # This is a "won't fix" case. It is known that setting a high enough # recursion limit crashes by overflowing the stack. Unless this is # redesigned somehow, it won't go away. import sys sys.setrecursionlimit(1 << 30) f = lambda f:f(f)...
358
16
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/bogus_code_obj.py
""" Broken bytecode objects can easily crash the interpreter. This is not going to be fixed. It is generally agreed that there is no point in writing a bytecode verifier and putting it in CPython just for this. Moreover, a verifier is bound to accept only a subset of all safe bytecodes, so it could lead to unnecessa...
625
20
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/README
This directory only contains tests for outstanding bugs that cause the interpreter to segfault. Ideally this directory should always be empty, but sometimes it may not be easy to fix the underlying cause and the bug is deemed too obscure to invest the effort. Each test should fail when run from the command line: ./...
1,029
21
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/gc_inspection.py
""" gc.get_referrers() can be used to see objects before they are fully built. Note that this is only an example. There are many ways to crash Python by using gc.get_referrers(), as well as many extension modules (even when they are using perfectly documented patterns to build objects). Identifying and removing all ...
1,092
33
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/crashers/infinite_loop_re.py
# This was taken from http://python.org/sf/1541697 # It's not technically a crasher. It may not even truly be infinite, # however, I haven't waited a long time to see the result. It takes # 100% of CPU while running this and should be fixed. import re starttag = re.compile(r'<[a-zA-Z][-_.:a-zA-Z0-9]*\s*(' r...
645
17
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_i18n.py
"""Tests to cover the Tools/i18n package""" import os import unittest from textwrap import dedent from test.support.script_helper import assert_python_ok from test.test_tools import skip_if_missing, toolsdir from test.support import temp_cwd, temp_dir skip_if_missing() class Test_pygettext(unittest.TestCase): ...
8,928
244
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_gprof2html.py
"""Tests for the gprof2html script in the Tools directory.""" import os import sys import unittest from unittest import mock import tempfile from test.test_tools import skip_if_missing, import_tool skip_if_missing() class Gprof2htmlTests(unittest.TestCase): def setUp(self): self.gprof = import_tool('gp...
919
36
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_md5sum.py
"""Tests for the md5sum script in the Tools directory.""" import os import unittest from test import support from test.support.script_helper import assert_python_ok, assert_python_failure from test.test_tools import scriptsdir, skip_if_missing skip_if_missing() class MD5SumTests(unittest.TestCase): @classmethod...
2,617
77
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_pdeps.py
"""Tests for the pdeps script in the Tools directory.""" import os import unittest import tempfile from test.test_tools import skip_if_missing, import_tool skip_if_missing() class PdepsTests(unittest.TestCase): @classmethod def setUpClass(self): self.pdeps = import_tool('pdeps') def test_proc...
824
33
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_unparse.py
"""Tests for the unparse.py script in the Tools/parser directory.""" import unittest import test.support import io import os import random import tokenize import ast from test.test_tools import basepath, toolsdir, skip_if_missing skip_if_missing() parser_path = os.path.join(toolsdir, "parser") with test.support.Di...
8,393
314
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/__main__.py
from test.test_tools import load_tests import unittest unittest.main()
72
5
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_reindent.py
"""Tests for scripts in the Tools directory. This file contains regression tests for some of the scripts found in the Tools directory of a Python checkout or tarball, such as reindent.py. """ import os import unittest from test.support.script_helper import assert_python_ok from test.support import findfile from test...
1,006
36
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_pindent.py
"""Tests for the pindent script in the Tools directory.""" import os import sys import unittest import subprocess import textwrap from test import support from test.support.script_helper import assert_python_ok from test.test_tools import scriptsdir, skip_if_missing skip_if_missing() class PindentTests(unittest.Te...
8,624
340
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_fixcid.py
'''Test Tools/scripts/fixcid.py.''' from io import StringIO import os, os.path import runpy import sys from test import support from test.test_tools import skip_if_missing, scriptsdir import unittest skip_if_missing() class Test(unittest.TestCase): def test_parse_strings(self): old1 = 'int xx = "xx\\"xx"...
2,958
93
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/test_sundry.py
"""Tests for scripts in the Tools directory. This file contains extremely basic regression tests for the scripts found in the Tools directory of a Python checkout or tarball which don't have separate tests of their own, such as h2py.py. """ import os import sys import unittest from test import support from test.test...
1,967
64
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tools/__init__.py
"""Support functions for testing scripts in the Tools directory.""" import os import unittest import importlib from test import support basepath = os.path.dirname( # <src/install dir> os.path.dirname( # Lib os.path.dirname( # test ...
825
25
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_generator.py
import io import textwrap import unittest from email import message_from_string, message_from_bytes from email.message import EmailMessage from email.generator import Generator, BytesGenerator from email import policy from test.test_email import TestEmailBase, parameterize @parameterize class TestGeneratorBase: ...
11,233
297
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_message.py
import unittest import textwrap from email import policy, message_from_string from email.message import EmailMessage, MIMEPart from test.test_email import TestEmailBase, parameterize # Helper. def first(iterable): return next(filter(lambda x: x is not None, iterable), None) class Test(TestEmailBase): polic...
27,251
804
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_policy.py
import io import types import textwrap import unittest import email.errors import email.policy import email.parser import email.generator import email.message from email import headerregistry def make_defaults(base_defaults, differences): defaults = base_defaults.copy() defaults.update(differences) return ...
15,442
375
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_pickleable.py
import unittest import textwrap import copy import pickle import email import email.message from email import policy from email.headerregistry import HeaderRegistry from test.test_email import TestEmailBase, parameterize @parameterize class TestPickleCopyHeader(TestEmailBase): header_factory = HeaderRegistry() ...
2,549
77
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test__header_value_parser.py
import string import unittest from email import _header_value_parser as parser from email import errors from email import policy from test.test_email import TestEmailBase, parameterize class TestTokens(TestEmailBase): # EWWhiteSpaceTerminal def test_EWWhiteSpaceTerminal(self): x = parser.EWWhiteSpace...
119,121
2,792
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_utils.py
import datetime from email import utils import test.support import time import unittest import sys import os.path class DateTimeTests(unittest.TestCase): datestring = 'Sun, 23 Sep 2001 20:10:55' dateargs = (2001, 9, 23, 20, 10, 55) offsetstring = ' -0700' utcoffset = datetime.timedelta(hours=-7) t...
4,900
127
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_defect_handling.py
import textwrap import unittest import contextlib from email import policy from email import errors from test.test_email import TestEmailBase class TestDefectsBase: policy = policy.default raise_expected = False @contextlib.contextmanager def _raise_point(self, defect): yield def test_s...
11,968
338
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_contentmanager.py
import unittest from test.test_email import TestEmailBase, parameterize import textwrap from email import policy from email.message import EmailMessage from email.contentmanager import ContentManager, raw_data_manager from encodings import ( base64_codec, quopri_codec, ) @parameterize class TestContentManage...
33,602
802
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/__main__.py
from test.test_email import load_tests import unittest unittest.main()
72
5
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_parser.py
import io import email import unittest from email.message import Message, EmailMessage from email.policy import default from test.test_email import TestEmailBase class TestCustomMessage(TestEmailBase): class MyMessage(Message): def __init__(self, policy): self.check_policy = policy ...
4,333
111
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_asian_codecs.py
# Copyright (C) 2002-2006 Python Software Foundation # Contact: email-sig@python.org # email package unit tests for (optional) Asian codecs import unittest from test.test_email import TestEmailBase from email.charset import Charset from email.header import Header, decode_header from email.message import Message # We...
3,145
82
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/torture_test.py
# Copyright (C) 2002-2004 Python Software Foundation # # A torture test of the email package. This should not be run as part of the # standard Python test suite since it requires several meg of email messages # collected in the wild. These source messages are not checked into the # Python distro, but are available as...
3,607
134
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_headerregistry.py
import datetime import textwrap import unittest from email import errors from email import policy from email.message import Message from test.test_email import TestEmailBase, parameterize from email import headerregistry from email.headerregistry import Address, Group DITTO = object() class TestHeaderRegistry(TestE...
59,612
1,673
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test__encoded_words.py
import unittest from email import _encoded_words as _ew from email import errors from test.test_email import TestEmailBase class TestDecodeQ(TestEmailBase): def _test(self, source, ex_result, ex_defects=[]): result, defects = _ew.decode_q(source) self.assertEqual(result, ex_result) self.a...
6,644
199
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_inversion.py
"""Test the parser and generator are inverses. Note that this is only strictly true if we are parsing RFC valid messages and producing RFC valid messages. """ import io import unittest from email import policy, message_from_bytes from email.message import EmailMessage from email.generator import BytesGenerator from t...
2,075
71
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/test_email.py
# Copyright (C) 2001-2010 Python Software Foundation # Contact: email-sig@python.org # email package unit tests import os import re import sys import time import base64 import unittest import textwrap from io import StringIO, BytesIO from itertools import chain from random import choice from socket import getfqdn try...
208,800
5,421
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/__init__.py
import os import unittest import collections import email from email.message import Message from email._policybase import compat32 from test.support import load_package_tests landmark = __file__ # Load all tests in package def load_tests(*args): return load_package_tests(os.path.dirname(__file__), *args) # help...
6,295
168
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/data/msg_35.txt
From: aperson@dom.ain To: bperson@dom.ain Subject: here's something interesting counter to RFC 2822, there's no separating newline here
136
5
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/data/msg_46.txt
Return-Path: <sender@example.net> Delivery-Date: Mon, 08 Feb 2010 14:05:16 +0100 Received: from example.org (example.org [64.5.53.58]) by example.net (node=mxbap2) with ESMTP (Nemesis) id UNIQUE for someone@example.com; Mon, 08 Feb 2010 14:05:16 +0100 Date: Mon, 01 Feb 2010 12:21:16 +0100 From: "Sender" <sender...
816
24
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/data/msg_25.txt
From MAILER-DAEMON Fri Apr 06 16:46:09 2001 Received: from [204.245.199.98] (helo=zinfandel.lacita.com) by www.linux.org.uk with esmtp (Exim 3.13 #1) id 14lYR6-0008Iv-00 for linuxuser-admin@www.linux.org.uk; Fri, 06 Apr 2001 16:46:09 +0100 Received: from localhost (localhost) by zinfandel.lacita.com (8.7.3/8.6.10-MT...
5,122
118
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/data/msg_44.txt
Return-Path: <barry@python.org> Delivered-To: barry@python.org Received: by mail.python.org (Postfix, from userid 889) id C2BF0D37C6; Tue, 11 Sep 2001 00:05:05 -0400 (EDT) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="h90VIIIKmx" Content-Transfer-Encoding: 7bit Message-ID: <15261.36209.358846.118674@anthe...
895
34
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/data/msg_09.txt
MIME-Version: 1.0 From: Barry Warsaw <barry@python.org> To: Dingus Lovers <cravindogs@cravindogs.com> Subject: Lyrics Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="BOUNDARY" --BOUNDARY Content-Type: text/plain; charset="us-ascii" --BOUNDARY Content-Type: text/html; charset="iso-8859-...
432
25
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_email/data/msg_34.txt
From: aperson@dom.ain To: bperson@dom.ain Content-Type: multipart/digest; boundary=XYZ --XYZ Content-Type: text/plain This is a text plain part that is counter to recommended practice in RFC 2046, $5.1.5, but is not illegal --XYZ From: cperson@dom.ain To: dperson@dom.ain A submessage --XYZ--
300
20
jart/cosmopolitan
false