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/test_keywordonlyarg.py
"""Unit tests for the keyword only argument specified in PEP 3102.""" __author__ = "Jiwon Seo" __email__ = "seojiwon at gmail dot com" import unittest def posonly_sum(pos_arg1, *arg, **kwarg): return pos_arg1 + sum(arg) + sum(kwarg.values()) def keywordonly_sum(*, k1=0, k2): return k1 + k2 def keywordonly_no...
7,218
190
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_format.py
from test.support import verbose, TestFailed import locale import sys import test.support as support import unittest maxsize = support.MAX_Py_ssize_t # test string formatting operator (I am not sure if this is being tested # elsewhere but, surely, some of the given cases are *not* tested because # they crash python) ...
23,384
495
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/pstats.pck
{(u'/home/gbr/devel/python/Lib/sre_parse.pyiƒu __getitem__(i5i5g‹à+Ù±Q?g˶Óֈ`\?{(u)/home/gbr/devel/python/Lib/sre_compile.pyiju _compile_info(iigðh㈵øÔ>gíµ ÷Æà>(u'/home/gbr/devel/python/Lib/sre_parse.pyi‚u_parse(i†i†gà iTàd;?g›6ã4DE?(u)...
66,607
139
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/EUC-CN.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 ...
75,474
7,574
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_with.py
"""Unit tests for the with statement specified in PEP 343.""" __author__ = "Mike Bland" __email__ = "mbland at acm dot org" import sys import unittest from collections import deque from contextlib import _GeneratorContextManager, contextmanager class MockContextManager(_GeneratorContextManager): def __init__(s...
26,459
747
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_poll.py
# Test case for the os.poll() function import os import subprocess import random import select try: import _thread import threading except ImportError: threading = None import time import unittest from test.support import TESTFN, run_unittest, reap_threads, cpython_only try: select.poll except Attribu...
7,591
240
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_urllibnet.py
import unittest from test import support import contextlib import socket import urllib.request import os import email.message import time support.requires('network') class URLTimeoutTest(unittest.TestCase): # XXX this test doesn't seem to test anything useful. TIMEOUT = 30.0 def setUp(self): ...
9,041
219
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/relimport.py
from .test_import import *
27
2
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_exception_hierarchy.py
import builtins import os import select import socket import unittest import errno from errno import EEXIST class SubOSError(OSError): pass class SubOSErrorWithInit(OSError): def __init__(self, message, bar): self.bar = bar super().__init__(message) class SubOSErrorWithNew(OSError): def ...
7,403
205
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_multiprocessing_main_handling.py
# tests __main__ module handling in multiprocessing from test import support # Skip tests if _thread or _multiprocessing wasn't built. support.import_module('_thread') support.import_module('_multiprocessing') import importlib import importlib.machinery import unittest import sys import os import os.path import py_com...
11,643
295
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_parser.py
import copy import parser import pickle import unittest import operator import struct from test import support from test.support.script_helper import assert_python_failure # # First, we test that we can generate trees from valid source fragments, # and that these valid trees are indeed allowed by the tree-loading si...
33,153
921
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_sunau.py
import unittest from test import audiotests from audioop import byteswap import sys import sunau class SunauTest(audiotests.AudioWriteTests, audiotests.AudioTestsWithSourceFile): module = sunau class SunauPCM8Test(SunauTest, unittest.TestCase): sndfilename = 'pluck-pcm8.au' sndfilenframe...
4,631
122
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_sys_setprofile.py
import gc import pprint import sys import unittest class TestGetProfile(unittest.TestCase): def setUp(self): sys.setprofile(None) def tearDown(self): sys.setprofile(None) def test_empty(self): self.assertIsNone(sys.getprofile()) def test_setget(self): def fn(*args): ...
11,165
377
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/SHIFTJIS.TXT
# # Name: Shift-JIS to Unicode # Unicode version: 1.1 # Table version: 1.0 # Table format: Format A # Date: 2011 October 14 # # Copyright (c) 1994-2011 Unicode, Inc. All Rights reserved. # # This file is provided as-is by Unicode, Inc. (The Unicode Consortium). # No claims are made as t...
72,777
7,106
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_setcomps.py
doctests = """ ########### Tests mostly copied from test_listcomps.py ############ Test simple loop with conditional >>> sum({i*i for i in range(100) if i&1 == 1}) 166650 Test simple case >>> {2*y + x + 1 for x in (0,) for y in (1,)} {3} Test simple nesting >>> list(sorted({(i,j) for i in rang...
3,792
152
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/final_b.py
""" Fodder for module finalization tests in test_module. """ import shutil import test.final_a x = 'b' class C: def __del__(self): # Inspect module globals and builtins print("x =", x) print("final_a.x =", test.final_a.x) print("shutil.rmtree =", getattr(shutil.rmtree, '__name__',...
411
20
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
211,531
5,708
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_class.py
"Test the functionality of Python classes implementing operators." import unittest import cosmo testmeths = [ # Binary operations "add", "radd", "sub", "rsub", "mul", "rmul", "matmul", "rmatmul", "truediv", "rtruediv", "floordiv", "rfloordiv", "mod", "rmod", ...
15,576
603
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_long.py
import unittest from test import support import sys import random import math import array # SHIFT should match the value in longintrepr.h for best testing. SHIFT = sys.int_info.bits_per_digit BASE = 2 ** SHIFT MASK = BASE - 1 KARATSUBA_CUTOFF = 70 # from longobject.c # Max number of base BASE digits to use in te...
52,992
1,330
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import io import errno import os import time try: import ssl except ImportError: ssl = None from unittest import TestCase, skipUnless ...
40,578
1,122
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_ipaddress.py
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """Unittest for ipaddress module.""" import unittest import re import contextlib import functools import operator import pickle import ipaddress import weakref class BaseTestCase(unittest.TestCase): # One big change in ipaddress ove...
89,128
2,007
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_code_module.py
"Test InteractiveConsole and InteractiveInterpreter from code module" import sys import unittest from textwrap import dedent from contextlib import ExitStack from unittest import mock from test import support code = support.import_module('code') class TestInteractiveConsole(unittest.TestCase): def setUp(self): ...
5,646
155
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_argparse.py
# Author: Steven J. Bethard <steven.bethard@gmail.com>. import codecs import inspect import os import shutil import stat import sys import textwrap import tempfile import unittest import argparse from io import StringIO from test import support from unittest import mock class StdIOBuffer(StringIO): pass class T...
166,515
5,039
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_float.py
import fractions import operator import os import random import sys import struct import time import unittest from test import support from test.test_grammar import (VALID_UNDERSCORE_LITERALS, INVALID_UNDERSCORE_LITERALS) from math import isinf, isnan, copysign, ldexp INF = float("inf")...
64,439
1,446
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/badkey.pem
-----BEGIN RSA PRIVATE KEY----- Bad Key, though the cert should be OK -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE----- MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEw...
2,162
41
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_threading.py
""" Tests for the threading module. """ import test.support from test.support import (verbose, import_module, cpython_only, requires_type_collecting) from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import cosmo _thread = import_module('...
38,254
1,088
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/pyclbr_input.py
"""Test cases for test_pyclbr.py""" def f(): pass class Other(object): @classmethod def foo(c): pass def om(self): pass class B (object): def bm(self): pass class C (B): foo = Other().foo om = Other.om d = 10 # XXX: This causes test_pyclbr.py to fail, but only because the # ...
648
34
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_zipimport.py
import sys import os import marshal import importlib import importlib.util import struct import time import unittest from test import support from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED import zipimport import linecache import doctest import inspect import io from traceback import extract_tb, extr...
29,161
761
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_pkgimport.py
import os import sys import shutil import string import random import tempfile import unittest from importlib.util import cache_from_source from test.support import create_empty_file class TestImport(unittest.TestCase): def __init__(self, *args, **kw): self.package_name = 'PACKAGE_' while self.pa...
2,729
81
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/multibytecodec_support.py
# # multibytecodec_support.py # Common Unittest Routines for CJK codecs # import codecs import os import re import sys import unittest from test import support from io import BytesIO class TestBase: encoding = '' # codec name codec = None # codec tuple (with 4 elements) tstring ...
14,024
370
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_print.py
import unittest from io import StringIO from test import support NotDefined = object() # A dispatch table all 8 combinations of providing # sep, end, and file. # I use this machinery so that I'm not just passing default # values to print, I'm either passing or not passing in the # arguments. dispatch = { (False,...
4,258
133
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_hmac.py
import functools import hmac import hashlib import unittest import warnings def ignore_warning(func): @functools.wraps(func) def wrapper(*args, **kwargs): with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=PendingDeprecationWarnin...
20,486
497
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_enum.py
import enum import cosmo import inspect import pydoc import unittest from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL from test import support try: import _thread imp...
94,973
2,640
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_xml_etree.py
# IMPORTANT: the same tests are run from "test_xml_etree_c" in order # to ensure consistency between the C implementation and the Python # implementation. # # For this purpose, the module-level "ET" symbol is temporarily # monkey-patched when running the "test_xml_etree_c" test suite. import cosmo import copy import h...
118,224
3,199
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
215,352
5,692
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_getpass.py
import getpass import os import unittest from io import BytesIO, StringIO, TextIOWrapper from unittest import mock from test import support try: import termios except ImportError: termios = None try: import pwd except ImportError: pwd = None @mock.patch('os.environ') class GetpassGetuserTest(unittest....
6,437
164
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_bz2.py
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO, DEFAULT_BUFFER_SIZE import os import cosmo import pickle import glob import pathlib import random import shutil import subprocess import sys from test.support import unlink import _compression import sys from enco...
38,104
1,017
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_codecmaps_hk.py
# # test_codecmaps_hk.py # Codec mapping tests for HongKong encodings # from test import multibytecodec_support import unittest class TestBig5HKSCSMap(multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'big5hkscs' mapfileurl = '/zip/.python/test/BIG5HKSCS-2004.TXT...
370
16
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_dtrace.py
import dis import os.path import re import subprocess import sys import types import unittest from test.support import findfile, run_unittest def abspath(filename): return os.path.abspath(findfile(filename, subdir="dtracedata")) def normalize_trace_output(output): """Normalize DTrace output for comparison....
5,356
179
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_buffer.py
# # The ndarray object from _testbuffer.c is a complete implementation of # a PEP-3118 buffer provider. It is independent from NumPy's ndarray # and the tests don't require NumPy. # # If NumPy is present, some tests check both ndarray implementations # against each other. # # Most ndarray tests also check that memoryvi...
162,663
4,397
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_osx_env.py
""" Test suite for OS X interpreter environment variables. """ from test.support import EnvironmentVarGuard import subprocess import sys import sysconfig import unittest @unittest.skipUnless(sys.platform == 'darwin' and sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'), 'unnece...
1,328
35
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_codecs.py
import codecs import contextlib import io import locale import sys import unittest import encodings from test import support from encodings import ( aliases, base64_codec, big5, big5hkscs, bz2_codec, charmap, cp037, cp1006, cp1026, cp1125, cp1140, cp1250, cp1251, ...
130,113
3,414
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_symtable.py
""" Test the API of the symtable module. """ import symtable import unittest TEST_CODE = """ import sys glob = 42 class Mine: instance_var = 24 def a_method(p1, p2): pass def spam(a, b, *var, **kw): global bar bar = 47 x = 23 glob def internal(): return x return int...
6,951
194
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_pickle.py
from _compat_pickle import (IMPORT_MAPPING, REVERSE_IMPORT_MAPPING, NAME_MAPPING, REVERSE_NAME_MAPPING) import cosmo import builtins import pickle import io import collections import struct import sys import weakref import unittest from test import support from test.pickletester import Abs...
19,068
518
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/EUC-KR.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 ...
83,284
8,355
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_fcntl.py
"""Test program for the fcntl C module. """ import platform import os import struct import sys import unittest from test.support import (verbose, TESTFN, unlink, run_unittest, import_module, cpython_only) # Skip test if no fcntl module. fcntl = import_module('fcntl') if __name__ == 'PYOBJ.CO...
5,285
157
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_keyword.py
import cosmo import keyword import unittest from test import support import filecmp import os import sys import subprocess import shutil import textwrap KEYWORD_FILE = support.findfile('keyword.py') GRAMMAR_FILE = os.path.join(os.path.split(__file__)[0], ...
6,348
150
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_codecmaps_cn.py
# # test_codecmaps_cn.py # Codec mapping tests for PRC encodings # from test import multibytecodec_support import unittest class TestGB2312Map(multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gb2312' mapfileurl = '/zip/.python/test/EUC-CN.TXT' class TestGBKMap(mul...
697
26
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_cmd_line.py
# Tests invocation of the interpreter with various command line arguments # Most tests are executed with environment variables ignored # See test_cmd_line_script.py for testing of script execution import test.support, unittest import os import shutil import sys import subprocess import tempfile from test.support impor...
21,617
519
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_descr.py
import builtins import copyreg import gc import itertools import math import pickle import sys import cosmo import types import unittest import warnings import weakref from copy import deepcopy from test import support class OperatorsTest(unittest.TestCase): def __init__(self, *args, **kwargs): unittest...
187,168
5,475
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_unicode_file_functions.py
# Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import os import sys import unittest import warnings from unicodedata import normalize from test import support filenames = [ '1_abc', '2_ascii', '3_Gr\xfc\xdf-Gott'...
7,132
198
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_optparse.py
# # Test suite for Optik. Supplied by Johannes Gijsbers # (taradino@softhome.net) -- translated from the original Optik # test suite to this PyUnit-based version. # # $Id$ # import sys import os import re import copy import unittest from io import StringIO from test import support import optparse from optparse imp...
62,485
1,665
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_pathlib.py
import collections import io import os import errno import pathlib import pickle import socket import stat import tempfile import unittest from unittest import mock from test import support from test.support import TESTFN, FakePath try: import grp, pwd except ImportError: grp = pwd = None class _BaseFlavour...
90,501
2,254
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_ctypes.py
import unittest from test.support import import_module ctypes_test = import_module('ctypes.test') load_tests = ctypes_test.load_tests if __name__ == "__main__": unittest.main()
184
10
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_threadsignals.py
"""PyUnit testing that threads honor our signal semantics""" import unittest import signal import os import sys from test import support thread = support.import_module('_thread') import time if (sys.platform[:3] == 'win'): raise unittest.SkipTest("Can't test signal on %s" % sys.platform) process_pid = os.getpid(...
10,321
248
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/curses_tests.py
#!/usr/bin/env python3 # # $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $ # # Interactive test suite for the curses module. # This script displays various things and the user should verify whether # they display correctly. # import curses from curses import textpad def test_textpad(stdscr, insert_mode=False): ...
1,242
47
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_decorators.py
import unittest def funcattrs(**kwds): def decorate(func): func.__dict__.update(kwds) return func return decorate class MiscDecorators (object): @staticmethod def author(name): def decorate(func): func.__dict__['author'] = name return func return...
9,704
305
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_call.py
import collections import datetime import unittest from test.support import cpython_only try: import _testcapi except ImportError: _testcapi = None class FunctionCalls(unittest.TestCase): def test_kwargs_order(self): # bpo-34320: **kwargs should preserve order of passed OrderedDict od = ...
9,307
321
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_idle.py
import unittest from test.support import import_module # For 3.6, skip test_idle if threads are not supported. import_module('threading') # Imported by PyShell, imports _thread. # Skip test_idle if _tkinter wasn't built, if tkinter is missing, # if tcl/tk is not the 8.5+ needed for ttk widgets, # or if idlelib is mi...
941
28
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_msilib.py
""" Test suite for the code in msilib """ import os.path import unittest from test.support import TESTFN, import_module, unlink msilib = import_module('msilib') import msilib.schema def init_database(): path = TESTFN + '.msi' db = msilib.init_database( path, msilib.schema, 'Python Test...
3,113
100
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_global.py
"""Verify that warnings are issued for global statements following use.""" from test.support import run_unittest, check_syntax_error, check_warnings import unittest import warnings class GlobalTests(unittest.TestCase): def setUp(self): self._warnings_manager = check_warnings() self._warnings_man...
1,340
62
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/pickletester.py
import cosmo import collections import copyreg # import dbm import io import functools import pickle import pickletools import struct import sys import unittest import weakref from http.cookies import SimpleCookie from test import support from test.support import ( TestFailed, TESTFN, run_with_locale, no_tracing, ...
103,678
2,946
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_itertools.py
import unittest from test import support from itertools import * import weakref from decimal import Decimal from fractions import Fraction import operator import random import copy import pickle from functools import reduce import sys import struct maxsize = support.MAX_Py_ssize_t minsize = -maxsize-1 # [jart] test di...
100,412
2,467
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_atexit.py
import sys import cosmo import unittest import io import atexit from test import support from test.support import script_helper ### helpers def h1(): print("h1") def h2(): print("h2") def h3(): print("h3") def h4(*args, **kwargs): print("h4", args, kwargs) def raise1(): raise TypeError def rai...
5,430
211
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_secrets.py
"""Test the secrets module. As most of the functions in secrets are thin wrappers around functions defined elsewhere, we don't need to test them exhaustively. """ import secrets import unittest import string # === Unit tests === class Compare_Digest_Tests(unittest.TestCase): """Test secrets.compare_digest fun...
4,381
125
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_mailcap.py
import mailcap import os import copy import test.support import unittest # Location of mailcap file MAILCAPFILE = test.support.findfile("mailcap.txt") # Dict to act as mock mailcap entry for this test # The keys and values should match the contents of MAILCAPFILE MAILCAPDICT = { 'application/x-movie': [{'...
10,117
240
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_coroutines.py
import contextlib import copy import inspect import pickle import sys import cosmo import types import unittest import warnings from test import support class AsyncYieldFrom: def __init__(self, obj): self.obj = obj def __await__(self): yield from self.obj class AsyncYield: def __init__(...
59,518
2,233
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. import cosmo import os import pickle import random import re import subprocess import sys import sysconfig import textwrap import time import unittest from test import su...
24,459
603
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_ttk_guionly.py
import unittest from test import support # Skip this test if _tkinter wasn't built. support.import_module('_tkinter') # Skip test if tk cannot be initialized. support.requires('gui') import tkinter from _tkinter import TclError from tkinter import ttk from tkinter.test import runtktests root = None try: root = ...
746
35
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_signal.py
import unittest from test import support from contextlib import closing import enum import gc import os import pickle import random import select import signal import socket import statistics import subprocess import traceback import cosmo import sys, os, time, errno from test.support.script_helper import assert_python...
38,867
1,095
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_codecencodings_hk.py
# # test_codecencodings_hk.py # Codec encoding tests for HongKong encodings. # from test import multibytecodec_support import unittest class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase): encoding = 'big5hkscs' tstring = multibytecodec_support.load_teststring('big5hkscs') codectests...
701
23
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_hash.py
# test the invariant that # iff a==b then hash(a)==hash(b) # # Also test that hash implementations are inherited as expected import datetime import os import sys import unittest from test.support.script_helper import assert_python_ok from collections.abc import Hashable IS_64BIT = sys.maxsize > 2**32 def lcg(x, le...
11,721
347
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sortperf.py
"""Sort performance test. See main() for command line syntax. See tabulate() for output format. """ import sys import time import random import marshal import tempfile import os td = tempfile.gettempdir() def randfloats(n): """Return a list of n random floats in [0, 1).""" # Generating floats is expensive,...
4,806
170
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_heapq.py
"""Unittests for heapq.""" import heapq import random import unittest from test import support from unittest import TestCase, skipUnless from operator import itemgetter # heapq.nlargest/nsmallest are saved in heapq._nlargest/_smallest when # heapq is imported, so check them there func_names = ['heapify', 'heappop', ...
14,757
430
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_selectors.py
import errno import os import random import selectors import signal import socket import sys from test import support from time import sleep import unittest import unittest.mock import tempfile from time import monotonic as time try: import resource except ImportError: resource = None if __name__ == 'PYOBJ.COM'...
17,401
538
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_memoryio.py
"""Unit tests for memory-based file-like objects. StringIO -- for unicode strings BytesIO -- for bytes """ import unittest from test import support import io import _pyio as pyio import pickle import sys class MemorySeekTestMixin: def testInit(self): buf = self.buftype("1234567890") bytesIo = se...
31,021
844
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_copyreg.py
import copyreg import unittest from test.pickletester import ExtensionSaver class C: pass class WithoutSlots(object): pass class WithWeakref(object): __slots__ = ('__weakref__',) class WithPrivate(object): __slots__ = ('__spam',) class _WithLeadingUnderscoreAndPrivate(object): __slots__ = ('_...
4,498
127
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_enumerate.py
import unittest import operator import sys import pickle from test import support class G: 'Sequence using __getitem__' def __init__(self, seqn): self.seqn = seqn def __getitem__(self, i): return self.seqn[i] class I: 'Sequence using iterator protocol' def __init__(self, seqn): ...
8,087
270
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/sgml_input.html
<html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <link rel="stylesheet" type="text/css" href="http://ogame182.de/epicblue/formate.css"> <script language="JavaScript" src="js/flotten.js"></script> </head> <body> <script language=JavaScript> if (parent.frames.length == 0...
8,294
213
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/JOHAB.TXT
# # Name: Johab to Unicode table # Unicode version: 2.0 # Table version: 1.1 # Table format: Format A # Date: 2011 October 14 # Authors: Jungshik Shin at jshin@pantheon.yale.edu # # Copyright (c) 1999-2011 Unicode, Inc. All Rights reserved. # # This file is provided as-is by...
191,055
17,210
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_socketserver.py
""" Test suite for socketserver. """ import contextlib import io import os import select import signal import socket import tempfile import unittest import socketserver import test.support from test.support import reap_children, reap_threads, verbose try: import _thread import threading except ImportError: ...
17,545
505
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_future4.py
from __future__ import unicode_literals import unittest if __name__ == "__main__": unittest.main()
105
7
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_statistics.py
"""Test suite for statistics module, including helper NumericTestCase and approx_equal function. """ import cosmo import collections import decimal import doctest import math import random import sys import unittest from decimal import Decimal from fractions import Fraction # Module to be tested. import statistics...
76,220
1,996
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_unary.py
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2""" import unittest class UnaryOpTestCase(unittest.TestCase): def test_negative(self): self.assertTrue(-2 == 0 - 2) self.assertEqual(-0, 0) self.assertEqual(--2, 2) self.assertTrue(-2 == 0 - 2) self.a...
1,665
54
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_strptime.py
"""PyUnit testing against strptime""" import unittest import time import locale import re import os from test import support from datetime import date as datetime_date import _strptime class getlang_Tests(unittest.TestCase): """Test _getlang""" def test_basic(self): self.assertEqual(_strptime._getlan...
32,327
674
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_ucn.py
""" Test script for the Unicode implementation. Written by Bill Tutt. Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import unittest import unicodedata from test import support from http.client import HTTPException from test.test_normal...
9,576
238
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_fileinput.py
''' Tests for fileinput module. Nick Mathewson ''' import os import sys import re import fileinput import collections import builtins import tempfile import unittest try: import bz2 except ImportError: bz2 = None try: import gzip except ImportError: gzip = None from io import BytesIO, StringIO from fi...
37,476
979
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/keycert3.pem
-----BEGIN PRIVATE KEY----- MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCfKC83Qe9/ZGMW YhbpARRiKco6mJI9CNNeaf7A89TE+w5Y3GSwS8uzqp5C6QebZzPNueg8HYoTwN85 Z3xM036/Qw9KhQVth+XDAqM+19e5KHkYcxg3d3ZI1HgY170eakaLBvMDN5ULoFOw Is2PtwM2o9cjd5mfSuWttI6+fCqop8/l8cerG9iX2GH39p3iWwWoTZuYndAA9qYv 07YWajuQ1ESWKPjHYGTnMvu4xIzibC1m...
9,440
165
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_scope.py
import unittest import weakref from test.support import check_syntax_error, cpython_only class ScopeTests(unittest.TestCase): def testSimpleNesting(self): def make_adder(x): def adder(y): return x + y return adder inc = make_adder(1) plus10 = mak...
20,177
762
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_pipes.py
import pipes import os import string import unittest import shutil from test.support import TESTFN, run_unittest, unlink, reap_children if os.name != 'posix': raise unittest.SkipTest('pipes module only works on posix') TESTFN2 = TESTFN + "2" # tr a-z A-Z is not portable, so make the ranges explicit s_command = '...
6,751
204
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_bigaddrspace.py
""" These tests are meant to exercise that requests to create objects bigger than what the address space allows are properly met with an OverflowError (rather than crash weirdly). Primarily, this means 32-bit builds with at least 2 GB of available memory. You need to pass the -M option to regrtest (e.g. "-M 2.1G") for...
2,989
102
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_multibytecodec.py
# # test_multibytecodec.py # Unit test for multibytecodec itself # from test import support from test.support import TESTFN import unittest, io, codecs, sys import _multibytecodec from encodings import iso2022_jp ALL_CJKENCODINGS = [ # _codecs_cn 'gb2312', 'gbk', 'gb18030', 'hz', # _codecs_hk 'big5hkscs', #...
10,339
272
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_gc.py
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, temp_dir, requires_type_collecting, TESTFN, unlink) from test.support.script_helper import assert_python_ok, make_script import sys impor...
34,659
1,048
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_venv.py
""" Test harness for the venv module. Copyright (C) 2011-2012 Vinay Sajip. Licensed to the PSF under a contributor agreement. """ import ensurepip import os import os.path import re import struct import subprocess import sys import tempfile from test.support import (captured_stdout, captured_stderr, requires_zlib, ...
18,226
449
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/math_testcases.txt
-- Testcases for functions in math. -- -- Each line takes the form: -- -- <testid> <function> <input_value> -> <output_value> <flags> -- -- where: -- -- <testid> is a short name identifying the test, -- -- <function> is the function to be tested (exp, cos, asinh, ...), -- -- <input_value> is a string representing...
23,742
634
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_tuple.py
from test import support, seq_tests import unittest import gc import pickle class TupleTest(seq_tests.CommonTest): type2test = tuple def test_getitem_error(self): msg = "tuple indices must be integers or slices" with self.assertRaisesRegex(TypeError, msg): ()['a'] def test_co...
7,522
222
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/test_asyncore.py
import asyncore import unittest import select import os import socket import sys import time import errno import struct from test import support from io import BytesIO if support.PGO: raise unittest.SkipTest("test is not helpful for PGO") try: import _thread import threading except ImportError: threa...
26,931
849
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/nullbytecert.pem
Certificate: Data: Version: 3 (0x2) Serial Number: 0 (0x0) Signature Algorithm: sha1WithRSAEncryption Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org Validity ...
5,435
91
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/tokenize_tests.txt
# Tests for the 'tokenize' module. # Large bits stolen from test_grammar.py. # Comments "#" #' #" #\ # # abc '''# #''' x = 1 # # Balancing continuation a = (3, 4, 5, 6) y = [3, 4, 5] z = {'a':5, 'b':6} x = (len(repr(y)) + 5*x - a[ 3 ] - x + len({ } ) ) # Backslash means line conti...
2,718
190
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/test/CP949.TXT
# # Name: cp949 to Unicode table # Unicode version: 2.0 # Table version: 2.01 # Table format: Format A # Date: 1/7/2000 # # Contact: Shawn.Steele@microsoft.com # # General notes: none # # Format: Three tab-separated columns # Column #1 is the cp949 code (in hex) # ...
172,364
17,323
jart/cosmopolitan
false