From 033cc0b4803697ecd6fba7c6c890a2d9df419822 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2020 07:25:13 -0400 Subject: [PATCH 01/23] Scooch --- CHANGES.rst | 4 ++++ coverage/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 28c1f4cd7..49d1cbb3d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,6 +22,10 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. .. ---------------------------- +Unreleased +---------- + + .. _changes_521: Version 5.2.1 --- 2020-07-23 diff --git a/coverage/version.py b/coverage/version.py index 93f843ec5..b4a503376 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 2, 1, "final", 0) +version_info = (5, 2, 2, "alpha", 0) def _make_version(major, minor, micro, releaselevel, serial): From 5a30c8d82aa942ce882fda8dbf16f5ec6f9608c4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2020 07:36:28 -0400 Subject: [PATCH 02/23] Doc process tweaks --- howto.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/howto.txt b/howto.txt index 10a90232b..1ad455d35 100644 --- a/howto.txt +++ b/howto.txt @@ -82,7 +82,7 @@ - @ https://readthedocs.org/projects/coverage/versions/ - find the latest tag in the inactive list, edit it, make it active. - readthedocs won't find the tag until a commit is made on master. - - keep just the latest version of each x.y release, make the rest inactive. + - keep just the latest version of each x.y release, make the rest active but hidden. - IF NOT PRE-RELEASE: - update git "stable" branch to point to latest release $ git branch -f stable From 348aa47798d5d315c11d568eb87165b857d547e6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2020 22:08:29 -0400 Subject: [PATCH 03/23] Help in docs didn't work with tmp --- Makefile | 11 +++++------ doc/cmd.rst | 18 +++++++++--------- doc/help/annotate.rst | 26 ++++++++++++++++++++++++++ doc/help/combine.rst | 21 +++++++++++++++++++++ doc/help/debug.rst | 18 ++++++++++++++++++ doc/help/erase.rst | 15 +++++++++++++++ doc/help/html.rst | 39 +++++++++++++++++++++++++++++++++++++++ doc/help/json.rst | 33 +++++++++++++++++++++++++++++++++ doc/help/report.rst | 38 ++++++++++++++++++++++++++++++++++++++ doc/help/run.rst | 42 ++++++++++++++++++++++++++++++++++++++++++ doc/help/xml.rst | 28 ++++++++++++++++++++++++++++ 11 files changed, 274 insertions(+), 15 deletions(-) create mode 100644 doc/help/annotate.rst create mode 100644 doc/help/combine.rst create mode 100644 doc/help/debug.rst create mode 100644 doc/help/erase.rst create mode 100644 doc/help/html.rst create mode 100644 doc/help/json.rst create mode 100644 doc/help/report.rst create mode 100644 doc/help/run.rst create mode 100644 doc/help/xml.rst diff --git a/Makefile b/Makefile index 0c65bb526..780424afd 100644 --- a/Makefile +++ b/Makefile @@ -138,18 +138,17 @@ $(DOCBIN): tox -q -e doc --notest cmd_help: $(DOCBIN) - mkdir -p tmp for cmd in annotate combine debug erase html json report run xml; do \ - echo > tmp/$$cmd.rst; \ - echo ".. code::" >> tmp/$$cmd.rst; \ - echo >> tmp/$$cmd.rst; \ - echo " $$ coverage $$cmd --help" >> tmp/$$cmd.rst; \ + echo > doc/help/$$cmd.rst; \ + echo ".. code::" >> doc/help/$$cmd.rst; \ + echo >> doc/help/$$cmd.rst; \ + echo " $$ coverage $$cmd --help" >> doc/help/$$cmd.rst; \ $(DOCBIN)/python -m coverage $$cmd --help | \ sed \ -e 's/__main__.py/coverage/' \ -e '/^Full doc/d' \ -e 's/^/ /' \ - >> tmp/$$cmd.rst; \ + >> doc/help/$$cmd.rst; \ done dochtml: $(DOCBIN) cmd_help ## Build the docs HTML output. diff --git a/doc/cmd.rst b/doc/cmd.rst index 1edc19c69..b294ee8db 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -90,7 +90,7 @@ Python ``-m`` switch:: There are many options: -.. include:: ../tmp/run.rst +.. include:: help/run.rst If you want :ref:`branch coverage ` measurement, use the ``--branch`` flag. Otherwise only statement coverage is measured. @@ -287,7 +287,7 @@ setting to store relative file paths (see :ref:`relative_files If any of the data files can't be read, coverage.py will print a warning indicating the file and the problem. -.. include:: ../tmp/combine.rst +.. include:: help/combine.rst .. _cmd_erase: @@ -297,7 +297,7 @@ Erase data: ``coverage erase`` To erase the collected data, use the **erase** command: -.. include:: ../tmp/erase.rst +.. include:: help/erase.rst If your configuration file indicates parallel data collection, **erase** will remove all of the data files. @@ -351,7 +351,7 @@ For each module executed, the report shows the count of executable statements, the number of those statements missed, and the resulting coverage, expressed as a percentage. -.. include:: ../tmp/report.rst +.. include:: help/report.rst The ``-m`` flag also shows the line numbers of missing statements:: @@ -426,7 +426,7 @@ the highlighting. A number of keyboard shortcuts are available for navigating the report. Click the keyboard icon in the upper right to see the complete list. -.. include:: ../tmp/html.rst +.. include:: help/html.rst The title of the report can be set with the ``title`` setting in the ``[html]`` section of the configuration file, or the ``--title`` switch on @@ -470,7 +470,7 @@ compatible with `Cobertura`_. .. _Cobertura: http://cobertura.github.io/cobertura/ -.. include:: ../tmp/xml.rst +.. include:: help/xml.rst You can specify the name of the output file with the ``-o`` switch. @@ -484,7 +484,7 @@ JSON reporting: ``coverage json`` The **json** command writes coverage data to a "coverage.json" file. -.. include:: ../tmp/json.rst +.. include:: help/json.rst You can specify the name of the output file with the ``-o`` switch. The JSON can be nicely formatted by specifying the ``--pretty-print`` switch. @@ -521,7 +521,7 @@ For example:: > else: > a = 2 -.. include:: ../tmp/annotate.rst +.. include:: help/annotate.rst Other common reporting options are described above in :ref:`cmd_reporting`. @@ -544,7 +544,7 @@ Three types of information are available: * ``data``: show a summary of the collected coverage data * ``premain``: show the call stack invoking coverage -.. include:: ../tmp/debug.rst +.. include:: help/debug.rst .. _cmd_run_debug: diff --git a/doc/help/annotate.rst b/doc/help/annotate.rst new file mode 100644 index 000000000..fb80e12ee --- /dev/null +++ b/doc/help/annotate.rst @@ -0,0 +1,26 @@ + +.. code:: + + $ coverage annotate --help + Usage: coverage annotate [options] [modules] + + Make annotated copies of the given files, marking statements that are executed + with > and statements that are missed with !. + + Options: + -d DIR, --directory=DIR + Write the output files to DIR. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/combine.rst b/doc/help/combine.rst new file mode 100644 index 000000000..bf15c23f6 --- /dev/null +++ b/doc/help/combine.rst @@ -0,0 +1,21 @@ + +.. code:: + + $ coverage combine --help + Usage: coverage combine [options] ... + + Combine data from multiple coverage files collected with 'run -p'. The + combined results are written to a single file representing the union of the + data. The positional arguments are data files or directories containing data + files. If no paths are provided, data files in the default data file's + directory are combined. + + Options: + -a, --append Append coverage data to .coverage, otherwise it starts + clean each time. + --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. + [env: COVERAGE_RCFILE] + diff --git a/doc/help/debug.rst b/doc/help/debug.rst new file mode 100644 index 000000000..7c71e90e8 --- /dev/null +++ b/doc/help/debug.rst @@ -0,0 +1,18 @@ + +.. code:: + + $ coverage debug --help + Usage: coverage debug + + Display information about the internals of coverage.py, for diagnosing + problems. Topics are: 'data' to show a summary of the collected data; 'sys' to + show installation information; 'config' to show the configuration; 'premain' + to show what is calling coverage. + + Options: + --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. + [env: COVERAGE_RCFILE] + diff --git a/doc/help/erase.rst b/doc/help/erase.rst new file mode 100644 index 000000000..2bb64800f --- /dev/null +++ b/doc/help/erase.rst @@ -0,0 +1,15 @@ + +.. code:: + + $ coverage erase --help + Usage: coverage erase [options] + + Erase previously collected coverage data. + + Options: + --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. + [env: COVERAGE_RCFILE] + diff --git a/doc/help/html.rst b/doc/help/html.rst new file mode 100644 index 000000000..5be947112 --- /dev/null +++ b/doc/help/html.rst @@ -0,0 +1,39 @@ + +.. code:: + + $ coverage html --help + Usage: coverage html [options] [modules] + + Create an HTML report of the coverage of the files. Each file gets its own + page, with the source decorated to show executed, excluded, and missed lines. + + Options: + --contexts=REGEX1,REGEX2,... + Only display data from lines covered in the given + contexts. Accepts Python regexes, which must be + quoted. + -d DIR, --directory=DIR + Write the output files to DIR. + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + --precision=N Number of digits after the decimal point to display + for reported coverage percentages. + --show-contexts Show contexts for covered lines. + --skip-covered Skip files with 100% coverage. + --no-skip-covered Disable --skip-covered. + --skip-empty Skip files with no code. + --title=TITLE A text string to use as the title on the HTML. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/json.rst b/doc/help/json.rst new file mode 100644 index 000000000..4028788fc --- /dev/null +++ b/doc/help/json.rst @@ -0,0 +1,33 @@ + +.. code:: + + $ coverage json --help + Usage: coverage json [options] [modules] + + Generate a JSON report of coverage results. + + Options: + --contexts=REGEX1,REGEX2,... + Only display data from lines covered in the given + contexts. Accepts Python regexes, which must be + quoted. + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + -o OUTFILE Write the JSON report to this file. Defaults to + 'coverage.json' + --pretty-print Format the JSON for human readers. + --show-contexts Show contexts for covered lines. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/report.rst b/doc/help/report.rst new file mode 100644 index 000000000..97f31777d --- /dev/null +++ b/doc/help/report.rst @@ -0,0 +1,38 @@ + +.. code:: + + $ coverage report --help + Usage: coverage report [options] [modules] + + Report coverage statistics on modules. + + Options: + --contexts=REGEX1,REGEX2,... + Only display data from lines covered in the given + contexts. Accepts Python regexes, which must be + quoted. + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + --precision=N Number of digits after the decimal point to display + for reported coverage percentages. + --sort=COLUMN Sort the report by the named column: name, stmts, + miss, branch, brpart, or cover. Default is name. + -m, --show-missing Show line numbers of statements in each module that + weren't executed. + --skip-covered Skip files with 100% coverage. + --no-skip-covered Disable --skip-covered. + --skip-empty Skip files with no code. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/run.rst b/doc/help/run.rst new file mode 100644 index 000000000..07f94aa5d --- /dev/null +++ b/doc/help/run.rst @@ -0,0 +1,42 @@ + +.. code:: + + $ coverage run --help + Usage: coverage run [options] [program options] + + Run a Python program, measuring code execution. + + Options: + -a, --append Append coverage data to .coverage, otherwise it starts + clean each time. + --branch Measure branch coverage in addition to statement + coverage. + --concurrency=LIB Properly measure code using a concurrency library. + Valid values are: thread, gevent, greenlet, eventlet, + multiprocessing. + --context=LABEL The context label to record for this coverage run. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + -m, --module is an importable Python module, not a script + path, to be run as 'python -m' would run it. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + -L, --pylib Measure coverage even inside the Python installed + library, which isn't done by default. + -p, --parallel-mode Append the machine name, process id and random number + to the .coverage data file name to simplify collecting + data from many processes. + --source=SRC1,SRC2,... + A list of packages or directories of code to be + measured. + --timid Use a simpler but slower trace method. Try this if you + get seemingly impossible results! + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/xml.rst b/doc/help/xml.rst new file mode 100644 index 000000000..f83f297b5 --- /dev/null +++ b/doc/help/xml.rst @@ -0,0 +1,28 @@ + +.. code:: + + $ coverage xml --help + Usage: coverage xml [options] [modules] + + Generate an XML report of coverage results. + + Options: + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + -o OUTFILE Write the XML report to this file. Defaults to + 'coverage.xml' + --skip-empty Skip files with no code. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + From b8ff7bf98b7c84932f2131e0d2b8aca1e2ab141c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Aug 2020 07:47:53 -0400 Subject: [PATCH 04/23] Correct the indentation --- tox.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 67a533bbb..88fbbd688 100644 --- a/tox.ini +++ b/tox.ini @@ -90,9 +90,9 @@ commands = [travis] #2.7: py27, lint python = - 2.7: py27 - 3.5: py35 - 3.6: py36 - 3.7: py37 - pypy: pypy - pypy3.5: pypy3 + 2.7: py27 + 3.5: py35 + 3.6: py36 + 3.7: py37 + pypy: pypy + pypy3.5: pypy3 From aa6cb95e366f479cddd8cd30aee940393ead6296 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 16 Aug 2020 12:58:05 -0400 Subject: [PATCH 05/23] Don't build the help includes into HTML --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 5bd101c37..d2a787dc5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -97,7 +97,7 @@ # List of directories, relative to source directory, that shouldn't be searched # for source files. -exclude_trees = ['_build'] +exclude_patterns = ["_build", "help/*"] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None From 450ac0bf86afb89f800e638ed6b4aed20c678c21 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 19:33:26 -0400 Subject: [PATCH 06/23] Prevent trailing whitespace in doc/help/* files --- Makefile | 2 +- doc/help/annotate.rst | 6 +++--- doc/help/combine.rst | 6 +++--- doc/help/debug.rst | 6 +++--- doc/help/erase.rst | 6 +++--- doc/help/html.rst | 6 +++--- doc/help/json.rst | 6 +++--- doc/help/report.rst | 6 +++--- doc/help/run.rst | 6 +++--- doc/help/xml.rst | 6 +++--- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 780424afd..7b383bbca 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ cmd_help: $(DOCBIN) sed \ -e 's/__main__.py/coverage/' \ -e '/^Full doc/d' \ - -e 's/^/ /' \ + -e 's/^./ &/' \ >> doc/help/$$cmd.rst; \ done diff --git a/doc/help/annotate.rst b/doc/help/annotate.rst index fb80e12ee..8f0883a04 100644 --- a/doc/help/annotate.rst +++ b/doc/help/annotate.rst @@ -3,10 +3,10 @@ $ coverage annotate --help Usage: coverage annotate [options] [modules] - + Make annotated copies of the given files, marking statements that are executed with > and statements that are missed with !. - + Options: -d DIR, --directory=DIR Write the output files to DIR. @@ -23,4 +23,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/combine.rst b/doc/help/combine.rst index bf15c23f6..35180cdde 100644 --- a/doc/help/combine.rst +++ b/doc/help/combine.rst @@ -3,13 +3,13 @@ $ coverage combine --help Usage: coverage combine [options] ... - + Combine data from multiple coverage files collected with 'run -p'. The combined results are written to a single file representing the union of the data. The positional arguments are data files or directories containing data files. If no paths are provided, data files in the default data file's directory are combined. - + Options: -a, --append Append coverage data to .coverage, otherwise it starts clean each time. @@ -18,4 +18,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/debug.rst b/doc/help/debug.rst index 7c71e90e8..db1e64b26 100644 --- a/doc/help/debug.rst +++ b/doc/help/debug.rst @@ -3,16 +3,16 @@ $ coverage debug --help Usage: coverage debug - + Display information about the internals of coverage.py, for diagnosing problems. Topics are: 'data' to show a summary of the collected data; 'sys' to show installation information; 'config' to show the configuration; 'premain' to show what is calling coverage. - + Options: --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] -h, --help Get help on this command. --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/erase.rst b/doc/help/erase.rst index 2bb64800f..c8f45155a 100644 --- a/doc/help/erase.rst +++ b/doc/help/erase.rst @@ -3,13 +3,13 @@ $ coverage erase --help Usage: coverage erase [options] - + Erase previously collected coverage data. - + Options: --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] -h, --help Get help on this command. --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/html.rst b/doc/help/html.rst index 5be947112..8dfa285aa 100644 --- a/doc/help/html.rst +++ b/doc/help/html.rst @@ -3,10 +3,10 @@ $ coverage html --help Usage: coverage html [options] [modules] - + Create an HTML report of the coverage of the files. Each file gets its own page, with the source decorated to show executed, excluded, and missed lines. - + Options: --contexts=REGEX1,REGEX2,... Only display data from lines covered in the given @@ -36,4 +36,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/json.rst b/doc/help/json.rst index 4028788fc..cec488e55 100644 --- a/doc/help/json.rst +++ b/doc/help/json.rst @@ -3,9 +3,9 @@ $ coverage json --help Usage: coverage json [options] [modules] - + Generate a JSON report of coverage results. - + Options: --contexts=REGEX1,REGEX2,... Only display data from lines covered in the given @@ -30,4 +30,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/report.rst b/doc/help/report.rst index 97f31777d..3408f2bb4 100644 --- a/doc/help/report.rst +++ b/doc/help/report.rst @@ -3,9 +3,9 @@ $ coverage report --help Usage: coverage report [options] [modules] - + Report coverage statistics on modules. - + Options: --contexts=REGEX1,REGEX2,... Only display data from lines covered in the given @@ -35,4 +35,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/run.rst b/doc/help/run.rst index 07f94aa5d..a336929a5 100644 --- a/doc/help/run.rst +++ b/doc/help/run.rst @@ -3,9 +3,9 @@ $ coverage run --help Usage: coverage run [options] [program options] - + Run a Python program, measuring code execution. - + Options: -a, --append Append coverage data to .coverage, otherwise it starts clean each time. @@ -39,4 +39,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/xml.rst b/doc/help/xml.rst index f83f297b5..eb52750d4 100644 --- a/doc/help/xml.rst +++ b/doc/help/xml.rst @@ -3,9 +3,9 @@ $ coverage xml --help Usage: coverage xml [options] [modules] - + Generate an XML report of coverage results. - + Options: --fail-under=MIN Exit with a status of 2 if the total coverage is less than MIN. @@ -25,4 +25,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + From 1bf2a0609e7673b6b0dffe3123a760ab4a3c0be6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:00:03 -0400 Subject: [PATCH 07/23] Bitbucket hg repos are gone --- CHANGES.rst | 516 ++++++++++++++++++++++----------------------- doc/plugins.rst | 2 +- doc/trouble.rst | 2 +- doc/whatsnew5x.rst | 2 +- 4 files changed, 261 insertions(+), 261 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 49d1cbb3d..0bbf4d34b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -576,7 +576,7 @@ Version 5.0a2 --- 2018-09-03 - pickle2json, for converting v3 data files to v4 data files, has been removed. -.. _Bitbucket: https://bitbucket.org/ned/coveragepy +.. _Bitbucket: https://bitbucket.org .. _GitHub: https://github.com/nedbat/coveragepy .. _issue 611: https://github.com/nedbat/coveragepy/issues/611 @@ -604,8 +604,8 @@ Version 5.0a1 --- 2018-06-05 - Large HTML report pages load faster. Thanks, Pankaj Pandey. -.. _issue 625: https://bitbucket.org/ned/coveragepy/issues/625/lstat-dominates-in-the-case-of-small -.. _issue 650: https://bitbucket.org/ned/coveragepy/issues/650/allow-setting-configuration-file-location +.. _issue 625: https://github.com/nedbat/coveragepy/issues/625 +.. _issue 650: https://github.com/nedbat/coveragepy/issues/650 .. _issue 700: https://github.com/nedbat/coveragepy/issues/700 @@ -645,7 +645,7 @@ Version 4.5.2 --- 2018-11-12 .. _issue 707: https://github.com/nedbat/coveragepy/issues/707 .. _issue 714: https://github.com/nedbat/coveragepy/issues/714 -.. _Bitbucket: https://bitbucket.org/ned/coveragepy +.. _Bitbucket: https://bitbucket.org .. _GitHub: https://github.com/nedbat/coveragepy @@ -665,8 +665,8 @@ Version 4.5.1 --- 2018-02-10 - Configurer plugins are now reported in the output of ``--debug=sys``. -.. _issue 638: https://bitbucket.org/ned/coveragepy/issues/638/run-omit-is-ignored-since-45 -.. _issue 640: https://bitbucket.org/ned/coveragepy/issues/640/indexerror-reporting-on-an-empty-decorated +.. _issue 638: https://github.com/nedbat/coveragepy/issues/638 +.. _issue 640: https://github.com/nedbat/coveragepy/issues/640 .. _changes_45: @@ -705,13 +705,13 @@ Version 4.5 --- 2018-02-03 maximum. Now filenames will never get much larger than 200 characters, fixing `issue 627`_. Thanks to Alex Sandro for helping with the fix. -.. _issue 563: https://bitbucket.org/ned/coveragepy/issues/563/platform-specific-configuration -.. _issue 618: https://bitbucket.org/ned/coveragepy/issues/618/problem-when-combining-windows-generated -.. _issue 621: https://bitbucket.org/ned/coveragepy/issues/621/include-ignored-warning-when-using -.. _issue 622: https://bitbucket.org/ned/coveragepy/issues/622/report-omit-overwrites-run-omit -.. _issue 627: https://bitbucket.org/ned/coveragepy/issues/627/failure-generating-html-reports-when-the -.. _issue 629: https://bitbucket.org/ned/coveragepy/issues/629/multiple-use-of-combine-leads-to-empty -.. _issue 631: https://bitbucket.org/ned/coveragepy/issues/631/precise-coverage-percentage-value +.. _issue 563: https://github.com/nedbat/coveragepy/issues/563 +.. _issue 618: https://github.com/nedbat/coveragepy/issues/618 +.. _issue 621: https://github.com/nedbat/coveragepy/issues/621 +.. _issue 622: https://github.com/nedbat/coveragepy/issues/622 +.. _issue 627: https://github.com/nedbat/coveragepy/issues/627 +.. _issue 629: https://github.com/nedbat/coveragepy/issues/629 +.. _issue 631: https://github.com/nedbat/coveragepy/issues/631 .. _changes_442: @@ -743,11 +743,11 @@ Version 4.4.2 --- 2017-11-05 - Be more flexible about the command name displayed by help, fixing `issue 600`_. Thanks, Ben Finney. -.. _issue 101: https://bitbucket.org/ned/coveragepy/issues/101/settings-under-report-affect-running -.. _issue 581: https://bitbucket.org/ned/coveragepy/issues/581/race-condition-when-saving-data-under -.. _issue 588: https://bitbucket.org/ned/coveragepy/issues/588/using-rcfile-path-to-toxini-uses-run -.. _issue 589: https://bitbucket.org/ned/coveragepy/issues/589/allow-expansion-in-coveragerc -.. _issue 600: https://bitbucket.org/ned/coveragepy/issues/600/get-program-name-from-command-line-when +.. _issue 101: https://github.com/nedbat/coveragepy/issues/101 +.. _issue 581: https://github.com/nedbat/coveragepy/issues/581 +.. _issue 588: https://github.com/nedbat/coveragepy/issues/588 +.. _issue 589: https://github.com/nedbat/coveragepy/issues/589 +.. _issue 600: https://github.com/nedbat/coveragepy/issues/600 .. _changes_441: @@ -783,10 +783,10 @@ Version 4.4 --- 2017-05-07 - Running ``coverage xml`` in a directory named with non-ASCII characters would fail under Python 2. This is now fixed. (`issue 573`_) -.. _issue 526: https://bitbucket.org/ned/coveragepy/issues/526/generated-xml-invalid-paths-for-cobertura -.. _issue 572: https://bitbucket.org/ned/coveragepy/issues/572/no-python-source-warning-for-namespace -.. _issue 573: https://bitbucket.org/ned/coveragepy/issues/573/cant-generate-xml-report-if-some-source -.. _issue 575: https://bitbucket.org/ned/coveragepy/issues/575/running-doctest-prevents-complete-coverage +.. _issue 526: https://github.com/nedbat/coveragepy/issues/526 +.. _issue 572: https://github.com/nedbat/coveragepy/issues/572 +.. _issue 573: https://github.com/nedbat/coveragepy/issues/573 +.. _issue 575: https://github.com/nedbat/coveragepy/issues/575 Version 4.4b1 --- 2017-04-04 @@ -818,11 +818,11 @@ Version 4.4b1 --- 2017-04-04 the coverage of the standard library tests. This code was not installed by kitted versions of coverage.py. Now it is. -.. _issue 79: https://bitbucket.org/ned/coveragepy/issues/79/save-prevents-harvesting-on-stop -.. _issue 96: https://bitbucket.org/ned/coveragepy/issues/96/unhelpful-warnings-produced-when-using -.. _issue 355: https://bitbucket.org/ned/coveragepy/issues/355/warnings-should-be-suppressable -.. _issue 448: https://bitbucket.org/ned/coveragepy/issues/448/save-and-html_report-prevent-further -.. _issue 570: https://bitbucket.org/ned/coveragepy/issues/570/cobertura-coverage-04dtd-support +.. _issue 79: https://github.com/nedbat/coveragepy/issues/79 +.. _issue 96: https://github.com/nedbat/coveragepy/issues/96 +.. _issue 355: https://github.com/nedbat/coveragepy/issues/355 +.. _issue 448: https://github.com/nedbat/coveragepy/issues/448 +.. _issue 570: https://github.com/nedbat/coveragepy/issues/570 .. _changes_434: @@ -834,7 +834,7 @@ Version 4.3.4 --- 2017-01-17 exception wasn't properly derived from Exception, described in `issue 556`_. A newb mistake; it hasn't been a good few days. -.. _issue 556: https://bitbucket.org/ned/coveragepy/issues/556/43-fails-if-there-are-html-files-in-the +.. _issue 556: https://github.com/nedbat/coveragepy/issues/556 .. _changes_433: @@ -846,7 +846,7 @@ Version 4.3.3 --- 2017-01-17 benefit of the coverage.py test suite. Properly conditionalizing it fixed `issue 554`_ so that Python 2.6 works again. -.. _issue 554: https://bitbucket.org/ned/coveragepy/issues/554/traceback-on-python-26-starting-with-432 +.. _issue 554: https://github.com/nedbat/coveragepy/issues/554 .. _changes_432: @@ -889,11 +889,11 @@ Version 4.3.2 --- 2017-01-16 coverage.py 4.3, the old HTML file with the less-than-100% coverage would be left behind. This file is now properly deleted. -.. _issue 322: https://bitbucket.org/ned/coveragepy/issues/322/cannot-use-coverage-with-jython -.. _issue 426: https://bitbucket.org/ned/coveragepy/issues/426/difference-between-coverage-results-with -.. _issue 522: https://bitbucket.org/ned/coveragepy/issues/522/incorrect-branch-reporting -.. _issue 549: https://bitbucket.org/ned/coveragepy/issues/549/skip-covered-with-100-coverage-throws-a-no -.. _issue 551: https://bitbucket.org/ned/coveragepy/issues/551/coveragepy-cannot-be-imported-in-jython27 +.. _issue 322: https://github.com/nedbat/coveragepy/issues/322 +.. _issue 426: https://github.com/nedbat/coveragepy/issues/426 +.. _issue 522: https://github.com/nedbat/coveragepy/issues/522 +.. _issue 549: https://github.com/nedbat/coveragepy/issues/549 +.. _issue 551: https://github.com/nedbat/coveragepy/issues/551 .. _changes_431: @@ -909,8 +909,8 @@ Version 4.3.1 --- 2016-12-28 in `issue 541`_. The check has been reverted while we re-think the fix for `issue 265`_. -.. _issue 540: https://bitbucket.org/ned/coveragepy/issues/540/cant-install-coverage-v43-into-under -.. _issue 541: https://bitbucket.org/ned/coveragepy/issues/541/coverage-43-breaks-nosetest-with-coverage +.. _issue 540: https://github.com/nedbat/coveragepy/issues/540 +.. _issue 541: https://github.com/nedbat/coveragepy/issues/541 .. _changes_43: @@ -1022,24 +1022,24 @@ coverage.py and contributed a number of improvements in this release. author string in setup.py, though this might be too cute. .. _sys.excepthook: https://docs.python.org/3/library/sys.html#sys.excepthook -.. _issue 265: https://bitbucket.org/ned/coveragepy/issues/265/when-using-source-include-is-silently -.. _issue 412: https://bitbucket.org/ned/coveragepy/issues/412/coverage-combine-should-error-if-no -.. _issue 433: https://bitbucket.org/ned/coveragepy/issues/433/coverage-html-does-not-suport-skip-covered -.. _issue 493: https://bitbucket.org/ned/coveragepy/issues/493/confusing-branching-failure -.. _issue 496: https://bitbucket.org/ned/coveragepy/issues/496/incorrect-coverage-with-branching-and -.. _issue 502: https://bitbucket.org/ned/coveragepy/issues/502/incorrect-coverage-report-with-cover -.. _issue 505: https://bitbucket.org/ned/coveragepy/issues/505/use-canonical-filename-for-debounce -.. _issue 514: https://bitbucket.org/ned/coveragepy/issues/514/path-to-problem-file-not-reported-when -.. _issue 510: https://bitbucket.org/ned/coveragepy/issues/510/erase-still-needed-in-42 -.. _issue 511: https://bitbucket.org/ned/coveragepy/issues/511/version-42-coverage-combine-empties -.. _issue 516: https://bitbucket.org/ned/coveragepy/issues/516/running-coverage-combine-twice-deletes-all -.. _issue 519: https://bitbucket.org/ned/coveragepy/issues/519/coverage-run-sections-in-toxini-or-as -.. _issue 524: https://bitbucket.org/ned/coveragepy/issues/524/coverage-report-with-skip-covered-column -.. _issue 525: https://bitbucket.org/ned/coveragepy/issues/525/coverage-combine-when-not-in-parallel-mode -.. _issue 529: https://bitbucket.org/ned/coveragepy/issues/529/encoding-marker-may-only-appear-on-the -.. _issue 530: https://bitbucket.org/ned/coveragepy/issues/530/deprecationwarning-you-passed-a-bytestring -.. _issue 533: https://bitbucket.org/ned/coveragepy/issues/533/exception-on-unencodable-file-name -.. _issue 535: https://bitbucket.org/ned/coveragepy/issues/535/sysexcepthook-is-not-called +.. _issue 265: https://github.com/nedbat/coveragepy/issues/265 +.. _issue 412: https://github.com/nedbat/coveragepy/issues/412 +.. _issue 433: https://github.com/nedbat/coveragepy/issues/433 +.. _issue 493: https://github.com/nedbat/coveragepy/issues/493 +.. _issue 496: https://github.com/nedbat/coveragepy/issues/496 +.. _issue 502: https://github.com/nedbat/coveragepy/issues/502 +.. _issue 505: https://github.com/nedbat/coveragepy/issues/505 +.. _issue 514: https://github.com/nedbat/coveragepy/issues/514 +.. _issue 510: https://github.com/nedbat/coveragepy/issues/510 +.. _issue 511: https://github.com/nedbat/coveragepy/issues/511 +.. _issue 516: https://github.com/nedbat/coveragepy/issues/516 +.. _issue 519: https://github.com/nedbat/coveragepy/issues/519 +.. _issue 524: https://github.com/nedbat/coveragepy/issues/524 +.. _issue 525: https://github.com/nedbat/coveragepy/issues/525 +.. _issue 529: https://github.com/nedbat/coveragepy/issues/529 +.. _issue 530: https://github.com/nedbat/coveragepy/issues/530 +.. _issue 533: https://github.com/nedbat/coveragepy/issues/533 +.. _issue 535: https://github.com/nedbat/coveragepy/issues/535 .. _changes_42: @@ -1057,7 +1057,7 @@ Version 4.2 --- 2016-07-26 - Filtering the HTML report is now faster, thanks to Ville Skyttä. -.. _issue 495: https://bitbucket.org/ned/coveragepy/issues/495/branch-and-concurrency-are-conflicting +.. _issue 495: https://github.com/nedbat/coveragepy/issues/495 Version 4.2b1 --- 2016-07-04 @@ -1110,14 +1110,14 @@ Work from the PyCon 2016 Sprints! package: `unittest-mixins`_. .. _automatic subprocess measurement: https://coverage.readthedocs.io/en/latest/subprocess.html -.. _issue 199: https://bitbucket.org/ned/coveragepy/issues/199/add-a-way-to-sort-the-text-report -.. _issue 231: https://bitbucket.org/ned/coveragepy/issues/231/various-default-behavior-in-report-phase -.. _issue 298: https://bitbucket.org/ned/coveragepy/issues/298/show-in-html-report-that-the-columns-are -.. _issue 396: https://bitbucket.org/ned/coveragepy/issues/396/coverage-xml-shouldnt-bail-out-on-parse -.. _issue 454: https://bitbucket.org/ned/coveragepy/issues/454/coverage-debug-config-should-be -.. _issue 478: https://bitbucket.org/ned/coveragepy/issues/478/help-shows-silly-program-name-when-running -.. _issue 484: https://bitbucket.org/ned/coveragepy/issues/484/multiprocessing-greenlet-concurrency -.. _issue 492: https://bitbucket.org/ned/coveragepy/issues/492/subprocess-coverage-strange-detection-of +.. _issue 199: https://github.com/nedbat/coveragepy/issues/199 +.. _issue 231: https://github.com/nedbat/coveragepy/issues/231 +.. _issue 298: https://github.com/nedbat/coveragepy/issues/298 +.. _issue 396: https://github.com/nedbat/coveragepy/issues/396 +.. _issue 454: https://github.com/nedbat/coveragepy/issues/454 +.. _issue 478: https://github.com/nedbat/coveragepy/issues/478 +.. _issue 484: https://github.com/nedbat/coveragepy/issues/484 +.. _issue 492: https://github.com/nedbat/coveragepy/issues/492 .. _unittest-mixins: https://pypi.org/project/unittest-mixins/ @@ -1184,17 +1184,17 @@ Version 4.1b3 --- 2016-05-10 - Make a small tweak to how we compare threads, to avoid buggy custom comparison code in thread classes. (`issue 245`_) -.. _issue 90: https://bitbucket.org/ned/coveragepy/issues/90/lambda-expression-confuses-branch -.. _issue 245: https://bitbucket.org/ned/coveragepy/issues/245/change-solution-for-issue-164 -.. _issue 440: https://bitbucket.org/ned/coveragepy/issues/440/yielded-twisted-failure-marked-as-missed -.. _issue 456: https://bitbucket.org/ned/coveragepy/issues/456/coverage-breaks-with-implicit-namespaces -.. _issue 460: https://bitbucket.org/ned/coveragepy/issues/460/confusing-html-report-for-certain-partial -.. _issue 469: https://bitbucket.org/ned/coveragepy/issues/469/strange-1-line-number-in-branch-coverage -.. _issue 472: https://bitbucket.org/ned/coveragepy/issues/472/html-report-indents-incorrectly-for-one -.. _issue 475: https://bitbucket.org/ned/coveragepy/issues/475/generator-expression-is-marked-as-not -.. _issue 479: https://bitbucket.org/ned/coveragepy/issues/479/clarify-the-need-for-the-c-extension -.. _issue 481: https://bitbucket.org/ned/coveragepy/issues/481/asyncioprocesspoolexecutor-tracing-not -.. _issue 485: https://bitbucket.org/ned/coveragepy/issues/485/coveragereport-ignores-show_missing-and +.. _issue 90: https://github.com/nedbat/coveragepy/issues/90 +.. _issue 245: https://github.com/nedbat/coveragepy/issues/245 +.. _issue 440: https://github.com/nedbat/coveragepy/issues/440 +.. _issue 456: https://github.com/nedbat/coveragepy/issues/456 +.. _issue 460: https://github.com/nedbat/coveragepy/issues/460 +.. _issue 469: https://github.com/nedbat/coveragepy/issues/469 +.. _issue 472: https://github.com/nedbat/coveragepy/issues/472 +.. _issue 475: https://github.com/nedbat/coveragepy/issues/475 +.. _issue 479: https://github.com/nedbat/coveragepy/issues/479 +.. _issue 481: https://github.com/nedbat/coveragepy/issues/481 +.. _issue 485: https://github.com/nedbat/coveragepy/issues/485 Version 4.1b2 --- 2016-01-23 @@ -1217,8 +1217,8 @@ Version 4.1b2 --- 2016-01-23 - ``coverage report`` won't produce trailing whitespace. -.. _issue 465: https://bitbucket.org/ned/coveragepy/issues/465/coveragexml-produces-package-names-with-an -.. _issue 466: https://bitbucket.org/ned/coveragepy/issues/466/impossible-missed-branch-to-a-negative +.. _issue 465: https://github.com/nedbat/coveragepy/issues/465 +.. _issue 466: https://github.com/nedbat/coveragepy/issues/466 Version 4.1b1 --- 2016-01-10 @@ -1266,15 +1266,15 @@ Version 4.1b1 --- 2016-01-10 - Form-feed characters would prevent accurate determination of the beginning of statements in the rest of the file. This is now fixed, closing `issue 461`_. -.. _issue 129: https://bitbucket.org/ned/coveragepy/issues/129/misleading-branch-coverage-of-empty -.. _issue 131: https://bitbucket.org/ned/coveragepy/issues/131/pragma-on-a-decorator-line-should-affect -.. _issue 146: https://bitbucket.org/ned/coveragepy/issues/146/context-managers-confuse-branch-coverage -.. _issue 212: https://bitbucket.org/ned/coveragepy/issues/212/coverage-erroneously-reports-partial -.. _issue 422: https://bitbucket.org/ned/coveragepy/issues/422/python35-partial-branch-marked-as-fully -.. _issue 434: https://bitbucket.org/ned/coveragepy/issues/434/indexerror-in-python-35 -.. _issue 453: https://bitbucket.org/ned/coveragepy/issues/453/source-code-encoding-can-only-be-specified -.. _issue 455: https://bitbucket.org/ned/coveragepy/issues/455/unusual-exclusions-stopped-working-in -.. _issue 461: https://bitbucket.org/ned/coveragepy/issues/461/multiline-asserts-need-too-many-pragma +.. _issue 129: https://github.com/nedbat/coveragepy/issues/129 +.. _issue 131: https://github.com/nedbat/coveragepy/issues/131 +.. _issue 146: https://github.com/nedbat/coveragepy/issues/146 +.. _issue 212: https://github.com/nedbat/coveragepy/issues/212 +.. _issue 422: https://github.com/nedbat/coveragepy/issues/422 +.. _issue 434: https://github.com/nedbat/coveragepy/issues/434 +.. _issue 453: https://github.com/nedbat/coveragepy/issues/453 +.. _issue 455: https://github.com/nedbat/coveragepy/issues/455 +.. _issue 461: https://github.com/nedbat/coveragepy/issues/461 .. _changes_403: @@ -1297,11 +1297,11 @@ Version 4.0.3 --- 2015-11-24 command name, which might be different than "coverage". Thanks to Ben Finney, this closes `issue 438`_. -.. _issue 420: https://bitbucket.org/ned/coveragepy/issues/420/coverage-40-hangs-indefinitely-on-python27 -.. _issue 438: https://bitbucket.org/ned/coveragepy/issues/438/parameterise-coverage-command-name -.. _issue 439: https://bitbucket.org/ned/coveragepy/issues/439/incorrect-cobertura-file-sources-generated -.. _issue 443: https://bitbucket.org/ned/coveragepy/issues/443/coverage-gets-confused-when-encoding -.. _issue 445: https://bitbucket.org/ned/coveragepy/issues/445/django-app-cannot-connect-to-cassandra +.. _issue 420: https://github.com/nedbat/coveragepy/issues/420 +.. _issue 438: https://github.com/nedbat/coveragepy/issues/438 +.. _issue 439: https://github.com/nedbat/coveragepy/issues/439 +.. _issue 443: https://github.com/nedbat/coveragepy/issues/443 +.. _issue 445: https://github.com/nedbat/coveragepy/issues/445 .. _changes_402: @@ -1320,9 +1320,9 @@ Version 4.0.2 --- 2015-11-04 - Officially support PyPy 4.0, which required no changes, just updates to the docs. -.. _issue 431: https://bitbucket.org/ned/coveragepy/issues/431/couldnt-parse-python-file-with-cp1252 -.. _issue 432: https://bitbucket.org/ned/coveragepy/issues/432/path-with-unicode-characters-various -.. _issue 436: https://bitbucket.org/ned/coveragepy/issues/436/disabled-coverage-ctracer-may-rise-from +.. _issue 431: https://github.com/nedbat/coveragepy/issues/431 +.. _issue 432: https://github.com/nedbat/coveragepy/issues/432 +.. _issue 436: https://github.com/nedbat/coveragepy/issues/436 .. _changes_401: @@ -1363,14 +1363,14 @@ Version 4.0.1 --- 2015-10-13 - The source kit now contains all of the files needed to have a complete source tree, re-fixing `issue 137`_ and closing `issue 281`_. -.. _issue 281: https://bitbucket.org/ned/coveragepy/issues/281/supply-scripts-for-testing-in-the -.. _issue 397: https://bitbucket.org/ned/coveragepy/issues/397/stopping-and-resuming-coverage-with -.. _issue 410: https://bitbucket.org/ned/coveragepy/issues/410/attributeerror-module-object-has-no -.. _issue 415: https://bitbucket.org/ned/coveragepy/issues/415/repeated-coveragedataupdates-cause -.. _issue 416: https://bitbucket.org/ned/coveragepy/issues/416/mocking-ospathexists-causes-failures -.. _issue 418: https://bitbucket.org/ned/coveragepy/issues/418/json-parse-error -.. _issue 419: https://bitbucket.org/ned/coveragepy/issues/419/nosource-no-source-for-code-path-to-c -.. _issue 423: https://bitbucket.org/ned/coveragepy/issues/423/skip_covered-changes-reported-total +.. _issue 281: https://github.com/nedbat/coveragepy/issues/281 +.. _issue 397: https://github.com/nedbat/coveragepy/issues/397 +.. _issue 410: https://github.com/nedbat/coveragepy/issues/410 +.. _issue 415: https://github.com/nedbat/coveragepy/issues/415 +.. _issue 416: https://github.com/nedbat/coveragepy/issues/416 +.. _issue 418: https://github.com/nedbat/coveragepy/issues/418 +.. _issue 419: https://github.com/nedbat/coveragepy/issues/419 +.. _issue 423: https://github.com/nedbat/coveragepy/issues/423 .. _changes_40: @@ -1397,8 +1397,8 @@ Version 4.0b3 --- 2015-09-07 include tests and docs. If you were using them from the older packages, get in touch and help me understand how. -.. _issue 403: https://bitbucket.org/ned/coveragepy/issues/403/hasherupdate-fails-with-typeerror-nonetype -.. _issue 404: https://bitbucket.org/ned/coveragepy/issues/404/shiningpanda-jenkins-plugin-cant-find-html +.. _issue 403: https://github.com/nedbat/coveragepy/issues/403 +.. _issue 404: https://github.com/nedbat/coveragepy/issues/404 Version 4.0b2 --- 2015-08-22 @@ -1428,9 +1428,9 @@ Version 4.0b2 --- 2015-08-22 - A new version identifier is available, `coverage.version_info`, a plain tuple of values similar to `sys.version_info`_. -.. _issue 392: https://bitbucket.org/ned/coveragepy/issues/392/run-append-doesnt-create-coverage-file -.. _issue 395: https://bitbucket.org/ned/coveragepy/issues/395/rfe-read-pickled-files-as-well-for -.. _issue 399: https://bitbucket.org/ned/coveragepy/issues/399/coverageexception-cant-combine-line-data +.. _issue 392: https://github.com/nedbat/coveragepy/issues/392 +.. _issue 395: https://github.com/nedbat/coveragepy/issues/395 +.. _issue 399: https://github.com/nedbat/coveragepy/issues/399 .. _sys.version_info: https://docs.python.org/3/library/sys.html#sys.version_info @@ -1500,15 +1500,15 @@ Version 4.0b1 --- 2015-08-02 - The speed is back to 3.7.1 levels, after having slowed down due to plugin support, finishing up `issue 387`_. -.. _issue 236: https://bitbucket.org/ned/coveragepy/issues/236/pickles-are-bad-and-you-should-feel-bad -.. _issue 252: https://bitbucket.org/ned/coveragepy/issues/252/coverage-wont-run-a-program-with -.. _issue 262: https://bitbucket.org/ned/coveragepy/issues/262/when-parallel-true-erase-should-erase-all -.. _issue 275: https://bitbucket.org/ned/coveragepy/issues/275/refer-consistently-to-project-as-coverage -.. _issue 313: https://bitbucket.org/ned/coveragepy/issues/313/add-license-file-containing-2-3-or-4 -.. _issue 380: https://bitbucket.org/ned/coveragepy/issues/380/code-executed-by-exec-excluded-from -.. _issue 385: https://bitbucket.org/ned/coveragepy/issues/385/coverage-combine-doesnt-work-with-rcfile -.. _issue 386: https://bitbucket.org/ned/coveragepy/issues/386/error-on-unrecognised-configuration -.. _issue 387: https://bitbucket.org/ned/coveragepy/issues/387/performance-degradation-from-371-to-40 +.. _issue 236: https://github.com/nedbat/coveragepy/issues/236 +.. _issue 252: https://github.com/nedbat/coveragepy/issues/252 +.. _issue 262: https://github.com/nedbat/coveragepy/issues/262 +.. _issue 275: https://github.com/nedbat/coveragepy/issues/275 +.. _issue 313: https://github.com/nedbat/coveragepy/issues/313 +.. _issue 380: https://github.com/nedbat/coveragepy/issues/380 +.. _issue 385: https://github.com/nedbat/coveragepy/issues/385 +.. _issue 386: https://github.com/nedbat/coveragepy/issues/386 +.. _issue 387: https://github.com/nedbat/coveragepy/issues/387 .. 40 issues closed in 4.0 below here @@ -1562,17 +1562,17 @@ Version 4.0a6 --- 2015-06-21 - Plugin support had some bugs fixed, closing `issue 374`_ and `issue 375`_. Thanks, Stefan Behnel. -.. _issue 299: https://bitbucket.org/ned/coveragepy/issues/299/inserted-created-on-yyyy-mm-dd-hh-mm-in -.. _issue 308: https://bitbucket.org/ned/coveragepy/issues/308/yield-lambda-branch-coverage -.. _issue 324: https://bitbucket.org/ned/coveragepy/issues/324/yield-in-loop-confuses-branch-coverage -.. _issue 351: https://bitbucket.org/ned/coveragepy/issues/351/files-with-incorrect-encoding-are-ignored -.. _issue 354: https://bitbucket.org/ned/coveragepy/issues/354/coverage-combine-should-take-a-list-of -.. _issue 359: https://bitbucket.org/ned/coveragepy/issues/359/xml-report-chunk-error -.. _issue 360: https://bitbucket.org/ned/coveragepy/issues/360/html-reports-get-confused-by-l-in-the-code -.. _issue 361: https://bitbucket.org/ned/coveragepy/issues/361/use-double-quotes-in-html-output-to -.. _issue 363: https://bitbucket.org/ned/coveragepy/issues/363/annotate-command-hits-unicode-happy-fun -.. _issue 374: https://bitbucket.org/ned/coveragepy/issues/374/c-tracer-lookups-fail-in -.. _issue 375: https://bitbucket.org/ned/coveragepy/issues/375/ctracer_handle_return-reads-byte-code +.. _issue 299: https://github.com/nedbat/coveragepy/issues/299 +.. _issue 308: https://github.com/nedbat/coveragepy/issues/308 +.. _issue 324: https://github.com/nedbat/coveragepy/issues/324 +.. _issue 351: https://github.com/nedbat/coveragepy/issues/351 +.. _issue 354: https://github.com/nedbat/coveragepy/issues/354 +.. _issue 359: https://github.com/nedbat/coveragepy/issues/359 +.. _issue 360: https://github.com/nedbat/coveragepy/issues/360 +.. _issue 361: https://github.com/nedbat/coveragepy/issues/361 +.. _issue 363: https://github.com/nedbat/coveragepy/issues/363 +.. _issue 374: https://github.com/nedbat/coveragepy/issues/374 +.. _issue 375: https://github.com/nedbat/coveragepy/issues/375 Version 4.0a5 --- 2015-02-16 @@ -1602,11 +1602,11 @@ Version 4.0a5 --- 2015-02-16 - Added 3.5.0a1 to the list of supported CPython versions. -.. _issue 117: https://bitbucket.org/ned/coveragepy/issues/117/enable-coverage-measurement-of-code-run-by -.. _issue 340: https://bitbucket.org/ned/coveragepy/issues/340/keyerror-subpy -.. _issue 353: https://bitbucket.org/ned/coveragepy/issues/353/40a3-introduces-an-unexpected-third-case -.. _issue 357: https://bitbucket.org/ned/coveragepy/issues/357/behavior-changed-when-coveragerc-is -.. _issue 358: https://bitbucket.org/ned/coveragepy/issues/358/all-coverage-commands-should-adjust +.. _issue 117: https://github.com/nedbat/coveragepy/issues/117 +.. _issue 340: https://github.com/nedbat/coveragepy/issues/340 +.. _issue 353: https://github.com/nedbat/coveragepy/issues/353 +.. _issue 357: https://github.com/nedbat/coveragepy/issues/357 +.. _issue 358: https://github.com/nedbat/coveragepy/issues/358 Version 4.0a4 --- 2015-01-25 @@ -1646,11 +1646,11 @@ Version 4.0a3 --- 2015-01-20 - Regexes in the configuration file are now compiled as soon as they are read, to provide error messages earlier (`issue 349`_). -.. _issue 69: https://bitbucket.org/ned/coveragepy/issues/69/coverage-html-overwrite-files-that-doesnt -.. _issue 235: https://bitbucket.org/ned/coveragepy/issues/235/package-name-is-missing-in-xml-report -.. _issue 290: https://bitbucket.org/ned/coveragepy/issues/290/running-programmatically-with-pyw-files -.. _issue 345: https://bitbucket.org/ned/coveragepy/issues/345/xml-reports-line-rate-0-for-empty-files -.. _issue 349: https://bitbucket.org/ned/coveragepy/issues/349/bad-regex-in-config-should-get-an-earlier +.. _issue 69: https://github.com/nedbat/coveragepy/issues/69 +.. _issue 235: https://github.com/nedbat/coveragepy/issues/235 +.. _issue 290: https://github.com/nedbat/coveragepy/issues/290 +.. _issue 345: https://github.com/nedbat/coveragepy/issues/345 +.. _issue 349: https://github.com/nedbat/coveragepy/issues/349 Version 4.0a2 --- 2015-01-14 @@ -1710,15 +1710,15 @@ Version 4.0a2 --- 2015-01-14 haven't changed is now a JSON file instead of a pickle file. This obviates `issue 287`_ and `issue 237`_. -.. _issue 237: https://bitbucket.org/ned/coveragepy/issues/237/htmlcov-with-corrupt-statusdat -.. _issue 287: https://bitbucket.org/ned/coveragepy/issues/287/htmlpy-doesnt-specify-pickle-protocol -.. _issue 293: https://bitbucket.org/ned/coveragepy/issues/293/number-of-statement-detection-wrong-if-no -.. _issue 314: https://bitbucket.org/ned/coveragepy/issues/314/fail_under-param-not-working-in-coveragerc -.. _issue 315: https://bitbucket.org/ned/coveragepy/issues/315/option-to-omit-empty-files-eg-__init__py -.. _issue 328: https://bitbucket.org/ned/coveragepy/issues/328/misbehavior-in-run-source -.. _issue 334: https://bitbucket.org/ned/coveragepy/issues/334/pragma-not-recognized-if-tab-character -.. _issue 342: https://bitbucket.org/ned/coveragepy/issues/342/console-and-html-coverage-reports-differ -.. _issue 343: https://bitbucket.org/ned/coveragepy/issues/343/an-explicitly-named-non-existent-config +.. _issue 237: https://github.com/nedbat/coveragepy/issues/237 +.. _issue 287: https://github.com/nedbat/coveragepy/issues/287 +.. _issue 293: https://github.com/nedbat/coveragepy/issues/293 +.. _issue 314: https://github.com/nedbat/coveragepy/issues/314 +.. _issue 315: https://github.com/nedbat/coveragepy/issues/315 +.. _issue 328: https://github.com/nedbat/coveragepy/issues/328 +.. _issue 334: https://github.com/nedbat/coveragepy/issues/334 +.. _issue 342: https://github.com/nedbat/coveragepy/issues/342 +.. _issue 343: https://github.com/nedbat/coveragepy/issues/343 Version 4.0a1 --- 2014-09-27 @@ -1763,16 +1763,16 @@ Version 4.0a1 --- 2014-09-27 - Encoding declarations in source files are only considered if they are truly comments. Thanks, Anthony Sottile. -.. _issue 57: https://bitbucket.org/ned/coveragepy/issues/57/annotate-command-fails-to-annotate-many -.. _issue 94: https://bitbucket.org/ned/coveragepy/issues/94/coverage-xml-doesnt-produce-sources -.. _issue 149: https://bitbucket.org/ned/coveragepy/issues/149/coverage-gevent-looks-broken -.. _issue 230: https://bitbucket.org/ned/coveragepy/issues/230/show-line-no-for-missing-branches-in -.. _issue 284: https://bitbucket.org/ned/coveragepy/issues/284/fail-under-should-show-more-precision -.. _issue 285: https://bitbucket.org/ned/coveragepy/issues/285/xml-report-fails-if-output-file-directory -.. _issue 303: https://bitbucket.org/ned/coveragepy/issues/303/unicodedecodeerror -.. _issue 304: https://bitbucket.org/ned/coveragepy/issues/304/attempt-to-get-configuration-from-setupcfg -.. _issue 305: https://bitbucket.org/ned/coveragepy/issues/305/pendingdeprecationwarning-the-imp-module -.. _issue 331: https://bitbucket.org/ned/coveragepy/issues/331/failure-of-encoding-detection-on-python2 +.. _issue 57: https://github.com/nedbat/coveragepy/issues/57 +.. _issue 94: https://github.com/nedbat/coveragepy/issues/94 +.. _issue 149: https://github.com/nedbat/coveragepy/issues/149 +.. _issue 230: https://github.com/nedbat/coveragepy/issues/230 +.. _issue 284: https://github.com/nedbat/coveragepy/issues/284 +.. _issue 285: https://github.com/nedbat/coveragepy/issues/285 +.. _issue 303: https://github.com/nedbat/coveragepy/issues/303 +.. _issue 304: https://github.com/nedbat/coveragepy/issues/304 +.. _issue 305: https://github.com/nedbat/coveragepy/issues/305 +.. _issue 331: https://github.com/nedbat/coveragepy/issues/331 .. _changes_371: @@ -1831,18 +1831,18 @@ Version 3.7 --- 2013-10-06 - The source kit now includes the ``__main__.py`` file in the root coverage directory, fixing `issue 255`_. -.. _issue 92: https://bitbucket.org/ned/coveragepy/issues/92/finally-clauses-arent-treated-properly-in -.. _issue 164: https://bitbucket.org/ned/coveragepy/issues/164/trace-function-changed-warning-when-using -.. _issue 175: https://bitbucket.org/ned/coveragepy/issues/175/branch-coverage-gets-confused-in-certain -.. _issue 207: https://bitbucket.org/ned/coveragepy/issues/207/run-m-cannot-find-module-or-package-in -.. _issue 242: https://bitbucket.org/ned/coveragepy/issues/242/running-a-two-level-package-doesnt-work -.. _issue 218: https://bitbucket.org/ned/coveragepy/issues/218/run-command-does-not-respect-the-omit-flag -.. _issue 250: https://bitbucket.org/ned/coveragepy/issues/250/uncaught-zerodivisionerror-when-generating -.. _issue 255: https://bitbucket.org/ned/coveragepy/issues/255/directory-level-__main__py-not-included-in -.. _issue 259: https://bitbucket.org/ned/coveragepy/issues/259/allow-use-of-system-installed-third-party -.. _issue 261: https://bitbucket.org/ned/coveragepy/issues/261/pyw-files-arent-reported-properly -.. _issue 264: https://bitbucket.org/ned/coveragepy/issues/264/coverage-wont-run-pyc-files -.. _issue 267: https://bitbucket.org/ned/coveragepy/issues/267/relative-path-aliases-dont-work +.. _issue 92: https://github.com/nedbat/coveragepy/issues/92 +.. _issue 164: https://github.com/nedbat/coveragepy/issues/164 +.. _issue 175: https://github.com/nedbat/coveragepy/issues/175 +.. _issue 207: https://github.com/nedbat/coveragepy/issues/207 +.. _issue 242: https://github.com/nedbat/coveragepy/issues/242 +.. _issue 218: https://github.com/nedbat/coveragepy/issues/218 +.. _issue 250: https://github.com/nedbat/coveragepy/issues/250 +.. _issue 255: https://github.com/nedbat/coveragepy/issues/255 +.. _issue 259: https://github.com/nedbat/coveragepy/issues/259 +.. _issue 261: https://github.com/nedbat/coveragepy/issues/261 +.. _issue 264: https://github.com/nedbat/coveragepy/issues/264 +.. _issue 267: https://github.com/nedbat/coveragepy/issues/267 .. _changes_36: @@ -1853,8 +1853,8 @@ Version 3.6 --- 2013-01-05 - Added a page to the docs about troublesome situations, closing `issue 226`_, and added some info to the TODO file, closing `issue 227`_. -.. _issue 226: https://bitbucket.org/ned/coveragepy/issues/226/make-readme-section-to-describe-when -.. _issue 227: https://bitbucket.org/ned/coveragepy/issues/227/update-todo +.. _issue 226: https://github.com/nedbat/coveragepy/issues/226 +.. _issue 227: https://github.com/nedbat/coveragepy/issues/227 Version 3.6b3 --- 2012-12-29 @@ -1862,7 +1862,7 @@ Version 3.6b3 --- 2012-12-29 - Beta 2 broke the nose plugin. It's fixed again, closing `issue 224`_. -.. _issue 224: https://bitbucket.org/ned/coveragepy/issues/224/36b2-breaks-nosexcover +.. _issue 224: https://github.com/nedbat/coveragepy/issues/224 Version 3.6b2 --- 2012-12-23 @@ -1882,7 +1882,7 @@ Version 3.6b2 --- 2012-12-23 file name, coverage.py no longer associates it with the directory name, fixing `issue 221`_. -.. _issue 221: https://bitbucket.org/ned/coveragepy/issues/221/coveragepy-incompatible-with-pyratemp +.. _issue 221: https://github.com/nedbat/coveragepy/issues/221 Version 3.6b1 --- 2012-11-28 @@ -1976,27 +1976,27 @@ Version 3.6b1 --- 2012-11-28 ``'NoneType' object has no attribute 'isabs'``. It no longer does, so kiss `issue 153`_ goodbye. -.. _issue 60: https://bitbucket.org/ned/coveragepy/issues/60/incorrect-path-to-orphaned-pyc-files -.. _issue 67: https://bitbucket.org/ned/coveragepy/issues/67/xml-report-filenames-may-be-generated -.. _issue 89: https://bitbucket.org/ned/coveragepy/issues/89/on-windows-all-packages-are-reported-in -.. _issue 97: https://bitbucket.org/ned/coveragepy/issues/97/allow-environment-variables-to-be -.. _issue 100: https://bitbucket.org/ned/coveragepy/issues/100/source-directive-doesnt-work-for-packages -.. _issue 111: https://bitbucket.org/ned/coveragepy/issues/111/when-installing-coverage-with-pip-not -.. _issue 137: https://bitbucket.org/ned/coveragepy/issues/137/provide-docs-with-source-distribution -.. _issue 139: https://bitbucket.org/ned/coveragepy/issues/139/easy-check-for-a-certain-coverage-in-tests -.. _issue 143: https://bitbucket.org/ned/coveragepy/issues/143/omit-doesnt-seem-to-work-in-coverage -.. _issue 153: https://bitbucket.org/ned/coveragepy/issues/153/non-existent-filename-triggers -.. _issue 156: https://bitbucket.org/ned/coveragepy/issues/156/a-completely-unexecuted-file-shows-14 -.. _issue 163: https://bitbucket.org/ned/coveragepy/issues/163/problem-with-include-and-omit-filename -.. _issue 171: https://bitbucket.org/ned/coveragepy/issues/171/how-to-contribute-and-run-tests -.. _issue 193: https://bitbucket.org/ned/coveragepy/issues/193/unicodedecodeerror-on-htmlpy -.. _issue 201: https://bitbucket.org/ned/coveragepy/issues/201/coverage-using-django-14-with-pydb-on -.. _issue 202: https://bitbucket.org/ned/coveragepy/issues/202/get-rid-of-ez_setuppy-and -.. _issue 203: https://bitbucket.org/ned/coveragepy/issues/203/duplicate-filenames-reported-when-filename -.. _issue 205: https://bitbucket.org/ned/coveragepy/issues/205/make-pydoc-coverage-more-friendly -.. _issue 206: https://bitbucket.org/ned/coveragepy/issues/206/pydoc-coveragecoverage-fails-with-an-error -.. _issue 210: https://bitbucket.org/ned/coveragepy/issues/210/if-theres-no-coverage-data-coverage-xml -.. _issue 214: https://bitbucket.org/ned/coveragepy/issues/214/coveragepy-measures-itself-on-precise +.. _issue 60: https://github.com/nedbat/coveragepy/issues/60 +.. _issue 67: https://github.com/nedbat/coveragepy/issues/67 +.. _issue 89: https://github.com/nedbat/coveragepy/issues/89 +.. _issue 97: https://github.com/nedbat/coveragepy/issues/97 +.. _issue 100: https://github.com/nedbat/coveragepy/issues/100 +.. _issue 111: https://github.com/nedbat/coveragepy/issues/111 +.. _issue 137: https://github.com/nedbat/coveragepy/issues/137 +.. _issue 139: https://github.com/nedbat/coveragepy/issues/139 +.. _issue 143: https://github.com/nedbat/coveragepy/issues/143 +.. _issue 153: https://github.com/nedbat/coveragepy/issues/153 +.. _issue 156: https://github.com/nedbat/coveragepy/issues/156 +.. _issue 163: https://github.com/nedbat/coveragepy/issues/163 +.. _issue 171: https://github.com/nedbat/coveragepy/issues/171 +.. _issue 193: https://github.com/nedbat/coveragepy/issues/193 +.. _issue 201: https://github.com/nedbat/coveragepy/issues/201 +.. _issue 202: https://github.com/nedbat/coveragepy/issues/202 +.. _issue 203: https://github.com/nedbat/coveragepy/issues/203 +.. _issue 205: https://github.com/nedbat/coveragepy/issues/205 +.. _issue 206: https://github.com/nedbat/coveragepy/issues/206 +.. _issue 210: https://github.com/nedbat/coveragepy/issues/210 +.. _issue 214: https://github.com/nedbat/coveragepy/issues/214 .. _changes_353: @@ -2031,12 +2031,12 @@ Version 3.5.3 --- 2012-09-29 - Testing is now done with `tox`_, thanks, Marc Abramowitz. -.. _issue 147: https://bitbucket.org/ned/coveragepy/issues/147/massive-memory-usage-by-ctracer -.. _issue 179: https://bitbucket.org/ned/coveragepy/issues/179/htmlreporter-fails-when-source-file-is -.. _issue 183: https://bitbucket.org/ned/coveragepy/issues/183/install-fails-for-python-23 -.. _issue 194: https://bitbucket.org/ned/coveragepy/issues/194/filelocatorrelative_filename-could-mangle -.. _issue 195: https://bitbucket.org/ned/coveragepy/issues/195/pyo-file-handling-in-codeunit -.. _issue 197: https://bitbucket.org/ned/coveragepy/issues/197/line-numbers-in-html-report-do-not-align +.. _issue 147: https://github.com/nedbat/coveragepy/issues/147 +.. _issue 179: https://github.com/nedbat/coveragepy/issues/179 +.. _issue 183: https://github.com/nedbat/coveragepy/issues/183 +.. _issue 194: https://github.com/nedbat/coveragepy/issues/194 +.. _issue 195: https://github.com/nedbat/coveragepy/issues/195 +.. _issue 197: https://github.com/nedbat/coveragepy/issues/197 .. _tox: https://tox.readthedocs.io/ @@ -2084,12 +2084,12 @@ Version 3.5.2b1 --- 2012-04-29 - When installing into pypy, we no longer attempt (and fail) to compile the C tracer function, closing `issue 166`_. -.. _issue 142: https://bitbucket.org/ned/coveragepy/issues/142/executing-python-file-syspath-is-replaced -.. _issue 155: https://bitbucket.org/ned/coveragepy/issues/155/cant-use-coverage-run-m-unittest-discover -.. _issue 157: https://bitbucket.org/ned/coveragepy/issues/157/chokes-on-source-files-with-non-utf-8 -.. _issue 166: https://bitbucket.org/ned/coveragepy/issues/166/dont-try-to-compile-c-extension-on-pypy -.. _issue 168: https://bitbucket.org/ned/coveragepy/issues/168/dont-be-alarmed-by-emacs-droppings -.. _issue 173: https://bitbucket.org/ned/coveragepy/issues/173/theres-no-way-to-specify-show-missing-in +.. _issue 142: https://github.com/nedbat/coveragepy/issues/142 +.. _issue 155: https://github.com/nedbat/coveragepy/issues/155 +.. _issue 157: https://github.com/nedbat/coveragepy/issues/157 +.. _issue 166: https://github.com/nedbat/coveragepy/issues/166 +.. _issue 168: https://github.com/nedbat/coveragepy/issues/168 +.. _issue 173: https://github.com/nedbat/coveragepy/issues/173 .. _changes_351: @@ -2133,12 +2133,12 @@ Version 3.5.1b1 --- 2011-08-28 into running some coverage.py code before anything else in the process. See the coverage/fullcoverage directory if you are interested. -.. _issue 17: https://bitbucket.org/ned/coveragepy/issues/17/support-combining-coverage-data-from -.. _issue 122: https://bitbucket.org/ned/coveragepy/issues/122/for-else-always-reports-missing-branch -.. _issue 124: https://bitbucket.org/ned/coveragepy/issues/124/no-arbitrary-unicode-in-html-reports-in -.. _issue 128: https://bitbucket.org/ned/coveragepy/issues/128/branch-coverage-of-with-statement-in-27 -.. _issue 138: https://bitbucket.org/ned/coveragepy/issues/138/include-should-take-precedence-over-is -.. _issue 144: https://bitbucket.org/ned/coveragepy/issues/144/failure-generating-html-output-for +.. _issue 17: https://github.com/nedbat/coveragepy/issues/17 +.. _issue 122: https://github.com/nedbat/coveragepy/issues/122 +.. _issue 124: https://github.com/nedbat/coveragepy/issues/124 +.. _issue 128: https://github.com/nedbat/coveragepy/issues/128 +.. _issue 138: https://github.com/nedbat/coveragepy/issues/138 +.. _issue 144: https://github.com/nedbat/coveragepy/issues/144 .. _changes_35: @@ -2220,15 +2220,15 @@ Version 3.5b1 --- 2011-06-05 - Internally, files are now closed explicitly, fixing `issue 104`_. Thanks, Brett Cannon. -.. _issue 80: https://bitbucket.org/ned/coveragepy/issues/80/is-there-a-duck-typing-way-to-know-we-cant -.. _issue 93: https://bitbucket.org/ned/coveragepy/issues/93/copying-a-mock-object-breaks-coverage -.. _issue 95: https://bitbucket.org/ned/coveragepy/issues/95/run-subcommand-should-take-a-module-name -.. _issue 104: https://bitbucket.org/ned/coveragepy/issues/104/explicitly-close-files -.. _issue 107: https://bitbucket.org/ned/coveragepy/issues/107/codeparser-not-opening-source-files-with -.. _issue 115: https://bitbucket.org/ned/coveragepy/issues/115/fail-gracefully-when-reporting-on-file -.. _issue 121: https://bitbucket.org/ned/coveragepy/issues/121/filename-patterns-are-applied-stupidly -.. _issue 123: https://bitbucket.org/ned/coveragepy/issues/123/pyeval_settrace-used-in-way-that-breaks -.. _issue 125: https://bitbucket.org/ned/coveragepy/issues/125/coverage-removes-decoratortoolss-tracing +.. _issue 80: https://github.com/nedbat/coveragepy/issues/80 +.. _issue 93: https://github.com/nedbat/coveragepy/issues/93 +.. _issue 95: https://github.com/nedbat/coveragepy/issues/95 +.. _issue 104: https://github.com/nedbat/coveragepy/issues/104 +.. _issue 107: https://github.com/nedbat/coveragepy/issues/107 +.. _issue 115: https://github.com/nedbat/coveragepy/issues/115 +.. _issue 121: https://github.com/nedbat/coveragepy/issues/121 +.. _issue 123: https://github.com/nedbat/coveragepy/issues/123 +.. _issue 125: https://github.com/nedbat/coveragepy/issues/125 .. _changes_34: @@ -2241,7 +2241,7 @@ Version 3.4 --- 2010-09-19 - Programs that exited with ``sys.exit()`` with no argument weren't handled properly, producing a coverage.py stack trace. That is now fixed. -.. _issue 88: https://bitbucket.org/ned/coveragepy/issues/88/xml-report-lists-packages-in-random-order +.. _issue 88: https://github.com/nedbat/coveragepy/issues/88 Version 3.4b2 --- 2010-09-06 @@ -2266,12 +2266,12 @@ Version 3.4b2 --- 2010-09-06 would report no coverage for the `run` method. This is now fixed, closing `issue 85`_. -.. _issue 16: https://bitbucket.org/ned/coveragepy/issues/16/allow-configuration-of-accuracy-of-percentage-totals -.. _issue 41: https://bitbucket.org/ned/coveragepy/issues/41/report-says-100-when-it-isnt-quite-there -.. _issue 65: https://bitbucket.org/ned/coveragepy/issues/65/branch-option-not-reported-in-cobertura -.. _issue 70: https://bitbucket.org/ned/coveragepy/issues/70/text-report-and-html-report-disagree-on-coverage -.. _issue 81: https://bitbucket.org/ned/coveragepy/issues/81/xml-report-does-not-have-condition-coverage-attribute-for-lines-with-a -.. _issue 85: https://bitbucket.org/ned/coveragepy/issues/85/threadrun-isnt-measured +.. _issue 16: https://github.com/nedbat/coveragepy/issues/16 +.. _issue 41: https://github.com/nedbat/coveragepy/issues/41 +.. _issue 65: https://github.com/nedbat/coveragepy/issues/65 +.. _issue 70: https://github.com/nedbat/coveragepy/issues/70 +.. _issue 81: https://github.com/nedbat/coveragepy/issues/81 +.. _issue 85: https://github.com/nedbat/coveragepy/issues/85 Version 3.4b1 --- 2010-08-21 @@ -2347,17 +2347,17 @@ Version 3.4b1 --- 2010-08-21 - Asking for an HTML report with no files now shows a nice error message rather than a cryptic failure ('int' object is unsubscriptable). Fixes `issue 59`_. -.. _issue 1: https://bitbucket.org/ned/coveragepy/issues/1/empty-__init__py-files-are-reported-as-1-executable -.. _issue 34: https://bitbucket.org/ned/coveragepy/issues/34/enhanced-omit-globbing-handling -.. _issue 36: https://bitbucket.org/ned/coveragepy/issues/36/provide-regex-style-omit -.. _issue 46: https://bitbucket.org/ned/coveragepy/issues/46 -.. _issue 53: https://bitbucket.org/ned/coveragepy/issues/53 -.. _issue 52: https://bitbucket.org/ned/coveragepy/issues/52/doctesttestfile-confuses-source-detection -.. _issue 56: https://bitbucket.org/ned/coveragepy/issues/56 -.. _issue 61: https://bitbucket.org/ned/coveragepy/issues/61/annotate-i-doesnt-work -.. _issue 62: https://bitbucket.org/ned/coveragepy/issues/62 -.. _issue 59: https://bitbucket.org/ned/coveragepy/issues/59/html-report-fails-with-int-object-is -.. _issue 82: https://bitbucket.org/ned/coveragepy/issues/82/tokenerror-when-generating-html-report +.. _issue 1: https://github.com/nedbat/coveragepy/issues/1 +.. _issue 34: https://github.com/nedbat/coveragepy/issues/34 +.. _issue 36: https://github.com/nedbat/coveragepy/issues/36 +.. _issue 46: https://github.com/nedbat/coveragepy/issues/46 +.. _issue 53: https://github.com/nedbat/coveragepy/issues/53 +.. _issue 52: https://github.com/nedbat/coveragepy/issues/52 +.. _issue 56: https://github.com/nedbat/coveragepy/issues/56 +.. _issue 61: https://github.com/nedbat/coveragepy/issues/61 +.. _issue 62: https://github.com/nedbat/coveragepy/issues/62 +.. _issue 59: https://github.com/nedbat/coveragepy/issues/59 +.. _issue 82: https://github.com/nedbat/coveragepy/issues/82 .. _changes_331: @@ -2371,8 +2371,8 @@ Version 3.3.1 --- 2010-03-06 - When running your code with "coverage run", if you call `sys.exit()`, coverage.py will exit with that status code, fixing `issue 50`_. -.. _issue 49: https://bitbucket.org/ned/coveragepy/issues/49 -.. _issue 50: https://bitbucket.org/ned/coveragepy/issues/50 +.. _issue 49: https://github.com/nedbat/coveragepy/issues/49 +.. _issue 50: https://github.com/nedbat/coveragepy/issues/50 .. _changes_33: @@ -2411,9 +2411,9 @@ Version 3.3 --- 2010-02-24 - Added an AUTHORS.txt file. -.. _issue 39: https://bitbucket.org/ned/coveragepy/issues/39 -.. _issue 40: https://bitbucket.org/ned/coveragepy/issues/40 -.. _issue 47: https://bitbucket.org/ned/coveragepy/issues/47 +.. _issue 39: https://github.com/nedbat/coveragepy/issues/39 +.. _issue 40: https://github.com/nedbat/coveragepy/issues/40 +.. _issue 47: https://github.com/nedbat/coveragepy/issues/47 .. _changes_32: @@ -2471,12 +2471,12 @@ Version 3.2b2 --- 2009-11-19 - The --omit option now works much better than before, fixing `issue 14`_ and `issue 33`_. Thanks, Danek Duvall. -.. _issue 14: https://bitbucket.org/ned/coveragepy/issues/14 -.. _issue 30: https://bitbucket.org/ned/coveragepy/issues/30 -.. _issue 31: https://bitbucket.org/ned/coveragepy/issues/31 -.. _issue 32: https://bitbucket.org/ned/coveragepy/issues/32 -.. _issue 33: https://bitbucket.org/ned/coveragepy/issues/33 -.. _issue 35: https://bitbucket.org/ned/coveragepy/issues/35 +.. _issue 14: https://github.com/nedbat/coveragepy/issues/14 +.. _issue 30: https://github.com/nedbat/coveragepy/issues/30 +.. _issue 31: https://github.com/nedbat/coveragepy/issues/31 +.. _issue 32: https://github.com/nedbat/coveragepy/issues/32 +.. _issue 33: https://github.com/nedbat/coveragepy/issues/33 +.. _issue 35: https://github.com/nedbat/coveragepy/issues/35 Version 3.2b1 --- 2009-11-10 @@ -2491,7 +2491,7 @@ Version 3.2b1 --- 2009-11-10 - Some exceptions reported by the command line interface have been cleaned up so that tracebacks inside coverage.py aren't shown. Fixes `issue 23`_. -.. _issue 23: https://bitbucket.org/ned/coveragepy/issues/23 +.. _issue 23: https://github.com/nedbat/coveragepy/issues/23 .. _changes_31: @@ -2502,7 +2502,7 @@ Version 3.1 --- 2009-10-04 - Source code can now be read from eggs. Thanks, Ross Lawley. Fixes `issue 25`_. -.. _issue 25: https://bitbucket.org/ned/coveragepy/issues/25 +.. _issue 25: https://github.com/nedbat/coveragepy/issues/25 Version 3.1b1 --- 2009-09-27 @@ -2532,10 +2532,10 @@ Version 3.1b1 --- 2009-09-27 - Added a "coverage debug" command for getting diagnostic information about the coverage.py installation. -.. _issue 11: https://bitbucket.org/ned/coveragepy/issues/11 -.. _issue 12: https://bitbucket.org/ned/coveragepy/issues/12 -.. _issue 13: https://bitbucket.org/ned/coveragepy/issues/13 -.. _issue 24: https://bitbucket.org/ned/coveragepy/issues/24 +.. _issue 11: https://github.com/nedbat/coveragepy/issues/11 +.. _issue 12: https://github.com/nedbat/coveragepy/issues/12 +.. _issue 13: https://github.com/nedbat/coveragepy/issues/13 +.. _issue 24: https://github.com/nedbat/coveragepy/issues/24 .. _changes_301: @@ -2560,9 +2560,9 @@ Version 3.0.1 --- 2009-07-07 mode just like Python does. This lets it run Windows files on Mac, for example. -.. _issue 9: https://bitbucket.org/ned/coveragepy/issues/9 -.. _issue 10: https://bitbucket.org/ned/coveragepy/issues/10 -.. _issue 8: https://bitbucket.org/ned/coveragepy/issues/8 +.. _issue 9: https://github.com/nedbat/coveragepy/issues/9 +.. _issue 10: https://github.com/nedbat/coveragepy/issues/10 +.. _issue 8: https://github.com/nedbat/coveragepy/issues/8 .. _changes_30: @@ -2578,7 +2578,7 @@ Version 3.0 --- 2009-06-13 - Nested modules now get a proper flat_rootname. Thanks, Christian Heimes. -.. _issue 6: https://bitbucket.org/ned/coveragepy/issues/6 +.. _issue 6: https://github.com/nedbat/coveragepy/issues/6 Version 3.0b3 --- 2009-05-16 diff --git a/doc/plugins.rst b/doc/plugins.rst index 38990d946..fae4f73be 100644 --- a/doc/plugins.rst +++ b/doc/plugins.rst @@ -74,4 +74,4 @@ Some coverage.py plug-ins you might find useful: * `Mako template coverage plug-in`__: for measuring coverage in Mako templates. Doesn't work yet, probably needs some changes in Mako itself. - .. __: https://bitbucket.org/ned/coverage-mako-plugin + .. __: https://bitbucket-archive.softwareheritage.org/projects/ne/ned/coverage-mako-plugin.html diff --git a/doc/trouble.rst b/doc/trouble.rst index 08f8a4d3c..d508fd607 100644 --- a/doc/trouble.rst +++ b/doc/trouble.rst @@ -46,7 +46,7 @@ coverage.py from working properly: .. _sys.settrace: https://docs.python.org/3/library/sys.html#sys.settrace .. _thread: https://docs.python.org/3/library/_thread.html .. _threading: https://docs.python.org/3/library/threading.html -.. _issue 43: https://bitbucket.org/ned/coveragepy/issues/43/coverage-measurement-fails-on-code +.. _issue 43: https://github.com/nedbat/coveragepy/issues/43 Still having trouble? diff --git a/doc/whatsnew5x.rst b/doc/whatsnew5x.rst index 5f21a5d47..674ddcb14 100644 --- a/doc/whatsnew5x.rst +++ b/doc/whatsnew5x.rst @@ -111,7 +111,7 @@ New Features .. _TOML: https://github.com/toml-lang/toml#readme -.. _issue 650: https://bitbucket.org/ned/coveragepy/issues/650/allow-setting-configuration-file-location +.. _issue 650: https://github.com/nedbat/coveragepy/issues/650 Bugs Fixed From 804d88e30073e4b04ed61ffcd6daa8614f534d69 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:02:54 -0400 Subject: [PATCH 08/23] A better way to fix sphinx-tabs --- doc/conf.py | 3 +++ doc/requirements.pip | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index d2a787dc5..a5365bf03 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -232,6 +232,9 @@ r"https://coverage.readthedocs.io/en/coverage-{}$".format(release), ] +# https://github.com/executablebooks/sphinx-tabs/pull/54 +sphinx_tabs_valid_builders = ['linkcheck'] + # When auto-doc'ing a class, only write the class' docstring into the class docs, # don't automatically include the __init__ docstring. autoclass_content = "class" diff --git a/doc/requirements.pip b/doc/requirements.pip index b8a55afdb..a984af305 100644 --- a/doc/requirements.pip +++ b/doc/requirements.pip @@ -9,5 +9,4 @@ sphinx-rst-builder==0.0.3 sphinxcontrib-spelling==5.1.2 sphinx_rtd_theme==0.5.0 sphinx-autobuild==0.7.1 -# Our own fork that allows linkcheck to work: -git+https://github.com/nedbat/sphinx-tabs.git@master#egg=sphinx-tabs +sphinx-tabs==1.2.0 From 7cf317f4c0e25acf671e4d633a93d7648d5d219e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:18:38 -0400 Subject: [PATCH 09/23] More bitbucket->github urls --- coverage/control.py | 3 +-- perf/bug397.py | 3 +-- tests/test_api.py | 6 +++--- tests/test_arcs.py | 12 ++++++------ tests/test_cmdline.py | 2 +- tests/test_concurrency.py | 3 +-- tests/test_coverage.py | 2 +- tests/test_data.py | 4 ++-- tests/test_files.py | 6 +++--- tests/test_html.py | 10 +++++----- tests/test_oddball.py | 14 +++++++------- tests/test_parser.py | 4 ++-- tests/test_process.py | 20 ++++++++++---------- tests/test_summary.py | 8 ++++---- tests/test_xml.py | 16 ++++++++-------- 15 files changed, 55 insertions(+), 58 deletions(-) diff --git a/coverage/control.py b/coverage/control.py index cc0c271ac..d60db2126 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -1095,8 +1095,7 @@ def process_startup(): # flag (an attribute on this function) to indicate that coverage.py has # already been started, so we can avoid doing it twice. # - # https://bitbucket.org/ned/coveragepy/issue/340/keyerror-subpy has more - # details. + # https://github.com/nedbat/coveragepy/issues/340 has more details. if hasattr(process_startup, "coverage"): # We've annotated this function before, so we must have already diff --git a/perf/bug397.py b/perf/bug397.py index 4d72e908c..390741e56 100644 --- a/perf/bug397.py +++ b/perf/bug397.py @@ -7,8 +7,7 @@ $ coverage run lab/bug397.py fast Runtime per example: 131.34 +/- 4.48 us -Written by David MacIver as part of -https://bitbucket.org/ned/coveragepy/issues/397/stopping-and-resuming-coverage-with +Written by David MacIver as part of https://github.com/nedbat/coveragepy/issues/397 """ from __future__ import print_function diff --git a/tests/test_api.py b/tests/test_api.py index 8ab57955e..5ede9158b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -564,7 +564,7 @@ def test_warn_once(self): self.assertNotIn("Warning, warning 2!", err) def test_source_and_include_dont_conflict(self): - # A bad fix made this case fail: https://bitbucket.org/ned/coveragepy/issues/541 + # A bad fix made this case fail: https://github.com/nedbat/coveragepy/issues/541 self.make_file("a.py", "import b\na = 1") self.make_file("b.py", "b = 1") self.make_file(".coveragerc", """\ @@ -907,7 +907,7 @@ def test_source_package_dotted(self): self.filenames_not_in(lines, "p1a p1c p2a p2b othera otherb osa osb") def test_source_package_part_omitted(self): - # https://bitbucket.org/ned/coveragepy/issue/218 + # https://github.com/nedbat/coveragepy/issues/218 # Used to be if you omitted something executed and inside the source, # then after it was executed but not recorded, it would be found in # the search for unexecuted files, and given a score of 0%. @@ -920,7 +920,7 @@ def test_source_package_part_omitted(self): self.assertEqual(lines['p1c'], 0) def test_source_package_as_package_part_omitted(self): - # https://bitbucket.org/ned/coveragepy/issues/638/run-omit-is-ignored-since-45 + # https://github.com/nedbat/coveragepy/issues/638 lines = self.coverage_usepkgs(source=["pkg1"], omit=["*/p1b.py"]) self.filenames_in(lines, "p1a") self.filenames_not_in(lines, "p1b") diff --git a/tests/test_arcs.py b/tests/test_arcs.py index a02e9f7d1..c16f3fa7e 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -173,7 +173,7 @@ def example(): ) def test_bug_146(self): - # https://bitbucket.org/ned/coveragepy/issue/146 + # https://github.com/nedbat/coveragepy/issues/146 self.check_coverage("""\ for i in range(2): with open("test", "w") as f: @@ -284,7 +284,7 @@ def test_while_true(self): ) def test_zero_coverage_while_loop(self): - # https://bitbucket.org/ned/coveragepy/issue/502 + # https://github.com/nedbat/coveragepy/issues/502 self.make_file("main.py", "print('done')") self.make_file("zero.py", """\ def method(self): @@ -303,7 +303,7 @@ def method(self): self.assertIn(expected, squeezed[3]) def test_bug_496_continue_in_constant_while(self): - # https://bitbucket.org/ned/coveragepy/issue/496 + # https://github.com/nedbat/coveragepy/issues/496 # A continue in a while-true needs to jump to the right place. if env.PYBEHAVIOR.nix_while_true: arcz = ".1 13 34 45 53 46 67 7." @@ -1066,7 +1066,7 @@ def gen(inp): ) def test_abandoned_yield(self): - # https://bitbucket.org/ned/coveragepy/issue/440 + # https://github.com/nedbat/coveragepy/issues/440 self.check_coverage("""\ def gen(): print("yup") @@ -1256,7 +1256,7 @@ def test_unpacked_literals(self): ) def test_pathologically_long_code_object(self): - # https://bitbucket.org/ned/coveragepy/issue/359 + # https://github.com/nedbat/coveragepy/issues/359 # The structure of this file is such that an EXTENDED_ARG bytecode is # needed to encode the jump at the end. We weren't interpreting those # opcodes. @@ -1278,7 +1278,7 @@ def test_pathologically_long_code_object(self): self.assertEqual(self.stdout().split()[-1], str(n)) def test_partial_generators(self): - # https://bitbucket.org/ned/coveragepy/issues/475/generator-expression-is-marked-as-not + # https://github.com/nedbat/coveragepy/issues/475 # Line 2 is executed completely. # Line 3 is started but not finished, because zip ends before it finishes. # Line 4 is never started. diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index cdf8e56f1..374adb0de 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -236,7 +236,7 @@ def test_combine(self): """) def test_combine_doesnt_confuse_options_with_args(self): - # https://bitbucket.org/ned/coveragepy/issues/385/coverage-combine-doesnt-work-with-rcfile + # https://github.com/nedbat/coveragepy/issues/385 self.cmd_executes("combine --rcfile cov.ini", """\ cov = Coverage(config_file='cov.ini') cov.combine(None, strict=True) diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 9bfd88caf..7109f1707 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -545,8 +545,7 @@ def run_thread(): # pragma: nested def test_thread_safe_save_data(tmpdir): - # Non-regression test for: - # https://bitbucket.org/ned/coveragepy/issues/581 + # Non-regression test for: https://github.com/nedbat/coveragepy/issues/581 # Create some Python modules and put them in the path modules_dir = tmpdir.mkdir('test_modules') diff --git a/tests/test_coverage.py b/tests/test_coverage.py index 1b23f4081..02b577e52 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -1576,7 +1576,7 @@ def test_excludes_non_ascii(self): ) def test_formfeed(self): - # https://bitbucket.org/ned/coveragepy/issues/461/multiline-asserts-need-too-many-pragma + # https://github.com/nedbat/coveragepy/issues/461 self.check_coverage("""\ x = 1 assert len([]) == 0, ( diff --git a/tests/test_data.py b/tests/test_data.py index d058388c3..b3ac718e1 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -443,7 +443,7 @@ def test_add_to_hash_with_arcs(self): ]) def test_add_to_lines_hash_with_missing_file(self): - # https://bitbucket.org/ned/coveragepy/issues/403 + # https://github.com/nedbat/coveragepy/issues/403 covdata = CoverageData() covdata.add_lines(LINES_1) hasher = mock.Mock() @@ -454,7 +454,7 @@ def test_add_to_lines_hash_with_missing_file(self): ]) def test_add_to_arcs_hash_with_missing_file(self): - # https://bitbucket.org/ned/coveragepy/issues/403 + # https://github.com/nedbat/coveragepy/issues/403 covdata = CoverageData() covdata.add_arcs(ARCS_3) covdata.add_file_tracers({"y.py": "hologram_plugin"}) diff --git a/tests/test_files.py b/tests/test_files.py index 1aeacb517..a84ef61d1 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -47,7 +47,7 @@ def test_peer_directories(self): self.assertEqual(files.relative_filename(a2), a2) def test_filepath_contains_absolute_prefix_twice(self): - # https://bitbucket.org/ned/coveragepy/issue/194 + # https://github.com/nedbat/coveragepy/issues/194 # Build a path that has two pieces matching the absolute path prefix. # Technically, this test doesn't do that on Windows, but drive # letters make that impractical to achieve. @@ -309,7 +309,7 @@ def test_paths_are_os_corrected(self): self.assert_mapped(aliases, r'/home/ned/foo/src/sub/a.py', r'.\mysrc\sub\a.py') def test_windows_on_linux(self): - # https://bitbucket.org/ned/coveragepy/issues/618/problem-when-combining-windows-generated + # https://github.com/nedbat/coveragepy/issues/618 lin = "*/project/module/" win = "*\\project\\module\\" @@ -325,7 +325,7 @@ def test_windows_on_linux(self): ) def test_linux_on_windows(self): - # https://bitbucket.org/ned/coveragepy/issues/618/problem-when-combining-windows-generated + # https://github.com/nedbat/coveragepy/issues/618 lin = "*/project/module/" win = "*\\project\\module\\" diff --git a/tests/test_html.py b/tests/test_html.py index 6f22acc01..12012b6a6 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -408,7 +408,7 @@ def test_execed_liar_ignored_indentation_error(self): self.assert_exists("htmlcov/index.html") def test_decode_error(self): - # https://bitbucket.org/ned/coveragepy/issue/351/files-with-incorrect-encoding-are-ignored + # https://github.com/nedbat/coveragepy/issues/351 # imp.load_module won't load a file with an undecodable character # in a comment, though Python will run them. So we'll change the # file after running. @@ -437,7 +437,7 @@ def test_decode_error(self): self.assertIn(expected, html_report) def test_formfeeds(self): - # https://bitbucket.org/ned/coveragepy/issue/360/html-reports-get-confused-by-l-in-the-code + # https://github.com/nedbat/coveragepy/issues/360 self.make_file("formfeed.py", "line_one = 1\n\f\nline_two = 2\n") cov = coverage.Coverage() self.start_import_stop(cov, "formfeed") @@ -451,7 +451,7 @@ class HtmlTest(HtmlTestHelpers, CoverageTest): """Moar HTML tests.""" def test_missing_source_file_incorrect_message(self): - # https://bitbucket.org/ned/coveragepy/issue/60 + # https://github.com/nedbat/coveragepy/issues/60 self.make_file("thefile.py", "import sub.another\n") self.make_file("sub/__init__.py", "") self.make_file("sub/another.py", "print('another')\n") @@ -468,7 +468,7 @@ def test_missing_source_file_incorrect_message(self): def test_extensionless_file_collides_with_extension(self): # It used to be that "program" and "program.py" would both be reported # to "program.html". Now they are not. - # https://bitbucket.org/ned/coveragepy/issue/69 + # https://github.com/nedbat/coveragepy/issues/69 self.make_file("program", "import program\n") self.make_file("program.py", "a = 1\n") self.run_command("coverage run program") @@ -488,7 +488,7 @@ def test_has_date_stamp_in_files(self): def test_reporting_on_unmeasured_file(self): # It should be ok to ask for an HTML report on a file that wasn't even - # measured at all. https://bitbucket.org/ned/coveragepy/issues/403 + # measured at all. https://github.com/nedbat/coveragepy/issues/403 self.create_initial_files() self.make_file("other.py", "a = 1\n") self.run_coverage(htmlargs=dict(morfs=['other.py'])) diff --git a/tests/test_oddball.py b/tests/test_oddball.py index 90b922497..17f696477 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -94,7 +94,7 @@ def recur(n): ) def test_long_recursion_recovery(self): - # Test the core of bug 93: https://bitbucket.org/ned/coveragepy/issue/93 + # Test the core of bug 93: https://github.com/nedbat/coveragepy/issues/93 # When recovering from a stack overflow, the Python trace function is # disabled, but the C trace function is not. So if we're using a # Python trace function, we won't trace anything after the stack @@ -141,7 +141,7 @@ class MemoryLeakTest(CoverageTest): """Attempt the impossible: test that memory doesn't leak. Note: this test is truly unusual, and has had a colorful history. See - for example: https://bitbucket.org/ned/coveragepy/issue/186 + for example: https://github.com/nedbat/coveragepy/issues/186 It may still fail occasionally, especially on PyPy. @@ -276,7 +276,7 @@ def foo(): self.assertEqual(missing, []) # Make sure pyexpat isn't recorded as a source file. - # https://bitbucket.org/ned/coveragepy/issues/419/nosource-no-source-for-code-path-to-c + # https://github.com/nedbat/coveragepy/issues/419 files = cov.get_data().measured_files() self.assertFalse( any(f.endswith("pyexpat.c") for f in files), @@ -425,7 +425,7 @@ def return_arg_or_void(arg): class GettraceTest(CoverageTest): """Tests that we work properly with `sys.gettrace()`.""" def test_round_trip_in_untraced_function(self): - # https://bitbucket.org/ned/coveragepy/issues/575/running-doctest-prevents-complete-coverage + # https://github.com/nedbat/coveragepy/issues/575 self.make_file("main.py", """import sample""") self.make_file("sample.py", """\ from swap import swap_it @@ -458,7 +458,7 @@ def swap_it(): self.assertEqual(missing, []) def test_setting_new_trace_function(self): - # https://bitbucket.org/ned/coveragepy/issues/436/disabled-coverage-ctracer-may-rise-from + # https://github.com/nedbat/coveragepy/issues/436 self.check_coverage('''\ import sys @@ -535,7 +535,7 @@ def show_trace_function(): class ExecTest(CoverageTest): """Tests of exec.""" def test_correct_filename(self): - # https://bitbucket.org/ned/coveragepy/issues/380/code-executed-by-exec-excluded-from + # https://github.com/nedbat/coveragepy/issues/380 # Bug was that exec'd files would have their lines attributed to the # calling file. Make two files, both with ~30 lines, but no lines in # common. Line 30 in to_exec.py was recorded as line 30 in main.py, @@ -579,7 +579,7 @@ def test_unencodable_filename(self): class MockingProtectionTest(CoverageTest): """Tests about protecting ourselves from aggressive mocking. - https://bitbucket.org/ned/coveragepy/issues/416/coverage-40-is-causing-existing-unit-tests + https://github.com/nedbat/coveragepy/issues/416 """ def test_os_path_exists(self): diff --git a/tests/test_parser.py b/tests/test_parser.py index a8da45cf8..03bf25de3 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -45,7 +45,7 @@ class Bar: }) def test_generator_exit_counts(self): - # https://bitbucket.org/ned/coveragepy/issue/324/yield-in-loop-confuses-branch-coverage + # https://github.com/nedbat/coveragepy/issues/324 parser = self.parse_source("""\ def gen(input): for n in inp: @@ -453,7 +453,7 @@ def test_encoding(self): def test_missing_line_ending(self): # Test that the set of statements is the same even if a final # multi-line statement has no final newline. - # https://bitbucket.org/ned/coveragepy/issue/293 + # https://github.com/nedbat/coveragepy/issues/293 self.make_file("normal.py", """\ out, err = subprocess.Popen( diff --git a/tests/test_process.py b/tests/test_process.py index 8f8b009c3..25f1fcc9d 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -146,7 +146,7 @@ def test_combine_parallel_data_with_a_corrupt_file(self): self.assertEqual(line_counts(data)['b_or_c.py'], 8) def test_combine_no_usable_files(self): - # https://bitbucket.org/ned/coveragepy/issues/629/multiple-use-of-combine-leads-to-empty + # https://github.com/nedbat/coveragepy/issues/629 self.make_b_or_c_py() out = self.run_command("coverage run b_or_c.py b") self.assertEqual(out, 'done\n') @@ -595,7 +595,7 @@ def test_warns_if_never_run(self): self.assertNotIn("Exception", out) def test_warnings_trace_function_changed_with_threads(self): - # https://bitbucket.org/ned/coveragepy/issue/164 + # https://github.com/nedbat/coveragepy/issues/164 if env.METACOV: self.skipTest("Can't test tracers changing during metacoverage") @@ -754,7 +754,7 @@ def test_lang_c(self): # failures with non-ascii file names. We don't want to make a real file # with strange characters, though, because that gets the test runners # tangled up. This will isolate the concerns to the coverage.py code. - # https://bitbucket.org/ned/coveragepy/issues/533/exception-on-unencodable-file-name + # https://github.com/nedbat/coveragepy/issues/533 self.make_file("weird_file.py", r""" globs = {} code = "a = 1\nb = 2\n" @@ -768,7 +768,7 @@ def test_lang_c(self): def test_deprecation_warnings(self): # Test that coverage doesn't trigger deprecation warnings. - # https://bitbucket.org/ned/coveragepy/issue/305/pendingdeprecationwarning-the-imp-module + # https://github.com/nedbat/coveragepy/issues/305 self.make_file("allok.py", """\ import warnings warnings.simplefilter('default') @@ -784,7 +784,7 @@ def test_deprecation_warnings(self): self.assertEqual(out, "No warnings!\n") def test_run_twice(self): - # https://bitbucket.org/ned/coveragepy/issue/353/40a3-introduces-an-unexpected-third-case + # https://github.com/nedbat/coveragepy/issues/353 self.make_file("foo.py", """\ def foo(): pass @@ -812,7 +812,7 @@ def foo(): ) def test_module_name(self): - # https://bitbucket.org/ned/coveragepy/issues/478/help-shows-silly-program-name-when-running + # https://github.com/nedbat/coveragepy/issues/478 out = self.run_command("python -m coverage") self.assertIn("Use 'coverage help' for help", out) @@ -957,7 +957,7 @@ def test_coverage_run_script_imports_doubledashsource(self): self.assertEqual(self.line_count(out), 6, out) def test_coverage_run_dashm_is_like_python_dashm_off_path(self): - # https://bitbucket.org/ned/coveragepy/issue/242 + # https://github.com/nedbat/coveragepy/issues/242 self.make_file("sub/__init__.py", "") with open(TRY_EXECFILE) as f: self.make_file("sub/run_me.py", f.read()) @@ -967,7 +967,7 @@ def test_coverage_run_dashm_is_like_python_dashm_off_path(self): self.assert_tryexecfile_output(expected, actual) def test_coverage_run_dashm_is_like_python_dashm_with__main__207(self): - # https://bitbucket.org/ned/coveragepy/issue/207 + # https://github.com/nedbat/coveragepy/issues/207 self.make_file("package/__init__.py", "print('init')") self.make_file("package/__main__.py", "print('main')") expected = self.run_command("python -m package") @@ -1404,7 +1404,7 @@ def possible_pth_dirs(): yield pth_dir # If we're still looking, then try the Python library directory. - # https://bitbucket.org/ned/coveragepy/issue/339/pth-test-malfunctions + # https://github.com/nedbat/coveragepy/issues/339 yield sysconfig.get_python_lib() # pragma: cant happen @@ -1505,7 +1505,7 @@ def test_subprocess_with_pth_files(self): # pragma: no metacov self.assertEqual(line_counts(data)['sub.py'], 3) def test_subprocess_with_pth_files_and_parallel(self): # pragma: no metacov - # https://bitbucket.org/ned/coveragepy/issues/492/subprocess-coverage-strange-detection-of + # https://github.com/nedbat/coveragepy/issues/492 if env.METACOV: self.skipTest("Can't test sub-process pth file suppport during metacoverage") diff --git a/tests/test_summary.py b/tests/test_summary.py index 9513d1599..eb25a4d80 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -131,7 +131,7 @@ def test_report_including(self): self.assertEqual(self.last_line_squeezed(report), "mycode.py 4 0 100%") def test_run_source_vs_report_include(self): - # https://bitbucket.org/ned/coveragepy/issues/621/include-ignored-warning-when-using + # https://github.com/nedbat/coveragepy/issues/621 self.make_file(".coveragerc", """\ [run] source = . @@ -146,7 +146,7 @@ def test_run_source_vs_report_include(self): cov.stop() # pragma: nested def test_run_omit_vs_report_omit(self): - # https://bitbucket.org/ned/coveragepy/issues/622/report-omit-overwrites-run-omit + # https://github.com/nedbat/coveragepy/issues/622 # report:omit shouldn't clobber run:omit. self.make_mycode() self.make_file(".coveragerc", """\ @@ -646,7 +646,7 @@ def get_report(self, cov): return report def test_bug_156_file_not_run_should_be_zero(self): - # https://bitbucket.org/ned/coveragepy/issue/156 + # https://github.com/nedbat/coveragepy/issues/156 self.make_file("mybranch.py", """\ def branch(x): if x: @@ -693,7 +693,7 @@ def test_pyw_files(self): if not env.WINDOWS: self.skipTest(".pyw files are only on Windows.") - # https://bitbucket.org/ned/coveragepy/issue/261 + # https://github.com/nedbat/coveragepy/issues/261 self.make_file("start.pyw", """\ import mod print("In start.pyw") diff --git a/tests/test_xml.py b/tests/test_xml.py index 8c3995947..e3be7a543 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -124,13 +124,13 @@ def test_config_affects_xml_placement(self): self.assert_exists("xml.out") def test_no_data(self): - # https://bitbucket.org/ned/coveragepy/issue/210 + # https://github.com/nedbat/coveragepy/issues/210 self.run_command("coverage xml") self.assert_doesnt_exist("coverage.xml") def test_no_source(self): # Written while investigating a bug, might as well keep it. - # https://bitbucket.org/ned/coveragepy/issue/208 + # https://github.com/nedbat/coveragepy/issues/208 self.make_file("innocuous.py", "a = 4") cov = coverage.Coverage() self.start_import_stop(cov, "innocuous") @@ -165,7 +165,7 @@ def test_filename_format_including_module(self): def test_reporting_on_nothing(self): # Used to raise a zero division error: - # https://bitbucket.org/ned/coveragepy/issue/250 + # https://github.com/nedbat/coveragepy/issues/250 self.make_file("empty.py", "") cov = coverage.Coverage() empty = self.start_import_stop(cov, "empty") @@ -177,7 +177,7 @@ def test_reporting_on_nothing(self): assert elts[0].get('line-rate') == '1' def test_empty_file_is_100_not_0(self): - # https://bitbucket.org/ned/coveragepy/issue/345 + # https://github.com/nedbat/coveragepy/issues/345 cov = self.run_doit() cov.xml_report() dom = ElementTree.parse("coverage.xml") @@ -205,7 +205,7 @@ def test_curdir_source(self): def test_deep_source(self): # When using source=, the XML report needs to mention those directories # in the elements. - # https://bitbucket.org/ned/coveragepy/issues/439/incorrect-cobertura-file-sources-generated + # https://github.com/nedbat/coveragepy/issues/439 self.make_file("src/main/foo.py", "a = 1") self.make_file("also/over/there/bar.py", "b = 2") cov = coverage.Coverage(source=["src/main", "also/over/there", "not/really"]) @@ -242,7 +242,7 @@ def test_deep_source(self): } def test_nonascii_directory(self): - # https://bitbucket.org/ned/coveragepy/issues/573/cant-generate-xml-report-if-some-source + # https://github.com/nedbat/coveragepy/issues/573 self.make_file("테스트/program.py", "a = 1") with change_dir("테스트"): cov = coverage.Coverage() @@ -364,8 +364,8 @@ def test_package_depth_3(self): ]) def test_source_prefix(self): - # https://bitbucket.org/ned/coveragepy/issues/465 - # https://bitbucket.org/ned/coveragepy/issues/526/generated-xml-invalid-paths-for-cobertura + # https://github.com/nedbat/coveragepy/issues/465 + # https://github.com/nedbat/coveragepy/issues/526 self.make_file("src/mod.py", "print(17)") cov = coverage.Coverage(source=["src"]) self.start_import_stop(cov, "mod", modfile="src/mod.py") From d0d49f076c716865b88086e9117d78d8cc3e3d94 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:52:17 -0400 Subject: [PATCH 10/23] Update requirements --- doc/requirements.pip | 4 ++-- requirements/pip.pip | 4 ++-- requirements/pytest.pip | 2 +- requirements/tox.pip | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/requirements.pip b/doc/requirements.pip index a984af305..fb47cd29f 100644 --- a/doc/requirements.pip +++ b/doc/requirements.pip @@ -4,9 +4,9 @@ doc8==0.8.1 pyenchant==3.1.1 -sphinx==2.4.3 +sphinx==3.2.1 sphinx-rst-builder==0.0.3 -sphinxcontrib-spelling==5.1.2 +sphinxcontrib-spelling==5.3.0 sphinx_rtd_theme==0.5.0 sphinx-autobuild==0.7.1 sphinx-tabs==1.2.0 diff --git a/requirements/pip.pip b/requirements/pip.pip index aa51bca35..01ee89bb7 100644 --- a/requirements/pip.pip +++ b/requirements/pip.pip @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt -pip==20.1.1 -virtualenv==20.0.25 +pip==20.2.2 +virtualenv==20.0.31 diff --git a/requirements/pytest.pip b/requirements/pytest.pip index 795b1d3fd..5149e0736 100644 --- a/requirements/pytest.pip +++ b/requirements/pytest.pip @@ -20,4 +20,4 @@ unittest-mixins==1.6 #-e/Users/ned/unittest_mixins # Just so I have a debugger if I want it -pudb==2019.1 +pudb==2019.2 diff --git a/requirements/tox.pip b/requirements/tox.pip index 1428e42a2..7ba31f447 100644 --- a/requirements/tox.pip +++ b/requirements/tox.pip @@ -2,4 +2,4 @@ # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # The version of tox used by coverage.py -tox==3.16.1 +tox==3.19.0 From 624580b7187d65288767ad7dc0915af1fd2e9a8c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 21:20:56 -0400 Subject: [PATCH 11/23] Don't complain about trivial problems in doc/help --- igor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/igor.py b/igor.py index 3d51e5769..9a632b577 100644 --- a/igor.py +++ b/igor.py @@ -255,6 +255,7 @@ def do_check_eol(): '_build', '_spell', 'tmp', + 'help', ] checked = set() From 4859de2850f703207b0cab2ff6e7116a3e587b65 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 21:26:02 -0400 Subject: [PATCH 12/23] Fix two problems with docs --- doc/cmd.rst | 4 ++-- doc/conf.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/cmd.rst b/doc/cmd.rst index b294ee8db..f6087fecf 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -197,8 +197,8 @@ could affect the measurement process. The possible warnings include: :meth:`.Coverage.switch_context` function to change the context. Only one of these mechanisms should be in use at a time. -Individual warnings can be disabled with the `disable_warnings -`_ configuration setting. To silence "No data was +Individual warnings can be disabled with the :ref:`disable_warnings +` configuration setting. To silence "No data was collected," add this to your .coveragerc file:: [run] diff --git a/doc/conf.py b/doc/conf.py index a5365bf03..9ca2d8873 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -243,6 +243,6 @@ def setup(app): """Configure Sphinx""" - app.add_stylesheet('coverage.css') + app.add_css_file('coverage.css') app.add_config_value('prerelease', False, 'env') print("** Prerelease = %r" % prerelease) From ebb6b39d745dff6fd1ca03fc67b58f022c2c82bd Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 21:56:44 -0400 Subject: [PATCH 13/23] Remove a noisy command from the output --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b383bbca..a72f9ee61 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,7 @@ $(DOCBIN): tox -q -e doc --notest cmd_help: $(DOCBIN) - for cmd in annotate combine debug erase html json report run xml; do \ + @for cmd in annotate combine debug erase html json report run xml; do \ echo > doc/help/$$cmd.rst; \ echo ".. code::" >> doc/help/$$cmd.rst; \ echo >> doc/help/$$cmd.rst; \ From c3159081ae67864f75aacc1b86310fe9d8d614cb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 2 Sep 2020 07:18:46 -0400 Subject: [PATCH 14/23] Explain a mystery --- tests/coveragetest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 58cfb3dc6..f4961ed9b 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -348,6 +348,10 @@ def command_line(self, args, ret=OK): ret_actual = command_line(args) self.assertEqual(ret_actual, ret) + # Some distros rename the coverage command, and need a way to indicate + # their new command name to the tests. This is here for them to override, + # for example: + # https://salsa.debian.org/debian/pkg-python-coverage/-/blob/master/debian/patches/02.rename-public-programs.patch coverage_command = "coverage" def run_command(self, cmd): From 154f5284e124e610d80a0b5c7e3fac9132c891d6 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sat, 12 Sep 2020 21:49:54 +0100 Subject: [PATCH 15/23] replace confusing comment with assertion (#1028) --- tests/test_api.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 5ede9158b..ab4b8a8f8 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -887,21 +887,30 @@ def test_source_include_exclusive(self): cov.start() cov.stop() # pragma: nested + def test_source_package_as_package(self): + self.assertFalse(os.path.isdir("pkg1")) + lines = self.coverage_usepkgs(source=["pkg1"]) + self.filenames_in(lines, "p1a p1b") + self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") + # Because source= was specified, we do search for unexecuted files. + self.assertEqual(lines['p1c'], 0) + def test_source_package_as_dir(self): - # pkg1 is a directory, since we cd'd into tests/modules in setUp. + self.chdir(self.nice_file(TESTS_DIR, 'modules')) + self.assertTrue(os.path.isdir("pkg1")) lines = self.coverage_usepkgs(source=["pkg1"]) self.filenames_in(lines, "p1a p1b") self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['p1c'], 0) - def test_source_package_as_package(self): + def test_source_package_dotted_sub(self): lines = self.coverage_usepkgs(source=["pkg1.sub"]) self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['runmod3'], 0) - def test_source_package_dotted(self): + def test_source_package_dotted_p1b(self): lines = self.coverage_usepkgs(source=["pkg1.p1b"]) self.filenames_in(lines, "p1b") self.filenames_not_in(lines, "p1a p1c p2a p2b othera otherb osa osb") From 39e6d1de90b9574f8eaa266b289a7efc02b2e9e9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 12 Sep 2020 16:51:04 -0400 Subject: [PATCH 16/23] Thomas Grainger's first commit --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 99b8493f4..7af8202b7 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -132,6 +132,7 @@ S. Y. Lee Teake Nutma Ted Wexler Thijs Triemstra +Thomas Grainger Titus Brown Vince Salvino Ville Skyttä From ecd6ab19a43a444bc7fc9dfbc08f3ca5274365ca Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sun, 13 Sep 2020 00:26:36 +0100 Subject: [PATCH 17/23] Create Way to force package even if filepath exists (#1026) Fixes: #268 --- coverage/config.py | 2 ++ coverage/control.py | 4 ++-- coverage/inorout.py | 1 + tests/modules/ambigious/__init__.py | 0 tests/modules/ambigious/pkg1/__init__.py | 0 tests/modules/ambigious/pkg1/ambigious.py | 0 tests/test_api.py | 22 ++++++++++++++++++++++ tests/test_config.py | 2 ++ 8 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tests/modules/ambigious/__init__.py create mode 100644 tests/modules/ambigious/pkg1/__init__.py create mode 100644 tests/modules/ambigious/pkg1/ambigious.py diff --git a/coverage/config.py b/coverage/config.py index 84d9758bf..2af4a1cc8 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -195,6 +195,7 @@ def __init__(self): self.run_include = None self.run_omit = None self.source = None + self.source_pkgs = [] self.timid = False self._crash = None @@ -361,6 +362,7 @@ def copy(self): ('run_include', 'run:include', 'list'), ('run_omit', 'run:omit', 'list'), ('source', 'run:source', 'list'), + ('source_pkgs', 'run:source_pkgs', 'list'), ('timid', 'run:timid', 'boolean'), ('_crash', 'run:_crash'), diff --git a/coverage/control.py b/coverage/control.py index d60db2126..ebc380091 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -99,7 +99,7 @@ def current(cls): def __init__( self, data_file=_DEFAULT_DATAFILE, data_suffix=None, cover_pylib=None, auto_data=False, timid=None, branch=None, config_file=True, - source=None, omit=None, include=None, debug=None, + source=None, source_pkgs=None, omit=None, include=None, debug=None, concurrency=None, check_preimported=False, context=None, ): """ @@ -188,7 +188,7 @@ def __init__( config_file=config_file, data_file=data_file, cover_pylib=cover_pylib, timid=timid, branch=branch, parallel=bool_or_none(data_suffix), - source=source, run_omit=omit, run_include=include, debug=debug, + source=source, source_pkgs=source_pkgs, run_omit=omit, run_include=include, debug=debug, report_omit=omit, report_include=include, concurrency=concurrency, context=context, ) diff --git a/coverage/inorout.py b/coverage/inorout.py index ec5f2c1ac..fbd1a95ed 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -132,6 +132,7 @@ def __init__(self, warn, debug): def configure(self, config): """Apply the configuration to get ready for decision-time.""" + self.source_pkgs.extend(config.source_pkgs) for src in config.source or []: if os.path.isdir(src): self.source.append(canonical_filename(src)) diff --git a/tests/modules/ambigious/__init__.py b/tests/modules/ambigious/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/modules/ambigious/pkg1/__init__.py b/tests/modules/ambigious/pkg1/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/modules/ambigious/pkg1/ambigious.py b/tests/modules/ambigious/pkg1/ambigious.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_api.py b/tests/test_api.py index ab4b8a8f8..7311073a3 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -935,6 +935,28 @@ def test_source_package_as_package_part_omitted(self): self.filenames_not_in(lines, "p1b") self.assertEqual(lines['p1c'], 0) + def test_ambigious_source_package_as_dir(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) + # pkg1 defaults to directory because tests/modules/ambigious/pkg1 exists + lines = self.coverage_usepkgs(source=["pkg1"]) + self.assertEqual( + self.coverage_usepkgs(source=["pkg1"]), + { + u"__init__.py": 0, u"__init__": 0, + u"ambigious.py": 0, u"ambigious": 0, + }, + ) + + def test_ambigious_source_package_as_package(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) + lines = self.coverage_usepkgs(source_pkgs=["pkg1"]) + self.filenames_in(lines, "p1a p1b") + self.filenames_not_in(lines, "p2a p2b othera otherb osa osb ambigious") + # Because source= was specified, we do search for unexecuted files. + self.assertEqual(lines['p1c'], 0) + class ReportIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest): """Tests of the report include/omit functionality.""" diff --git a/tests/test_config.py b/tests/test_config.py index 89ecb17c6..dd86303f2 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -462,6 +462,7 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest): ; this omit is overriden by the omit from [report] omit = twenty source = myapp + source_pkgs = ned plugins = plugins.a_plugin plugins.another @@ -553,6 +554,7 @@ def assert_config_settings_are_correct(self, cov): self.assertTrue(cov.config.parallel) self.assertEqual(cov.config.concurrency, ["thread"]) self.assertEqual(cov.config.source, ["myapp"]) + self.assertEqual(cov.config.source_pkgs, ["ned"]) self.assertEqual(cov.config.disable_warnings, ["abcd", "efgh"]) self.assertEqual(cov.get_exclude_list(), ["if 0:", r"pragma:?\s+no cover", "another_tab"]) From 263f3e1da8e5a6a32056a8697286f9adf0f6a55d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 12 Sep 2020 19:42:14 -0400 Subject: [PATCH 18/23] Docs and cleanup for source_pkgs --- CHANGES.rst | 8 ++++++++ coverage/control.py | 9 ++++++++- coverage/version.py | 2 +- doc/config.rst | 8 ++++++++ tests/modules/ambigious/pkg1/__init__.py | 1 + tests/modules/ambigious/pkg1/ambigious.py | 2 ++ tests/modules/usepkgs.py | 1 + tests/test_api.py | 9 ++------- 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 0bbf4d34b..604763f74 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -25,6 +25,14 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. Unreleased ---------- +- The ``source`` setting has always been interpreted as either a file path or a + module, depending on which existed. If both interpretations were valid, it + was assumed to be a file path. The new ``source_pkgs`` setting can be used + to name a package to disambiguate this case. Thanks, Thomas Grainger. Fixes + `issue 268`_. + +.. _issue 268: https://github.com/nedbat/coveragepy/issues/268 + .. _changes_521: diff --git a/coverage/control.py b/coverage/control.py index ebc380091..7c4a48280 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -101,7 +101,7 @@ def __init__( auto_data=False, timid=None, branch=None, config_file=True, source=None, source_pkgs=None, omit=None, include=None, debug=None, concurrency=None, check_preimported=False, context=None, - ): + ): # pylint: disable=too-many-arguments """ Many of these arguments duplicate and override values that can be provided in a configuration file. Parameters that are missing here @@ -146,6 +146,10 @@ def __init__( in the trees indicated by the file paths or package names will be measured. + `source_pkgs` is a list of package names. It works the same as + `source`, but can be used to name packages where the name can also be + interpreted as a file path. + `include` and `omit` are lists of file name patterns. Files that match `include` will be measured, files that match `omit` will not. Each will also accept a single string argument. @@ -176,6 +180,9 @@ def __init__( .. versionadded:: 5.0 The `check_preimported` and `context` parameters. + .. versionadded:: 5.3 + The `source_pkgs` parameter. + """ # data_file=None means no disk file at all. data_file missing means # use the value from the config file. diff --git a/coverage/version.py b/coverage/version.py index b4a503376..830285f4d 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 2, 2, "alpha", 0) +version_info = (5, 3, 0, "alpha", 0) def _make_version(major, minor, micro, releaselevel, serial): diff --git a/doc/config.rst b/doc/config.rst index 6a0dbcf82..c6cb94dd5 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -208,6 +208,14 @@ for details. measure during execution. If set, ``include`` is ignored. See :ref:`source` for details. +.. _config_run_source_pkgs: + +``source_pkgs`` (multi-string): a list of packages, the source to measure +during execution. Operates the same as ``source``, but only names packages, +for resolving ambiguities between packages and directories. + +.. versionadded:: 5.3 + .. _config_run_timid: ``timid`` (boolean, default False): use a simpler but slower trace method. diff --git a/tests/modules/ambigious/pkg1/__init__.py b/tests/modules/ambigious/pkg1/__init__.py index e69de29bb..59742bbb9 100644 --- a/tests/modules/ambigious/pkg1/__init__.py +++ b/tests/modules/ambigious/pkg1/__init__.py @@ -0,0 +1 @@ +print("Ambiguous pkg1") diff --git a/tests/modules/ambigious/pkg1/ambigious.py b/tests/modules/ambigious/pkg1/ambigious.py index e69de29bb..6048d6da6 100644 --- a/tests/modules/ambigious/pkg1/ambigious.py +++ b/tests/modules/ambigious/pkg1/ambigious.py @@ -0,0 +1,2 @@ +amb = 1 +amb = 2 diff --git a/tests/modules/usepkgs.py b/tests/modules/usepkgs.py index 63ce7c186..2e4d21a71 100644 --- a/tests/modules/usepkgs.py +++ b/tests/modules/usepkgs.py @@ -5,3 +5,4 @@ import pkg2.p2a, pkg2.p2b import othermods.othera, othermods.otherb import othermods.sub.osa, othermods.sub.osb +import ambigious, ambigious.pkg1.ambigious diff --git a/tests/test_api.py b/tests/test_api.py index 7311073a3..a28d0133c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -940,13 +940,8 @@ def test_ambigious_source_package_as_dir(self): self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) # pkg1 defaults to directory because tests/modules/ambigious/pkg1 exists lines = self.coverage_usepkgs(source=["pkg1"]) - self.assertEqual( - self.coverage_usepkgs(source=["pkg1"]), - { - u"__init__.py": 0, u"__init__": 0, - u"ambigious.py": 0, u"ambigious": 0, - }, - ) + self.filenames_in(lines, "ambigious") + self.filenames_not_in(lines, "p1a p1b p1c") def test_ambigious_source_package_as_package(self): # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious From c907b2ee1184dbcea1a3698588ad198a32fbea71 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 12 Sep 2020 19:53:31 -0400 Subject: [PATCH 19/23] ambigious -> ambiguous --- .../{ambigious => ambiguous}/__init__.py | 0 .../{ambigious => ambiguous}/pkg1/__init__.py | 0 .../pkg1/ambiguous.py} | 0 tests/modules/usepkgs.py | 2 +- tests/test_api.py | 18 +++++++++--------- 5 files changed, 10 insertions(+), 10 deletions(-) rename tests/modules/{ambigious => ambiguous}/__init__.py (100%) rename tests/modules/{ambigious => ambiguous}/pkg1/__init__.py (100%) rename tests/modules/{ambigious/pkg1/ambigious.py => ambiguous/pkg1/ambiguous.py} (100%) diff --git a/tests/modules/ambigious/__init__.py b/tests/modules/ambiguous/__init__.py similarity index 100% rename from tests/modules/ambigious/__init__.py rename to tests/modules/ambiguous/__init__.py diff --git a/tests/modules/ambigious/pkg1/__init__.py b/tests/modules/ambiguous/pkg1/__init__.py similarity index 100% rename from tests/modules/ambigious/pkg1/__init__.py rename to tests/modules/ambiguous/pkg1/__init__.py diff --git a/tests/modules/ambigious/pkg1/ambigious.py b/tests/modules/ambiguous/pkg1/ambiguous.py similarity index 100% rename from tests/modules/ambigious/pkg1/ambigious.py rename to tests/modules/ambiguous/pkg1/ambiguous.py diff --git a/tests/modules/usepkgs.py b/tests/modules/usepkgs.py index 2e4d21a71..7b42976d5 100644 --- a/tests/modules/usepkgs.py +++ b/tests/modules/usepkgs.py @@ -5,4 +5,4 @@ import pkg2.p2a, pkg2.p2b import othermods.othera, othermods.otherb import othermods.sub.osa, othermods.sub.osb -import ambigious, ambigious.pkg1.ambigious +import ambiguous, ambiguous.pkg1.ambiguous diff --git a/tests/test_api.py b/tests/test_api.py index a28d0133c..e2a2a5556 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -935,20 +935,20 @@ def test_source_package_as_package_part_omitted(self): self.filenames_not_in(lines, "p1b") self.assertEqual(lines['p1c'], 0) - def test_ambigious_source_package_as_dir(self): - # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious - self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) - # pkg1 defaults to directory because tests/modules/ambigious/pkg1 exists + def test_ambiguous_source_package_as_dir(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambiguous + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous")) + # pkg1 defaults to directory because tests/modules/ambiguous/pkg1 exists lines = self.coverage_usepkgs(source=["pkg1"]) - self.filenames_in(lines, "ambigious") + self.filenames_in(lines, "ambiguous") self.filenames_not_in(lines, "p1a p1b p1c") - def test_ambigious_source_package_as_package(self): - # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious - self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) + def test_ambiguous_source_package_as_package(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambiguous + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous")) lines = self.coverage_usepkgs(source_pkgs=["pkg1"]) self.filenames_in(lines, "p1a p1b") - self.filenames_not_in(lines, "p2a p2b othera otherb osa osb ambigious") + self.filenames_not_in(lines, "p2a p2b othera otherb osa osb ambiguous") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['p1c'], 0) From 987ceb9300c9326e4932dd69d633e7bd7be04e16 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 13:30:20 -0400 Subject: [PATCH 20/23] Fix a missed exception handling for bad plugins --- coverage/ctracer/tracer.c | 3 ++- tests/test_plugins.py | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index 7d639112d..508086429 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -685,7 +685,8 @@ CTracer_handle_line(CTracer *self, PyFrameObject *frame) STATS( self->stats.pycalls++; ) from_to = PyObject_CallMethodObjArgs(self->pcur_entry->file_tracer, str_line_number_range, frame, NULL); if (from_to == NULL) { - goto error; + CTracer_disable_plugin(self, self->pcur_entry->disposition); + goto ok; } ret2 = CTracer_unpack_pair(self, from_to, &lineno_from, &lineno_to); Py_DECREF(from_to); diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 2477f5ce7..ed58c5f41 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -804,6 +804,28 @@ def coverage_init(reg, options): """) self.run_bad_plugin("bad_plugin", "Plugin") + def test_line_number_range_raises_error(self): + self.make_file("bad_plugin.py", """\ + import coverage.plugin + class Plugin(coverage.plugin.CoveragePlugin): + def file_tracer(self, filename): + if filename.endswith("other.py"): + return BadFileTracer() + + class BadFileTracer(coverage.plugin.FileTracer): + def source_filename(self): + return "something.foo" + + def line_number_range(self, frame): + raise Exception("borked!") + + def coverage_init(reg, options): + reg.add_file_tracer(Plugin()) + """) + self.run_bad_plugin( + "bad_plugin", "Plugin", our_error=False, excmsg="borked!", + ) + def test_line_number_range_returns_non_tuple(self): self.make_file("bad_plugin.py", """\ import coverage.plugin From 24eb6fdc8495f969ffeb724f2e96d3941442dd2d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 13:58:44 -0400 Subject: [PATCH 21/23] Move disable_plugin to Python --- coverage/collector.py | 11 ++++++++ coverage/ctracer/tracer.c | 56 +++++++-------------------------------- coverage/ctracer/tracer.h | 1 + 3 files changed, 21 insertions(+), 47 deletions(-) diff --git a/coverage/collector.py b/coverage/collector.py index a042357f6..3545ab1e2 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -256,6 +256,8 @@ def _start_tracer(self): if hasattr(tracer, 'should_start_context'): tracer.should_start_context = self.should_start_context tracer.switch_context = self.switch_context + if hasattr(tracer, 'disable_plugin'): + tracer.disable_plugin = self.disable_plugin fn = tracer.start() self.tracers.append(tracer) @@ -381,6 +383,15 @@ def switch_context(self, new_context): context = new_context self.covdata.set_context(context) + def disable_plugin(self, disposition): + """Disable the plugin mentioned in `disposition`.""" + file_tracer = disposition.file_tracer + plugin = file_tracer._coverage_plugin + plugin_name = plugin._coverage_plugin_name + self.warn("Disabling plug-in {!r} due to previous exception".format(plugin_name)) + plugin._coverage_enabled = False + disposition.trace = False + def cached_mapped_file(self, filename): """A locally cached version of file names mapped through file_mapper.""" key = (type(filename), filename) diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index 508086429..045523524 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -103,6 +103,7 @@ CTracer_dealloc(CTracer *self) Py_XDECREF(self->should_start_context); Py_XDECREF(self->switch_context); Py_XDECREF(self->context); + Py_XDECREF(self->disable_plugin); DataStack_dealloc(&self->stats, &self->data_stack); if (self->data_stacks) { @@ -570,52 +571,17 @@ CTracer_handle_call(CTracer *self, PyFrameObject *frame) static void CTracer_disable_plugin(CTracer *self, PyObject * disposition) { - PyObject * file_tracer = NULL; - PyObject * plugin = NULL; - PyObject * plugin_name = NULL; - PyObject * msg = NULL; - PyObject * ignored = NULL; - + PyObject * ret; PyErr_Print(); - file_tracer = PyObject_GetAttr(disposition, str_file_tracer); - if (file_tracer == NULL) { - goto error; - } - if (file_tracer == Py_None) { - /* This shouldn't happen... */ - goto ok; - } - plugin = PyObject_GetAttr(file_tracer, str__coverage_plugin); - if (plugin == NULL) { - goto error; - } - plugin_name = PyObject_GetAttr(plugin, str__coverage_plugin_name); - if (plugin_name == NULL) { - goto error; - } - msg = MyText_FromFormat( - "Disabling plug-in '%s' due to previous exception", - MyText_AsString(plugin_name) - ); - if (msg == NULL) { - goto error; - } STATS( self->stats.pycalls++; ) - ignored = PyObject_CallFunctionObjArgs(self->warn, msg, NULL); - if (ignored == NULL) { - goto error; - } - - /* Disable the plugin for future files, and stop tracing this file. */ - if (PyObject_SetAttr(plugin, str__coverage_enabled, Py_False) < 0) { - goto error; - } - if (PyObject_SetAttr(disposition, str_trace, Py_False) < 0) { + ret = PyObject_CallFunctionObjArgs(self->disable_plugin, disposition, NULL); + if (ret == NULL) { goto error; } + Py_DECREF(ret); - goto ok; + return; error: /* This function doesn't return a status, so if an error happens, print it, @@ -623,13 +589,6 @@ CTracer_disable_plugin(CTracer *self, PyObject * disposition) /* PySys_WriteStderr is nicer, but is not in the public API. */ fprintf(stderr, "Error occurred while disabling plug-in:\n"); PyErr_Print(); - -ok: - Py_XDECREF(file_tracer); - Py_XDECREF(plugin); - Py_XDECREF(plugin_name); - Py_XDECREF(msg); - Py_XDECREF(ignored); } @@ -1121,6 +1080,9 @@ CTracer_members[] = { { "switch_context", T_OBJECT, offsetof(CTracer, switch_context), 0, PyDoc_STR("Function for switching to a new context.") }, + { "disable_plugin", T_OBJECT, offsetof(CTracer, disable_plugin), 0, + PyDoc_STR("Function for disabling a plugin.") }, + { NULL } }; diff --git a/coverage/ctracer/tracer.h b/coverage/ctracer/tracer.h index a83742ddf..8994a9e3d 100644 --- a/coverage/ctracer/tracer.h +++ b/coverage/ctracer/tracer.h @@ -27,6 +27,7 @@ typedef struct CTracer { PyObject * trace_arcs; PyObject * should_start_context; PyObject * switch_context; + PyObject * disable_plugin; /* Has the tracer been started? */ BOOL started; From 039ef0959c3f21fe0991204c19fb99fab14055f5 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 15:47:15 -0400 Subject: [PATCH 22/23] If a plugin is disabled, don't try to record its file tracers. #1011 --- CHANGES.rst | 5 +++++ coverage/collector.py | 13 ++++++++++++- coverage/control.py | 4 ++++ tests/test_plugins.py | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 604763f74..29d7fbe3b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -31,7 +31,12 @@ Unreleased to name a package to disambiguate this case. Thanks, Thomas Grainger. Fixes `issue 268`_. +- If a plugin was disabled due to an exception, we used to still try to record + its information, causing an exception, as reported in `issue 1011`_. This is + now fixed. + .. _issue 268: https://github.com/nedbat/coveragepy/issues/268 +.. _issue 1011: https://github.com/nedbat/coveragepy/issues/1011 .. _changes_521: diff --git a/coverage/collector.py b/coverage/collector.py index 3545ab1e2..9333d66a8 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -196,6 +196,8 @@ def reset(self): # handle them. self.file_tracers = {} + self.disabled_plugins = set() + # The .should_trace_cache attribute is a cache from file names to # coverage.FileDisposition objects, or None. When a file is first # considered for tracing, a FileDisposition is obtained from @@ -419,6 +421,10 @@ def mapped_file_dict(self, d): return dict((self.cached_mapped_file(k), v) for k, v in items if v) + def plugin_was_disabled(self, plugin): + """Record that `plugin` was disabled during the run.""" + self.disabled_plugins.add(plugin._coverage_plugin_name) + def flush_data(self): """Save the collected data to our associated `CoverageData`. @@ -434,7 +440,12 @@ def flush_data(self): self.covdata.add_arcs(self.mapped_file_dict(self.data)) else: self.covdata.add_lines(self.mapped_file_dict(self.data)) - self.covdata.add_file_tracers(self.mapped_file_dict(self.file_tracers)) + + file_tracers = { + k: v for k, v in self.file_tracers.items() + if v not in self.disabled_plugins + } + self.covdata.add_file_tracers(self.mapped_file_dict(file_tracers)) self._clear_data() return True diff --git a/coverage/control.py b/coverage/control.py index 7c4a48280..2d75417e2 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -709,6 +709,10 @@ def get_data(self): self._init_data(suffix=None) self._post_init() + for plugin in self._plugins: + if not plugin._coverage_enabled: + self._collector.plugin_was_disabled(plugin) + if self._collector and self._collector.flush_data(): self._post_save_work() diff --git a/tests/test_plugins.py b/tests/test_plugins.py index ed58c5f41..6340f9c33 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -611,6 +611,7 @@ def g(x): cov = coverage.Coverage() cov.set_option("run:plugins", [module_name]) self.start_import_stop(cov, "simple") + cov.save() # pytest-cov does a save after stop, so we'll do it too. return cov def run_bad_plugin(self, module_name, plugin_name, our_error=True, excmsg=None, excmsgs=None): @@ -715,6 +716,37 @@ def coverage_init(reg, options): """) self.run_bad_plugin("bad_plugin", "Plugin") + def test_file_tracer_fails_eventually(self): + # Django coverage plugin can report on a few files and then fail. + # https://github.com/nedbat/coveragepy/issues/1011 + self.make_file("bad_plugin.py", """\ + import os.path + import coverage.plugin + class Plugin(coverage.plugin.CoveragePlugin): + def __init__(self): + self.calls = 0 + + def file_tracer(self, filename): + print(filename) + self.calls += 1 + if self.calls <= 2: + return FileTracer(filename) + else: + 17/0 # Oh noes! + + class FileTracer(coverage.FileTracer): + def __init__(self, filename): + self.filename = filename + def source_filename(self): + return os.path.basename(self.filename).replace(".py", ".foo") + def line_number_range(self, frame): + return -1, -1 + + def coverage_init(reg, options): + reg.add_file_tracer(Plugin()) + """) + self.run_bad_plugin("bad_plugin", "Plugin") + def test_file_tracer_returns_wrong(self): self.make_file("bad_plugin.py", """\ import coverage.plugin From d13594e24f18930e96db55d0b49c3ebdd7275f40 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 15:57:29 -0400 Subject: [PATCH 23/23] Making a release --- CHANGES.rst | 6 ++++-- README.rst | 2 +- coverage/version.py | 2 +- doc/conf.py | 6 +++--- doc/index.rst | 2 +- doc/sample_html/cogapp___init___py.html | 4 ++-- doc/sample_html/cogapp___main___py.html | 4 ++-- doc/sample_html/cogapp_backward_py.html | 4 ++-- doc/sample_html/cogapp_cogapp_py.html | 4 ++-- doc/sample_html/cogapp_makefiles_py.html | 4 ++-- doc/sample_html/cogapp_test_cogapp_py.html | 4 ++-- doc/sample_html/cogapp_test_makefiles_py.html | 4 ++-- doc/sample_html/cogapp_test_whiteutils_py.html | 4 ++-- doc/sample_html/cogapp_whiteutils_py.html | 4 ++-- doc/sample_html/index.html | 4 ++-- doc/sample_html/status.json | 2 +- 16 files changed, 31 insertions(+), 29 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 29d7fbe3b..5819a4010 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,8 +22,10 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. .. ---------------------------- -Unreleased ----------- +.. _changes_53: + +Version 5.3 --- 2020-09-13 +-------------------------- - The ``source`` setting has always been interpreted as either a file path or a module, depending on which existed. If both interpretations were valid, it diff --git a/README.rst b/README.rst index 778b45a5a..babda472c 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ library to determine which lines are executable, and which have been executed. Coverage.py runs on many versions of Python: * CPython 2.7. -* CPython 3.5 through 3.9 beta 4. +* CPython 3.5 through 3.9 beta. * PyPy2 7.3.1 and PyPy3 7.3.1. Documentation is on `Read the Docs`_. Code repository and issue tracker are on diff --git a/coverage/version.py b/coverage/version.py index 830285f4d..2f29dd28f 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 3, 0, "alpha", 0) +version_info = (5, 3, 0, "final", 0) def _make_version(major, minor, micro, releaselevel, serial): diff --git a/doc/conf.py b/doc/conf.py index 9ca2d8873..fb6a88eab 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -66,11 +66,11 @@ # built documents. # # The short X.Y version. -version = "5.2.1" # CHANGEME +version = "5.3" # CHANGEME # The full version, including alpha/beta/rc tags. -release = "5.2.1" # CHANGEME +release = "5.3" # CHANGEME # The date of release, in "monthname day, year" format. -release_date = "July 23, 2020" # CHANGEME +release_date = "September 13, 2020" # CHANGEME rst_epilog = """ .. |release_date| replace:: {release_date} diff --git a/doc/index.rst b/doc/index.rst index e5df9263b..d235dcf8a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -23,7 +23,7 @@ supported on: .. ifconfig:: prerelease **This is a pre-release build. The usual warnings about possible bugs - apply.** The latest stable version is coverage.py 5.2.1, `described here`_. + apply.** The latest stable version is coverage.py 5.3, `described here`_. .. _described here: http://coverage.readthedocs.io/ diff --git a/doc/sample_html/cogapp___init___py.html b/doc/sample_html/cogapp___init___py.html index be753a87c..f18ea24b5 100644 --- a/doc/sample_html/cogapp___init___py.html +++ b/doc/sample_html/cogapp___init___py.html @@ -65,8 +65,8 @@

diff --git a/doc/sample_html/cogapp___main___py.html b/doc/sample_html/cogapp___main___py.html index 6110e8887..0223c84e7 100644 --- a/doc/sample_html/cogapp___main___py.html +++ b/doc/sample_html/cogapp___main___py.html @@ -61,8 +61,8 @@

diff --git a/doc/sample_html/cogapp_backward_py.html b/doc/sample_html/cogapp_backward_py.html index 3cc5ceb52..8f62840a6 100644 --- a/doc/sample_html/cogapp_backward_py.html +++ b/doc/sample_html/cogapp_backward_py.html @@ -98,8 +98,8 @@

diff --git a/doc/sample_html/cogapp_cogapp_py.html b/doc/sample_html/cogapp_cogapp_py.html index a9c893070..3b1737649 100644 --- a/doc/sample_html/cogapp_cogapp_py.html +++ b/doc/sample_html/cogapp_cogapp_py.html @@ -864,8 +864,8 @@

diff --git a/doc/sample_html/cogapp_makefiles_py.html b/doc/sample_html/cogapp_makefiles_py.html index 4ac84bf19..d266132d7 100644 --- a/doc/sample_html/cogapp_makefiles_py.html +++ b/doc/sample_html/cogapp_makefiles_py.html @@ -102,8 +102,8 @@

diff --git a/doc/sample_html/cogapp_test_cogapp_py.html b/doc/sample_html/cogapp_test_cogapp_py.html index 59c6f98c3..43513a5e3 100644 --- a/doc/sample_html/cogapp_test_cogapp_py.html +++ b/doc/sample_html/cogapp_test_cogapp_py.html @@ -2534,8 +2534,8 @@

diff --git a/doc/sample_html/cogapp_test_makefiles_py.html b/doc/sample_html/cogapp_test_makefiles_py.html index 4a9f43549..d0a261060 100644 --- a/doc/sample_html/cogapp_test_makefiles_py.html +++ b/doc/sample_html/cogapp_test_makefiles_py.html @@ -178,8 +178,8 @@

diff --git a/doc/sample_html/cogapp_test_whiteutils_py.html b/doc/sample_html/cogapp_test_whiteutils_py.html index ae853ac14..93610e456 100644 --- a/doc/sample_html/cogapp_test_whiteutils_py.html +++ b/doc/sample_html/cogapp_test_whiteutils_py.html @@ -157,8 +157,8 @@

diff --git a/doc/sample_html/cogapp_whiteutils_py.html b/doc/sample_html/cogapp_whiteutils_py.html index d91bff54c..2b1372f1a 100644 --- a/doc/sample_html/cogapp_whiteutils_py.html +++ b/doc/sample_html/cogapp_whiteutils_py.html @@ -129,8 +129,8 @@

diff --git a/doc/sample_html/index.html b/doc/sample_html/index.html index c5323f34f..f69704794 100644 --- a/doc/sample_html/index.html +++ b/doc/sample_html/index.html @@ -155,8 +155,8 @@

Coverage report: diff --git a/doc/sample_html/status.json b/doc/sample_html/status.json index 636975972..b57cdfbc1 100644 --- a/doc/sample_html/status.json +++ b/doc/sample_html/status.json @@ -1 +1 @@ -{"format":2,"version":"5.2.1","globals":"e6e162746063b971c76587652ff86e5f","files":{"cogapp___init___py":{"hash":"6010eef3af87123028eb691d70094593","index":{"nums":[1,2,0,0,0,0,0],"html_filename":"cogapp___init___py.html","relative_filename":"cogapp/__init__.py"}},"cogapp___main___py":{"hash":"2cec3551dfd9a5818a6550318658ccd4","index":{"nums":[1,3,0,3,0,0,0],"html_filename":"cogapp___main___py.html","relative_filename":"cogapp/__main__.py"}},"cogapp_backward_py":{"hash":"f95e44a818c73b2187e6fadc6257f8ce","index":{"nums":[1,22,0,6,4,2,2],"html_filename":"cogapp_backward_py.html","relative_filename":"cogapp/backward.py"}},"cogapp_cogapp_py":{"hash":"f85acbdbacefaccb9c499ef6cbe2ffc4","index":{"nums":[1,485,1,215,200,28,132],"html_filename":"cogapp_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"cogapp_makefiles_py":{"hash":"4fd2add44238312a5567022fe28737de","index":{"nums":[1,27,0,20,14,0,14],"html_filename":"cogapp_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"cogapp_test_cogapp_py":{"hash":"ee9b3c832eaa47b9e3940133c58827af","index":{"nums":[1,790,6,549,20,0,18],"html_filename":"cogapp_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"cogapp_test_makefiles_py":{"hash":"66093f767a400ce1720b94a7371de48b","index":{"nums":[1,71,0,53,6,0,6],"html_filename":"cogapp_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"cogapp_test_whiteutils_py":{"hash":"068beefb2872fe6739fad2471c36a4f1","index":{"nums":[1,69,0,50,0,0,0],"html_filename":"cogapp_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"cogapp_whiteutils_py":{"hash":"b16b0e7f940175106b11230fea9e8c8c","index":{"nums":[1,45,0,5,34,4,4],"html_filename":"cogapp_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}} \ No newline at end of file +{"format":2,"version":"5.3","globals":"ea0e0ec5d6d9849e6fc73b34af46a2dc","files":{"cogapp___init___py":{"hash":"6010eef3af87123028eb691d70094593","index":{"nums":[1,2,0,0,0,0,0],"html_filename":"cogapp___init___py.html","relative_filename":"cogapp/__init__.py"}},"cogapp___main___py":{"hash":"2cec3551dfd9a5818a6550318658ccd4","index":{"nums":[1,3,0,3,0,0,0],"html_filename":"cogapp___main___py.html","relative_filename":"cogapp/__main__.py"}},"cogapp_backward_py":{"hash":"f95e44a818c73b2187e6fadc6257f8ce","index":{"nums":[1,22,0,6,4,2,2],"html_filename":"cogapp_backward_py.html","relative_filename":"cogapp/backward.py"}},"cogapp_cogapp_py":{"hash":"f85acbdbacefaccb9c499ef6cbe2ffc4","index":{"nums":[1,485,1,215,200,28,132],"html_filename":"cogapp_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"cogapp_makefiles_py":{"hash":"4fd2add44238312a5567022fe28737de","index":{"nums":[1,27,0,20,14,0,14],"html_filename":"cogapp_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"cogapp_test_cogapp_py":{"hash":"ee9b3c832eaa47b9e3940133c58827af","index":{"nums":[1,790,6,549,20,0,18],"html_filename":"cogapp_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"cogapp_test_makefiles_py":{"hash":"66093f767a400ce1720b94a7371de48b","index":{"nums":[1,71,0,53,6,0,6],"html_filename":"cogapp_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"cogapp_test_whiteutils_py":{"hash":"068beefb2872fe6739fad2471c36a4f1","index":{"nums":[1,69,0,50,0,0,0],"html_filename":"cogapp_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"cogapp_whiteutils_py":{"hash":"b16b0e7f940175106b11230fea9e8c8c","index":{"nums":[1,45,0,5,34,4,4],"html_filename":"cogapp_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}} \ No newline at end of file