repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
coveragepy
tests/plugin1.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """A file tracer plugin for test_plugins.py to import.""" from __future__ import annotations import os.path from types import FrameType from typing import Any ...
63
1,931
coveragepy
tests/test_results.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests for coverage.py's results analysis.""" from __future__ import annotations import math from collections.abc import Iterable from typing import cast imp...
197
6,613
coveragepy
tests/test_execfile.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests for coverage.execfile""" from __future__ import annotations import compileall import json import os import os.path import pathlib import py_compile imp...
350
11,560
coveragepy
tests/test_goldtest.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests of the helpers in goldtest.py""" from __future__ import annotations import os.path import re import pytest from tests.coveragetest import TESTS_DIR, ...
188
7,249
coveragepy
tests/test_files.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests for files.py""" from __future__ import annotations import itertools import os import os.path import re from collections.abc import Iterable from typing...
803
30,692
coveragepy
tests/helpers.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Helpers for coverage.py tests.""" from __future__ import annotations import collections import contextlib import dis import io import locale import os import...
416
13,194
coveragepy
tests/test_xml.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests for XML reports from coverage.py.""" from __future__ import annotations import os import os.path import re from collections.abc import Iterable from ty...
614
22,852
coveragepy
tests/test_plugins.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests for plugins.""" from __future__ import annotations import inspect import io import math import os.path from collections.abc import Iterable from typing...
1,331
46,198
coveragepy
tests/plugin_config.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """A configuring plugin for test_plugins.py to import.""" from __future__ import annotations from typing import Any, cast import coverage from coverage.plugin_...
33
1,026
coveragepy
tests/test_cmdline.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Test cmdline.py for coverage.py.""" from __future__ import annotations import ast import os import pprint import re import sys import textwrap from collectio...
1,797
56,738
coveragepy
tests/testenv.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Environment settings affecting tests.""" from __future__ import annotations import os from coverage import env # What core are we using, either requested o...
48
1,285
coveragepy
tests/test_data.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests for coverage.data, and coverage.sqldata.""" from __future__ import annotations import gc import glob import os import os.path import re import sqlite3 ...
1,168
43,224
coveragepy
tests/test_context.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests for context support.""" from __future__ import annotations import inspect import os.path from typing import Any from unittest import mock import pytes...
310
10,603
coveragepy
tests/test_html.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Tests that HTML generation is awesome.""" from __future__ import annotations import collections import datetime import glob import json import os import os.p...
1,633
59,761
coveragepy
tests/conftest.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Pytest auto configuration. This module is run automatically by pytest, to define and enable fixtures. """ from __future__ import annotations import os impo...
107
3,828
coveragepy
tests/zipsrc/zip1/zip1.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt # My zip file! lighter = "Zippo" says = "coo-coo cachoo"
8
216
coveragepy
tests/modules/covmod1.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt # covmod1.py: Simplest module for testing. i = 1 i += 1
7
214
coveragepy
tests/modules/namespace_420/sub1/__init__.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt sub1 = "namespace_420 sub1"
5
186
coveragepy
tests/modules/ambiguous/pkg1/ambiguous.py
.py
amb = 1 amb = 2
3
16
coveragepy
tests/modules/pkg1/__main__.py
.py
# Used in the tests for PyRunner import sys print("pkg1.__main__: passed %s" % sys.argv[1])
5
93
coveragepy
tests/modules/pkg1/__init__.py
.py
# A simple package for testing with. print(f"pkg1.__init__: {__name__}")
3
73
coveragepy
tests/modules/pkg1/p1b.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt x = 1 y = 2 z = 3
7
176
coveragepy
tests/modules/pkg1/p1c.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt a = 1 b = 2 c = 3
7
176
coveragepy
tests/modules/pkg1/sub/ps1a.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt d = 1 e = 2 f = 3
7
176
coveragepy
tests/modules/pkg1/sub/__main__.py
.py
# Used in the tests for PyRunner import sys print("pkg1.sub.__main__: passed %s" % sys.argv[1])
5
97
coveragepy
tests/modules/pkg2/p2a.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt q = 1 r = 1 s = 1
7
176
coveragepy
tests/modules/pkg2/p2b.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt t = 1 u = 1 v = 1
7
176
coveragepy
tests/modules/plugins/a_plugin.py
.py
"""A plugin for tests to reference.""" from __future__ import annotations from typing import Any from coverage import CoveragePlugin from coverage.plugin_support import Plugins class Plugin(CoveragePlugin): pass def coverage_init( reg: Plugins, options: Any, # pylint: disable=unused-argument ) -> No...
20
358
coveragepy
tests/modules/plugins/another.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """A plugin for tests to reference.""" from __future__ import annotations from typing import Any from coverage import CoveragePlugin from coverage.plugin_suppo...
23
516
coveragepy
tests/modules/process_test/try_execfile.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Test file for run_python_file. This file is executed two ways:: $ coverage run try_execfile.py and:: $ python try_execfile.py The output is compar...
127
3,542
coveragepy
tests/moremodules/namespace_420/sub2/__init__.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt sub2 = "namespace_420 sub2"
5
186
coveragepy
tests/moremodules/othermods/othera.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt o = 1 p = 2
6
170
coveragepy
tests/moremodules/othermods/otherb.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt q = 3 r = 4
6
170
coveragepy
tests/moremodules/othermods/sub/osa.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt s = 5 t = 6
6
170
coveragepy
tests/moremodules/othermods/sub/osb.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt u = 7 v = 8
6
170
coveragepy
doc/cog_helpers.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Functions for use with cog in the documentation. """ # For help text in doc/cmd.rst: # optparse wraps help to the COLUMNS value. Set it here to be sure it's...
107
3,150
coveragepy
lab/platform_info.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Dump information so we can get a quick look at what's available.""" import platform import sys def whatever(f): try: return f() except: ...
27
620
coveragepy
lab/parser.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Parser.py: a main for invoking code in coverage/parser.py""" import collections import dis import glob import optparse import os import re import sys import t...
221
7,482
coveragepy
lab/show_platform.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt import platform import types for n in dir(platform): if n.startswith("_"): continue v = getattr(platform, n) if isinstance(v, types.ModuleTyp...
20
482
coveragepy
lab/warn_executed.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ $ python warn_executed.py <coverage_data_file> <config_file> Find lines that were excluded by "warn-executed" regex patterns but were actually executed accor...
214
6,345
coveragepy
lab/show_pyc.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Dump the contents of a .pyc file. The output will only be correct if run with the same version of Python that produced the .pyc. """ import binascii import...
218
6,827
coveragepy
lab/run_trace.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Run a simple trace function on a file of Python code.""" import os, sys nest = 0 def trace(frame, event, arg): global nest if nest is None: ...
45
989
coveragepy
lab/goals.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """\ Check coverage goals. Use `coverage json` to get a coverage.json file, then run this tool to check goals for subsets of files. Patterns can use '**/foo*.py...
101
3,448
coveragepy
lab/select_contexts.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """\ Select certain contexts from a coverage.py data file. """ import argparse import re import sys import coverage def main(argv): parser = argparse.Argu...
67
2,174
coveragepy
lab/run_sysmon.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Run sys.monitoring on a file of Python code.""" import functools import sys print(sys.version) the_program = sys.argv[1] code = compile(open(the_program, en...
120
3,521
coveragepy
lab/parse_all.py
.py
"""Parse every Python file in a tree.""" import os import sys from coverage.parser import PythonParser for root, dirnames, filenames in os.walk(sys.argv[1]): for filename in filenames: if filename.endswith(".py"): filename = os.path.join(root, filename) print(f":: {filename}") ...
19
524
coveragepy
lab/pick.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Pick lines from the standard input. Blank or commented lines are ignored. Used to subset lists of tests to run. Use with the --select-cmd pytest plugin opt...
73
1,799
coveragepy
lab/hack_pyc.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Wicked hack to get .pyc files to do bytecode tracing instead of line tracing. """ import marshal, new, opcode, sys, types from lnotab import lnotab_numbers, ...
99
2,860
coveragepy
lab/extract_code.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Use this to copy some indented code from the coverage.py test suite into a standalone file for deeper testing, or writing bug reports. Give it a file name an...
73
2,220
coveragepy
lab/branches.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt # Demonstrate some issues with coverage.py branch testing. def my_function(x): """This isn't real code, just snippets...""" # An infinite loop is struc...
83
2,703
coveragepy
coverage/lcovreport.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """LCOV reporting for coverage.py.""" from __future__ import annotations import base64 import hashlib import sys from typing import IO, TYPE_CHECKING from cove...
238
8,527
coveragepy
coverage/pth_file.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt # pylint: disable=missing-module-docstring # pragma: exclude file from coverage # This will become the .pth file for subprocesses. import os if os.getenv("COVER...
17
525
coveragepy
coverage/types.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Types for use throughout coverage.py. """ from __future__ import annotations import os import pathlib from collections.abc import Callable, Iterable, Mappin...
198
5,503
coveragepy
coverage/parser.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Code parsing for coverage.py.""" from __future__ import annotations import ast import collections import os import re import token import tokenize from colle...
1,236
47,683
coveragepy
coverage/regions.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Find functions and classes in Python code.""" from __future__ import annotations import ast from dataclasses import dataclass from typing import cast from c...
128
4,503
coveragepy
coverage/files.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """File wrangling.""" from __future__ import annotations import abc import hashlib import ntpath import os import os.path import posixpath import re import sys ...
586
20,279
coveragepy
coverage/disposition.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Simple value objects for tracking what to do with files.""" from __future__ import annotations from typing import TYPE_CHECKING from coverage.types import T...
60
1,897
coveragepy
coverage/misc.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Miscellaneous stuff for coverage.py.""" from __future__ import annotations import contextlib import datetime import errno import functools import hashlib imp...
383
11,624
coveragepy
coverage/exceptions.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Exceptions coverage.py can raise.""" from __future__ import annotations from typing import Any class CoverageException(Exception): """The base class of...
68
1,550
coveragepy
coverage/plugin_support.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Support for plugins.""" from __future__ import annotations import os import os.path import sys from collections.abc import Callable, Iterable, Iterator from ...
296
10,369
coveragepy
coverage/sqlitedb.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """SQLite abstraction for coverage.py""" from __future__ import annotations import contextlib import re import sqlite3 from collections.abc import Iterable, Ite...
224
9,258
coveragepy
coverage/numbits.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Functions to manipulate packed binary representations of number sets. To save space, coverage stores sets of line numbers in SQLite using a packed binary rep...
165
5,318
coveragepy
coverage/sqldata.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """SQLite coverage data.""" from __future__ import annotations import base64 import collections import datetime import functools import glob import itertools im...
1,207
48,470
coveragepy
coverage/bytecode.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Bytecode analysis for coverage.py""" from __future__ import annotations import dis from collections.abc import Iterable, Mapping from types import CodeType ...
209
7,378
coveragepy
coverage/xmlreport.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """XML reporting for coverage.py""" from __future__ import annotations import os import os.path import sys import time import xml.dom.minidom from dataclasses i...
264
9,819
coveragepy
coverage/execfile.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Execute files of Python code.""" from __future__ import annotations import importlib.machinery import importlib.util import inspect import marshal import os ...
339
12,391
coveragepy
coverage/collector.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Raw data collector for coverage.py.""" from __future__ import annotations import contextlib import functools import os import sys from collections.abc import...
499
19,141
coveragepy
coverage/__init__.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ Code coverage measurement for Python. Ned Batchelder https://coverage.readthedocs.io """ from __future__ import annotations # mypy's convention is that "i...
42
1,118
coveragepy
coverage/pytracer.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Raw data collector for coverage.py.""" from __future__ import annotations import atexit import dis import itertools import sys import threading from collecti...
368
15,274
coveragepy
coverage/report_core.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Reporter foundation for coverage.py.""" from __future__ import annotations import sys from collections.abc import Callable, Iterable from typing import IO, T...
124
4,334
coveragepy
coverage/debug.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Control of and utilities for debugging.""" from __future__ import annotations import _thread import atexit import contextlib import datetime import functools...
668
21,791
coveragepy
coverage/html.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """HTML reporting for coverage.py.""" from __future__ import annotations import collections import dataclasses import datetime import functools import json impo...
864
31,877
coveragepy
coverage/patch.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Invasive patches for coverage.py.""" from __future__ import annotations import contextlib import os from typing import TYPE_CHECKING, Any, NoReturn from cov...
119
4,149
coveragepy
coverage/jsonreport.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Json reporting for coverage.py""" from __future__ import annotations import datetime import json import sys from collections.abc import Iterable from typing ...
201
7,493
coveragepy
coverage/data.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Coverage data for coverage.py. This file had the 4.x JSON data support, which is now gone. This file still has storage-agnostic helpers, and is kept to avoid...
269
9,524
coveragepy
coverage/version.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """The version and URL for coverage.py""" # This file is exec'ed in setup.py, don't import anything! from __future__ import annotations # version_info: same sem...
36
1,094
coveragepy
coverage/control.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Central control stuff for coverage.py.""" from __future__ import annotations import atexit import collections import contextlib import datetime import os imp...
1,521
56,026
coveragepy
coverage/context.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Determine contexts for coverage.py""" from __future__ import annotations from collections.abc import Sequence from types import FrameType from coverage.type...
75
2,434
coveragepy
coverage/templite.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """A simple Python template renderer, for a nano-subset of Django syntax. For a detailed discussion of this code, see this chapter from 500 Lines: http://aosaboo...
316
11,314
coveragepy
coverage/cmdline.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Command-line support for coverage.py.""" from __future__ import annotations import glob import optparse import os import os.path import shlex import signal i...
1,209
37,773
coveragepy
coverage/multiproc.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Monkey-patching to add multiprocessing support for coverage.py""" from __future__ import annotations import multiprocessing import multiprocessing.process im...
121
4,175
coveragepy
coverage/inorout.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Determining whether files are being measured/reported or not.""" from __future__ import annotations import importlib.util import inspect import itertools imp...
652
25,400
coveragepy
coverage/tomlconfig.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """TOML configuration support for coverage.py""" from __future__ import annotations import os import re from collections.abc import Callable, Iterable from typi...
211
7,606
coveragepy
coverage/config.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Config file for coverage.py""" from __future__ import annotations import base64 import collections import configparser import copy import json import os impo...
733
26,013
coveragepy
coverage/env.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Determine facts about the environment.""" from __future__ import annotations import os import platform import sys import sysconfig from collections.abc impor...
143
5,273
coveragepy
coverage/results.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Results of coverage measurement.""" from __future__ import annotations import collections from collections.abc import Iterable from dataclasses import datacl...
506
17,355
coveragepy
coverage/python.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Python source expertise for coverage.py""" from __future__ import annotations import os.path import types import zipimport from collections.abc import Iterab...
272
8,732
coveragepy
coverage/plugin.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """ .. version-added:: 4.0 Plug-in interfaces for coverage.py. Coverage.py supports a few different kinds of plug-ins that change its behavior: * File tracers ...
617
21,500
coveragepy
coverage/sysmon.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Callback functions and support for sys.monitoring data collection.""" from __future__ import annotations import collections import functools import inspect i...
504
19,627
coveragepy
coverage/annotate.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Source file annotation for coverage.py.""" from __future__ import annotations import os import re from typing import TYPE_CHECKING from coverage.files impor...
114
3,699
coveragepy
coverage/phystokens.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Better tokenizing for coverage.py.""" from __future__ import annotations import ast import io import keyword import re import sys import token import tokeniz...
210
8,140
coveragepy
coverage/report.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Summary reporting""" from __future__ import annotations import string import sys from collections.abc import Iterable from typing import IO, TYPE_CHECKING, A...
308
10,998
coveragepy
coverage/core.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Management of core choices.""" from __future__ import annotations import os import sys from typing import Any from coverage import env from coverage.config ...
142
5,504
coveragepy
ci/trigger_action.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Trigger a repository_dispatch GitHub action.""" import sys import time from session import get_session # The GitHub URL makes no mention of which workflow t...
56
1,552
coveragepy
ci/session.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Help make a requests Session with proper authentication.""" import os import sys import requests _SESSIONS = {} def get_session(env="GITHUB_TOKEN"): "...
34
927
coveragepy
ci/comment_on_fixes.py
.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt """Add a release comment to all the issues mentioned in the latest release.""" import re import sys from scriv.scriv import Scriv from session import get_sessio...
60
2,000
coveragepy
ci/update_rtfd.py
.py
""" Update ReadTheDocs to show and hide releases. """ import re import sys from session import get_session # How many from each level to show. NUM_MAJORS = 3 NUM_MINORS = 3 OLD_MINORS = 1 NUM_MICROS = 1 OLD_MICROS = 1 def get_all_versions(project): """Pull all the versions for a project from ReadTheDocs.""" ...
108
3,002
asgiref
setup.py
.py
from setuptools import setup # type: ignore[import-untyped] setup()
4
70
asgiref
tests/test_server.py
.py
import asyncio import socket as sock import threading import pytest import pytest_asyncio from asgiref.server import StatelessServer async def sock_recvfrom(sock, n): while True: try: return sock.recvfrom(n) except BlockingIOError: await asyncio.sleep(0) class Server(St...
186
5,238
asgiref
tests/test_testing.py
.py
import asyncio import pytest from asgiref.testing import ApplicationCommunicator from asgiref.wsgi import WsgiToAsgi @pytest.mark.asyncio async def test_receive_nothing(): """ Tests ApplicationCommunicator.receive_nothing to return the correct value. """ # Get an ApplicationCommunicator instance ...
93
2,797