diff options
249 files changed, 1887 insertions, 2334 deletions
@@ -26,6 +26,7 @@ setuptools-*.egg .tox* .noseids .cache +.pytest_cache .hypothesis # Stuff in the test directory. diff --git a/.hgignore b/.hgignore deleted file mode 100644 index ce114b13..00000000 --- a/.hgignore +++ /dev/null @@ -1,42 +0,0 @@ -syntax: glob - -# Files that can appear anywhere in the tree. -*.pyc -*.pyo -*$py.class -*.pyd -*.so -*.bak -.coverage -.coverage.* -coverage.xml -.metacov -.metacov.* -*.swp - -# Stuff generated by editors. -.idea/ -.vimtags - -# Stuff in the root. -build -*.egg-info -dist -htmlcov -MANIFEST -setuptools-*.egg -.tox* -.noseids -.cache -.hypothesis - -# Stuff in the test directory. -zipmods.zip - -# Stuff in the doc directory. -_build -_spell -sample_html_beta - -# Stuff in the ci directory. -*.token diff --git a/.hgtags b/.hgtags deleted file mode 100644 index 8f9ad85c..00000000 --- a/.hgtags +++ /dev/null @@ -1,67 +0,0 @@ -4105a4de000ef94bb1f80cecae7c93aaf282bdbc coverage-3.0b1 -79dd373074def79b3822ee9254307295bf991d16 coverage-3.0b2 -ad991769ad4f685089bacc594e689bab50a6db90 coverage-3.0b3 -9041c4e99c3f8181d35e47df6fd83ceedb1f47fc coverage-3.0 -483a54854358881c360c6a717709b45a5225bd69 coverage-3.0.1 -67f7698c6c0413cc335ed5af7dd981bcf0a126a4 coverage-3.1b1 -67f7698c6c0413cc335ed5af7dd981bcf0a126a4 coverage-3.1b1 -27b6be608b2be50b92b91610846117ab7c47831c coverage-3.1b1 -4d89e089a8f3964522b19d50b4e90be0f2e49b53 coverage-3.1 -524f15a1a176be1b9afb737ab1be99c972f8c928 coverage-3.2b1 -524f15a1a176be1b9afb737ab1be99c972f8c928 coverage-3.2b1 -9231251c603ef0d491b01799b3d1da7af54dd083 coverage-3.2b1 -9231251c603ef0d491b01799b3d1da7af54dd083 coverage-3.2b1 -da052544181e335a18b4141b8b7a47e8246aa9e8 coverage-3.2b1 -11f0fbec2bc9b22a5fd8687d8b94338a4a363e6c coverage-3.2b2 -d42ad49a0aaca90867644876948a7bdab0aa9970 coverage-3.2b3 -3e21d5dc7e9d9c64db56d84b245618ad5c1a4743 coverage-3.2b4 -e3a46ca12bda98e81329300994ca7573dc3af86e coverage-3.2 -e3a46ca12bda98e81329300994ca7573dc3af86e coverage-3.2 -2e1628da1ffce31ed5c58bcad657882de282c858 coverage-3.2 -f63624fedea89b2acb361e1d7d6c5375ebced2aa coverage-3.3 -91bf9589714b14ac4a2ab5995635736994b97348 coverage-3.3.1 -7983cc5256eafaa6c6c3cdb05266493b4c1f991a coverage-3.4b1 -fcc4407bece6ca1266c91734bfdc657b66e10290 coverage-3.4b2 -25f2c1579f1c9539b2c140b86f6c00cbfbf4c565 coverage-3.4 -b7db1026817a4ae98c58c561f6ef79e95d0e13f9 coverage-3.5b1 -7be6416f60b90b75d8c81e5369612b7f48dc26cd coverage-3.5 -9229ab7b00f9e6542b44e788916f4117bd27cfdb coverage-3.5.1b1 -465bedd8af1f79a61f6dda018f6aefe97a79ae4d coverage-3.5.1 -afc3c2ffdb323bf059f136c4c88199899ed93d36 coverage-3.5.2b1 -4eb95ddb88496eccf5f399ba69ca1769baf29dfd coverage-3.5.2 -5429bbb25e8f124f5401cce1effa3089dd792711 coverage-3.5.3 -3483c970350aedb2c8fbe33def962041628f0ba6 coverage-3.6b1 -44d084b18bf0b96f49964df344c1dcaee3802d2e coverage-3.6b2 -773375910ceaaebfce4b5badc584559bf139c862 coverage-3.6b3 -af20c6543c226fbc9deeba4a6d4114641374734a coverage-3.6 -092c0be6d011b6abf85b11476e3b548ed4d5b4c3 coverage-3.7 -41932e001f215955dff895a1fd2fe4133abb89dc coverage-3.7.1 -175fd36ea47ea668066965c80343e1de34f2a94a coverage-4.0a1 -3b97c7c3178f0b88f1ee98f4c58ad00ca3d8e3b4 coverage-4.0a2 -eec8e928880df1beafdf7d4bea87f784375b35d7 coverage-4.0a3 -989f42e9eb11b5864e5746cea675d95ff4cf645d coverage-4.0a4 -00a61f028fcb000ae2cbc77bfbe0ac4cfacfab65 coverage-4.0a5 -90debbdf56495e6c0422ceb5f53f8550d2ad86bf coverage-4.0a6 -825fb6db681e9cfb227f09adbee50b881a3380e2 coverage-4.0b1 -9ab0815227d29c03775f7f7ad6dba1b0d93db777 coverage-4.0b2 -82b0c5a85a7eb2156eebaa6b81b1f62fb4fe51b5 coverage-4.0b3 -3c3e507a247eb35251083b9528a99e50831c960f coverage-4.0 -8e727dc12de10fb8a302b04a8f2af3e00587889e coverage-4.0.1 -7428dab9307da4660878436fe71b696ca2048cf2 coverage-4.0.2 -5ab728b8fd55bd78352012a15a6541fa73dd9e2c coverage-4.0.3 -166fbccc94fb32e52a18508c5422ddae5d5184b9 coverage-4.1b1 -05377ccfe33a83068962a9010037db2d3ebdfa1a coverage-4.1b2 -4984b5b2273622a98d6e4b7de6461bbf6fae41e3 coverage-4.1b3 -1b57373355d1d0a2de258655c47412698d5f061a coverage-4.1 -c84cdae01ca45f85e396c65c20e0234e89ef1785 coverage-4.2b1 -d96ff67e4ef7d0c5e787ed5aafbc1b5a04f6e97a coverage-4.2 -e3e18c651fa059c909c25992d5b7a6db371de09b coverage-4.3 -6ecabe2f7a8d8676a05585bffe19f88b195698ae coverage-4.3.1 -dd2d866194d2eca05862230e6003c6e04fc2fdc0 coverage-4.3.2 -3714d7c42000deafd2fb2034fc8eee6a9ec4c280 coverage-4.3.3 -19d0627fca7a7e76c3c27df1d70ce7f536f1ff23 coverage-4.3.4 -30ab67f19960fafd836c89a08b5f7ee1510b8c03 coverage-4.4b1 -8ad6fa0931cd5eb9b7bb8e6dec6b066d2988fc8f coverage-4.4 -ed196840b79136f17ab493699ec83dcf7dbfe973 coverage-4.4.1 -b65ae46a6504b8d577e967bd3fdcfcaceec95528 coverage-4.4.2 -102b2250a123537e640cd014f5df281822e79cec coverage-4.5 diff --git a/.travis.yml b/.travis.yml index 5e28d48b..8b0165ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,23 @@ # Tell Travis what to do -# https://travis-ci.org/nedbat/coveragepy +# https://travis-ci.com/nedbat/coveragepy language: python +cache: pip sudo: false python: - - '2.6' - '2.7' - - '3.3' - '3.4' - '3.5' - '3.6' - 'pypy' + - 'pypy3.5' env: matrix: - COVERAGE_COVERAGE=no - COVERAGE_COVERAGE=yes -sudo: false - install: - pip install -r requirements/ci.pip diff --git a/CHANGES.rst b/CHANGES.rst index e4243b9b..0e80b26c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt ============================== Change history for Coverage.py @@ -11,10 +11,44 @@ Change history for Coverage.py .. .. .. _changes_781: .. - .. .. Version 7.8.1 --- 2021-07-27 .. ---------------------------- +Unreleased +---------- + +- Development moved from `Bitbucket`_ to `GitHub`_. + +- HTML files no longer have trailing and extra whitespace. + +- pickle2json, for converting v3 data files to v4 data files, has been removed. + +.. _Bitbucket: https://bitbucket.org/ned/coveragepy +.. _GitHub: https://github.com/nedbat/coveragepy + + +.. _changes_50a1: + +Version 5.0a1 --- 2018-06-05 +---------------------------- + +- Coverage.py no longer supports Python 2.6 or 3.3. + +- The location of the configuration file can now be specified with a + ``COVERAGE_RCFILE`` environment variable, as requested in `issue 650`_. + +- A new warning (``already-imported``) is issued if measurable files have + already been imported before coverage.py started measurement. See + :ref:`cmd_warnings` for more information. + +- Running coverage many times for small runs in a single process should be + faster, closing `issue 625`_. Thanks, David MacIver. + +- 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 + .. _changes_451: @@ -485,7 +519,7 @@ Work from the PyCon 2016 Sprints! .. _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 -.. _unittest-mixins: https://pypi.python.org/pypi/unittest-mixins +.. _unittest-mixins: https://pypi.org/project/unittest-mixins/ .. _changes_41: @@ -1804,7 +1838,7 @@ Version 3.2b4 --- 2009-12-01 - On Python 3.x, setuptools has been replaced by `Distribute`_. -.. _Distribute: https://pypi.python.org/pypi/distribute +.. _Distribute: https://pypi.org/project/distribute/ Version 3.2b3 --- 2009-11-23 diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 52cedc0f..549a83dc 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -52,6 +52,7 @@ George Paci George Song Greg Rogers Guillaume Chazarain +Hugo van Kemenade Ilia Meerovich Imri Goldberg Ionel Cristian MărieÈ™ @@ -80,6 +81,8 @@ Mickie Betz Nathan Land Noel O'Boyle Olivier Grisel +Ori Avtalion +Pankaj Pandey Pablo Carballo Patrick Mezard Peter Baughman @@ -98,6 +101,7 @@ Stephen Finucane Steve Leonard Steve Peak Ted Wexler +Thijs Triemstra Titus Brown Ville Skyttä Yury Selivanov diff --git a/MANIFEST.in b/MANIFEST.in index 462f24ff..f79021f7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # MANIFEST.in file for coverage.py @@ -14,7 +14,6 @@ include TODO.txt include __main__.py include .travis.yml include appveyor.yml -include circle.yml include howto.txt include igor.py include metacov.ini @@ -22,6 +21,7 @@ include pylintrc include setup.py include tox.ini include tox_wheels.ini +include .editorconfig recursive-include ci *.* exclude ci/appveyor.token @@ -40,7 +40,5 @@ recursive-include tests/farm */gold*/*.* */gold*/*/*.* recursive-include tests/farm/*/src * *.* recursive-include tests js/*.* qunit/*.* prune tests/eggsrc/build -prune tests/eggsrc/dist -prune tests/eggsrc/*.egg-info global-exclude *.py[co] @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Makefile for utility work on coverage.py. @@ -26,6 +26,7 @@ clean: -rm -f setuptools-*.egg distribute-*.egg distribute-*.tar.gz -rm -rf doc/_build doc/_spell doc/sample_html_beta -rm -rf .tox_kits + -rm -rf .cache .pytest_cache sterile: clean -rm -rf .tox* @@ -38,9 +39,6 @@ lint: todo: -grep -R --include=*.py TODO $(LINTABLE) -spell: - -pylint --disable=all --enable=spelling $(LINTABLE) - pep8: pycodestyle --filename=*.py --repeat $(LINTABLE) @@ -50,10 +48,10 @@ test: TOX_SMOKE_ARGS = -n 6 -m "not expensive" --maxfail=3 $(ARGS) smoke: - COVERAGE_NO_PYTRACER=1 tox -e py26,py33 -- $(TOX_SMOKE_ARGS) + COVERAGE_NO_PYTRACER=1 tox -e py27,py34 -- $(TOX_SMOKE_ARGS) pysmoke: - COVERAGE_NO_CTRACER=1 tox -e py26,py33 -- $(TOX_SMOKE_ARGS) + COVERAGE_NO_CTRACER=1 tox -e py27,py34 -- $(TOX_SMOKE_ARGS) metacov: COVERAGE_COVERAGE=yes tox $(ARGS) @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt =========== Coverage.py @@ -19,20 +19,21 @@ library to determine which lines are executable, and which have been executed. Coverage.py runs on many versions of Python: -* CPython 2.6, 2.7 and 3.3 through 3.7. -* PyPy2 5.10 and PyPy3 5.10. +* CPython 2.7 and 3.4 through 3.7. +* PyPy2 6.0 and PyPy3 6.0. * Jython 2.7.1, though not for reporting. * IronPython 2.7.7, though not for reporting. Documentation is on `Read the Docs`_. Code repository and issue tracker are on -`Bitbucket`_, with a mirrored repository on `GitHub`_. +`GitHub`_. .. _Read the Docs: https://coverage.readthedocs.io/ -.. _Bitbucket: https://bitbucket.org/ned/coveragepy .. _GitHub: https://github.com/nedbat/coveragepy -**New in 4.5:** Configurator plug-ins. +**New in 5.0:** Dropped support for Python 2.6 and 3.3. + +New in 4.5: Configurator plug-ins. New in 4.4: Suppressable warnings, continuous coverage measurement. @@ -69,11 +70,11 @@ License Licensed under the `Apache 2.0 License`_. For details, see `NOTICE.txt`_. .. _Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 -.. _NOTICE.txt: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. _NOTICE.txt: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt -.. |ci-status| image:: https://travis-ci.org/nedbat/coveragepy.svg?branch=master - :target: https://travis-ci.org/nedbat/coveragepy +.. |ci-status| image:: https://travis-ci.com/nedbat/coveragepy.svg?branch=master + :target: https://travis-ci.com/nedbat/coveragepy :alt: Build status .. |win-ci-status| image:: https://ci.appveyor.com/api/projects/status/kmeqpdje7h9r6vsf/branch/master?svg=true :target: https://ci.appveyor.com/project/nedbat/coveragepy @@ -85,25 +86,25 @@ Licensed under the `Apache 2.0 License`_. For details, see `NOTICE.txt`_. :target: https://requires.io/github/nedbat/coveragepy/requirements/?branch=master :alt: Requirements status .. |kit| image:: https://badge.fury.io/py/coverage.svg - :target: https://pypi.python.org/pypi/coverage + :target: https://pypi.org/project/coverage/ :alt: PyPI status .. |format| image:: https://img.shields.io/pypi/format/coverage.svg - :target: https://pypi.python.org/pypi/coverage + :target: https://pypi.org/project/coverage/ :alt: Kit format .. |downloads| image:: https://img.shields.io/pypi/dw/coverage.svg - :target: https://pypi.python.org/pypi/coverage + :target: https://pypi.org/project/coverage/ :alt: Weekly PyPI downloads .. |versions| image:: https://img.shields.io/pypi/pyversions/coverage.svg - :target: https://pypi.python.org/pypi/coverage + :target: https://pypi.org/project/coverage/ :alt: Python versions supported .. |status| image:: https://img.shields.io/pypi/status/coverage.svg - :target: https://pypi.python.org/pypi/coverage + :target: https://pypi.org/project/coverage/ :alt: Package stability .. |license| image:: https://img.shields.io/pypi/l/coverage.svg - :target: https://pypi.python.org/pypi/coverage + :target: https://pypi.org/project/coverage/ :alt: License -.. |codecov| image:: http://codecov.io/github/nedbat/coveragepy/coverage.svg?branch=master&precision=2 - :target: http://codecov.io/github/nedbat/coveragepy?branch=master +.. |codecov| image:: https://codecov.io/github/nedbat/coveragepy/coverage.svg?branch=master&precision=2 + :target: https://codecov.io/github/nedbat/coveragepy?branch=master :alt: Coverage! .. |saythanks| image:: https://img.shields.io/badge/saythanks.io-%E2%98%BC-1EAEDB.svg :target: https://saythanks.io/to/nedbat diff --git a/__main__.py b/__main__.py index c998e1da..28ad7d2d 100644 --- a/__main__.py +++ b/__main__.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Be able to execute coverage.py by pointing Python at a working tree.""" @@ -8,12 +8,5 @@ import os PKG = 'coverage' -try: - run_globals = runpy.run_module(PKG, run_name='__main__', alter_sys=True) - executed = os.path.splitext(os.path.basename(run_globals['__file__']))[0] - if executed != '__main__': # For Python 2.5 compatibility - raise ImportError( - 'Incorrectly executed %s instead of __main__' % executed - ) -except ImportError: # For Python 2.6 compatibility - runpy.run_module('%s.__main__' % PKG, run_name='__main__', alter_sys=True) +run_globals = runpy.run_module(PKG, run_name='__main__', alter_sys=True) +executed = os.path.splitext(os.path.basename(run_globals['__file__']))[0] diff --git a/appveyor.yml b/appveyor.yml index f6b40660..8b9e1b61 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,9 @@ version: '{branch}-{build}' shallow_clone: true +cache: + - '%LOCALAPPDATA%\pip\Cache' + environment: CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\run_with_env.cmd" @@ -96,16 +99,16 @@ install: # Upgrade to the latest version of pip to avoid it displaying warnings # about it being out of date. - - "pip install --disable-pip-version-check --user --upgrade pip" + - "python -m pip install --disable-pip-version-check --upgrade pip" # And upgrade virtualenv to get the latest pip inside .tox virtualenvs. - - "pip install --disable-pip-version-check --user --upgrade virtualenv" + - "python -m pip install --disable-pip-version-check --upgrade virtualenv" # Install requirements. - "%CMD_IN_ENV% pip install -r requirements/ci.pip" # Make a python3.4.bat file in the current directory so that tox will find it # and python3.4 will mean what we want it to. - - "python -c \"import os; open('python{0}.{1}.bat'.format(*os.environ['TOXENV'][2:]), 'w').write('@{0}\\\\python \\x25*\\n'.format(os.environ['PYTHON']))\"" + - "python -c \"import os; open('python{}.{}.bat'.format(*os.environ['TOXENV'][2:]), 'w').write('@{}\\\\python \\x25*\\n'.format(os.environ['PYTHON']))\"" build_script: # If not a metacov job, then build wheels and .exe installers. diff --git a/ci/download_appveyor.py b/ci/download_appveyor.py index daf6f06e..7cec413c 100644 --- a/ci/download_appveyor.py +++ b/ci/download_appveyor.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Use the Appveyor API to download Windows artifacts.""" diff --git a/circle.yml b/circle.yml deleted file mode 100644 index a52959ef..00000000 --- a/circle.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Circle CI configuration for coverage.py. -# https://circleci.com/gh/nedbat/coveragepy - -machine: - python: - version: 2.7.6 - post: - - pyenv global pypy-2.4.0 2.6.8 2.7.9 3.3.3 3.4.2 - -dependencies: - pre: - - pip install -U pip - override: - - pip install -r requirements/tox.pip - -test: - override: - - tox diff --git a/coverage/__init__.py b/coverage/__init__.py index 63f488f2..0f17c0a1 100644 --- a/coverage/__init__.py +++ b/coverage/__init__.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Code coverage measurement for Python. diff --git a/coverage/__main__.py b/coverage/__main__.py index 35ab87a5..79aa4e2b 100644 --- a/coverage/__main__.py +++ b/coverage/__main__.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Coverage.py's main entry point.""" diff --git a/coverage/annotate.py b/coverage/annotate.py index 4060450f..48e2b91c 100644 --- a/coverage/annotate.py +++ b/coverage/annotate.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Source file annotation for coverage.py.""" diff --git a/coverage/backunittest.py b/coverage/backunittest.py index 09574ccb..21d7bcb2 100644 --- a/coverage/backunittest.py +++ b/coverage/backunittest.py @@ -1,14 +1,9 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Implementations of unittest features from the future.""" -# Use unittest2 if it's available, otherwise unittest. This gives us -# back-ported features for 2.6. -try: - import unittest2 as unittest -except ImportError: - import unittest +import unittest def unittest_has(method): diff --git a/coverage/backward.py b/coverage/backward.py index 5aff6406..b43e35f3 100644 --- a/coverage/backward.py +++ b/coverage/backward.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Add things to old Pythons so I can pretend they are newer.""" @@ -38,12 +38,6 @@ try: except NameError: unicode_class = str -# Where do pickles come from? -try: - import cPickle as pickle -except ImportError: - import pickle - # range or xrange? try: range = xrange # pylint: disable=redefined-builtin diff --git a/coverage/bytecode.py b/coverage/bytecode.py index d823c67c..943f29e1 100644 --- a/coverage/bytecode.py +++ b/coverage/bytecode.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Bytecode manipulation for coverage.py""" diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 7b86054e..fba1112f 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Command-line support for coverage.py.""" @@ -44,7 +44,7 @@ class Opts(object): ) debug = optparse.make_option( '', '--debug', action='store', metavar="OPTS", - help="Debug options, separated by commas", + help="Debug options, separated by commas. [env: COVERAGE_DEBUG]", ) directory = optparse.make_option( '-d', '--directory', action='store', metavar="DIR", @@ -115,7 +115,11 @@ class Opts(object): ) rcfile = optparse.make_option( '', '--rcfile', action='store', - help="Specify configuration file. Defaults to '.coveragerc'", + help=( + "Specify configuration file. " + "By default '.coveragerc', 'setup.cfg' and 'tox.ini' are tried. " + "[env: COVERAGE_RCFILE]" + ), ) source = optparse.make_option( '', '--source', action='store', metavar="SRC1,SRC2,...", @@ -124,7 +128,7 @@ class Opts(object): timid = optparse.make_option( '', '--timid', action='store_true', help=( - "Use a simpler but slower trace method. Try this if you get " + "Use a simpler but slower trace method. Try this if you get " "seemingly impossible results!" ), ) @@ -475,6 +479,7 @@ class CoverageScript(object): include=include, debug=debug, concurrency=options.concurrency, + check_preimported=True, ) if options.action == "debug": @@ -654,9 +659,9 @@ class CoverageScript(object): print(" %s" % line) elif info == 'data': self.coverage.load() - data = self.coverage.data + data = self.coverage.get_data() print(info_header("data")) - print("path: %s" % self.coverage.data_files.filename) + print("path: %s" % self.coverage._data_files.filename) if data: print("has_arcs: %r" % data.has_arcs()) summary = data.line_counts(fullpath=True) diff --git a/coverage/collector.py b/coverage/collector.py index 72ab32b6..fa3eaaa4 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Raw data collector for coverage.py.""" @@ -9,6 +9,7 @@ import sys from coverage import env from coverage.backward import litems, range # pylint: disable=redefined-builtin from coverage.debug import short_stack +from coverage.disposition import FileDisposition from coverage.files import abs_file from coverage.misc import CoverageException, isolate_module from coverage.pytracer import PyTracer @@ -33,11 +34,6 @@ except ImportError: CTracer = None -class FileDisposition(object): - """A simple value type for recording what to do with a file.""" - pass - - def should_start_context(frame): """Who-Tests-What hack: Determine whether this frame begins a new who-context.""" fn_name = frame.f_code.co_name @@ -107,6 +103,7 @@ class Collector(object): self.origin = short_stack() self.concur_id_func = None + self.abs_file_cache = {} # We can handle a few concurrency options here, but only one at a time. these_concurrencies = self.SUPPORTED_CONCURRENCIES.intersection(concurrency) @@ -373,6 +370,14 @@ class Collector(object): for tracer in self.tracers: tracer.data = data + def cached_abs_file(self, filename): + """A locally cached version of `abs_file`.""" + key = (type(filename), filename) + try: + return self.abs_file_cache[key] + except KeyError: + return self.abs_file_cache.setdefault(key, abs_file(filename)) + def save_data(self, covdata): """Save the collected data to a `CoverageData`. @@ -398,7 +403,7 @@ class Collector(object): else: raise runtime_err # pylint: disable=raising-bad-type - return dict((abs_file(k), v) for k, v in items) + return dict((self.cached_abs_file(k), v) for k, v in items) if self.branch: covdata.add_arcs(abs_file_dict(self.data)) diff --git a/coverage/config.py b/coverage/config.py index 7b8f2bd0..a0d7d06b 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -1,13 +1,13 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Config file for coverage.py""" import collections import os import re -import sys +from coverage import env from coverage.backward import configparser, iitems, string_class from coverage.misc import contract, CoverageException, isolate_module @@ -33,7 +33,7 @@ class HandyConfigParser(configparser.RawConfigParser): def read(self, filenames): """Read a file name as UTF-8 configuration data.""" kwargs = {} - if sys.version_info >= (3, 2): + if env.PYVERSION >= (3, 2): kwargs['encoding'] = "utf-8" return configparser.RawConfigParser.read(self, filenames, **kwargs) @@ -175,8 +175,12 @@ class CoverageConfig(object): def __init__(self): """Initialize the configuration attributes to their defaults.""" # Metadata about the config. + # We tried to read these config files. self.attempted_config_files = [] - self.config_files = [] + # We did read these config files, but maybe didn't find any content for us. + self.config_files_read = [] + # The file that gave us our configuration. + self.config_file = None # Defaults for [run] and [report] self._include = None @@ -262,7 +266,7 @@ class CoverageConfig(object): if not files_read: return False - self.config_files.extend(files_read) + self.config_files_read.extend(files_read) any_set = False try: @@ -305,9 +309,14 @@ class CoverageConfig(object): # then it was used. If we're piggybacking on someone else's file, # then it was only used if we found some settings in it. if our_file: - return True + used = True else: - return any_set + used = any_set + + if used: + self.config_file = filename + + return used CONFIG_FILE_OPTIONS = [ # These are *args for _set_attr_from_config_option: @@ -425,6 +434,34 @@ class CoverageConfig(object): raise CoverageException("No such option: %r" % option_name) +def config_files_to_try(config_file): + """What config files should we try to read? + + Returns a list of tuples: + (filename, is_our_file, was_file_specified) + """ + + # Some API users were specifying ".coveragerc" to mean the same as + # True, so make it so. + if config_file == ".coveragerc": + config_file = True + specified_file = (config_file is not True) + if not specified_file: + # No file was specified. Check COVERAGE_RCFILE. + config_file = os.environ.get('COVERAGE_RCFILE') + if config_file: + specified_file = True + if not specified_file: + # Still no file specified. Default to .coveragerc + config_file = ".coveragerc" + files_to_try = [ + (config_file, True, specified_file), + ("setup.cfg", False, False), + ("tox.ini", False, False), + ] + return files_to_try + + def read_coverage_config(config_file, **kwargs): """Read the coverage.py configuration. @@ -435,10 +472,7 @@ def read_coverage_config(config_file, **kwargs): setting values in the configuration. Returns: - config_file, config: - config_file is the value to use for config_file in other - invocations of coverage. - + config: config is a CoverageConfig object read from the appropriate configuration file. @@ -449,25 +483,14 @@ def read_coverage_config(config_file, **kwargs): # 2) from a file: if config_file: - # Some API users were specifying ".coveragerc" to mean the same as - # True, so make it so. - if config_file == ".coveragerc": - config_file = True - specified_file = (config_file is not True) - if not specified_file: - config_file = ".coveragerc" - - for fname, our_file in [(config_file, True), - ("setup.cfg", False), - ("tox.ini", False)]: - config_read = config.from_file(fname, our_file=our_file) - is_config_file = fname == config_file - - if not config_read and is_config_file and specified_file: - raise CoverageException("Couldn't read '%s' as a config file" % fname) + files_to_try = config_files_to_try(config_file) + for fname, our_file, specified_file in files_to_try: + config_read = config.from_file(fname, our_file=our_file) if config_read: break + if specified_file: + raise CoverageException("Couldn't read '%s' as a config file" % fname) # 3) from environment variables: env_data_file = os.environ.get('COVERAGE_FILE') @@ -486,4 +509,4 @@ def read_coverage_config(config_file, **kwargs): config.html_dir = os.path.expanduser(config.html_dir) config.xml_output = os.path.expanduser(config.xml_output) - return config_file, config + return config diff --git a/coverage/control.py b/coverage/control.py index b82c8047..a5943aa8 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -1,18 +1,14 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Core control stuff for coverage.py.""" import atexit -import inspect -import itertools import os import platform -import re import sys import time -import traceback from coverage import env from coverage.annotate import AnnotateReporter @@ -21,16 +17,15 @@ from coverage.collector import Collector from coverage.config import read_coverage_config from coverage.data import CoverageData, CoverageDataFiles from coverage.debug import DebugControl, write_formatted_info -from coverage.files import TreeMatcher, FnmatchMatcher -from coverage.files import PathAliases, find_python_files, prep_patterns -from coverage.files import canonical_filename, set_relative_directory -from coverage.files import ModuleMatcher, abs_file +from coverage.disposition import disposition_debug_msg +from coverage.files import PathAliases, set_relative_directory, abs_file from coverage.html import HtmlReporter +from coverage.inorout import InOrOut from coverage.misc import CoverageException, bool_or_none, join_regex from coverage.misc import file_be_gone, isolate_module from coverage.plugin import FileReporter from coverage.plugin_support import Plugins -from coverage.python import PythonFileReporter, source_for_file +from coverage.python import PythonFileReporter from coverage.results import Analysis, Numbers from coverage.summary import SummaryReporter from coverage.xmlreport import XmlReporter @@ -43,22 +38,6 @@ except ImportError: # pragma: only jytho os = isolate_module(os) -# Pypy has some unusual stuff in the "stdlib". Consider those locations -# when deciding where the stdlib is. These modules are not used for anything, -# they are modules importable from the pypy lib directories, so that we can -# find those directories. -_structseq = _pypy_irc_topic = None -if env.PYPY: - try: - import _structseq - except ImportError: - pass - - try: - import _pypy_irc_topic - except ImportError: - pass - class Coverage(object): """Programmatic access to coverage.py. @@ -74,11 +53,12 @@ class Coverage(object): cov.html_report(directory='covhtml') """ + def __init__( self, data_file=None, data_suffix=None, cover_pylib=None, auto_data=False, timid=None, branch=None, config_file=True, source=None, omit=None, include=None, debug=None, - concurrency=None, + concurrency=None, check_preimported=False, ): """ `data_file` is the base name of the data file to use, defaulting to @@ -132,15 +112,23 @@ class Coverage(object): "eventlet", "gevent", "multiprocessing", or "thread" (the default). This can also be a list of these strings. + If `check_preimported` is true, then when coverage is started, the + aleady-imported files will be checked to see if they should be measured + by coverage. Importing measured files before coverage is started can + mean that code is missed. + .. versionadded:: 4.0 The `concurrency` parameter. .. versionadded:: 4.2 The `concurrency` parameter can now be a list of strings. + .. versionadded:: 4.6 + The `check_preimported` parameter. + """ # Build our configuration from a number of sources. - self.config_file, self.config = read_coverage_config( + self.config = read_coverage_config( config_file=config_file, data_file=data_file, cover_pylib=cover_pylib, timid=timid, branch=branch, parallel=bool_or_none(data_suffix), @@ -153,31 +141,24 @@ class Coverage(object): self._debug_file = None self._auto_load = self._auto_save = auto_data - self._data_suffix = data_suffix - - # The matchers for _should_trace. - self.source_match = None - self.source_pkgs_match = None - self.pylib_match = self.cover_match = None - self.include_match = self.omit_match = None + self._data_suffix_specified = data_suffix # Is it ok for no data to be collected? self._warn_no_data = True self._warn_unimported_source = True + self._warn_preimported_source = check_preimported # A record of all the warnings that have been issued. self._warnings = [] # Other instance attributes, set later. - self.omit = self.include = self.source = None - self.source_pkgs_unmatched = None - self.source_pkgs = None - self.data = self.data_files = self.collector = None - self.plugins = None - self.pylib_paths = self.cover_paths = None - self.data_suffix = self.run_suffix = None + self._data = self._data_files = self._collector = None + self._plugins = None + self._inorout = None + self._inorout_class = InOrOut + self._data_suffix = self._run_suffix = None self._exclude_re = None - self.debug = None + self._debug = None # State machine variables: # Have we initialized everything? @@ -215,7 +196,7 @@ class Coverage(object): self._debug_file = open(debug_file_name, "a") else: self._debug_file = sys.stderr - self.debug = DebugControl(self.config.debug, self._debug_file) + self._debug = DebugControl(self.config.debug, self._debug_file) # _exclude_re is a dict that maps exclusion list names to compiled regexes. self._exclude_re = {} @@ -223,41 +204,28 @@ class Coverage(object): set_relative_directory() # Load plugins - self.plugins = Plugins.load_plugins(self.config.plugins, self.config, self.debug) + self._plugins = Plugins.load_plugins(self.config.plugins, self.config, self._debug) # Run configuring plugins. - for plugin in self.plugins.configurers: + for plugin in self._plugins.configurers: # We need an object with set_option and get_option. Either self or # self.config will do. Choosing randomly stops people from doing # other things with those objects, against the public API. Yes, # this is a bit childish. :) plugin.configure([self, self.config][int(time.time()) % 2]) - # The source argument can be directories or package names. - self.source = [] - self.source_pkgs = [] - for src in self.config.source or []: - if os.path.isdir(src): - self.source.append(canonical_filename(src)) - else: - self.source_pkgs.append(src) - self.source_pkgs_unmatched = self.source_pkgs[:] - - self.omit = prep_patterns(self.config.run_omit) - self.include = prep_patterns(self.config.run_include) - concurrency = self.config.concurrency or [] if "multiprocessing" in concurrency: if not patch_multiprocessing: raise CoverageException( # pragma: only jython "multiprocessing is not supported on this Python" ) - patch_multiprocessing(rcfile=self.config_file) + patch_multiprocessing(rcfile=self.config.config_file) # Multi-processing uses parallel for the subprocesses, so also use # it for the main process. self.config.parallel = True - self.collector = Collector( + self._collector = Collector( should_trace=self._should_trace, check_include=self._check_include_omit_etc, timid=self.config.timid, @@ -267,320 +235,73 @@ class Coverage(object): ) # Early warning if we aren't going to be able to support plugins. - if self.plugins.file_tracers and not self.collector.supports_plugins: + if self._plugins.file_tracers and not self._collector.supports_plugins: self._warn( "Plugin file tracers (%s) aren't supported with %s" % ( ", ".join( plugin._coverage_plugin_name - for plugin in self.plugins.file_tracers + for plugin in self._plugins.file_tracers ), - self.collector.tracer_name(), + self._collector.tracer_name(), ) ) - for plugin in self.plugins.file_tracers: + for plugin in self._plugins.file_tracers: plugin._coverage_enabled = False + # Create the file classifying substructure. + self._inorout = self._inorout_class(warn=self._warn) + self._inorout.configure(self.config) + self._inorout.plugins = self._plugins + self._inorout.disp_class = self._collector.file_disposition_class + # Suffixes are a bit tricky. We want to use the data suffix only when # collecting data, not when combining data. So we save it as - # `self.run_suffix` now, and promote it to `self.data_suffix` if we + # `self._run_suffix` now, and promote it to `self._data_suffix` if we # find that we are collecting data later. - if self._data_suffix or self.config.parallel: - if not isinstance(self._data_suffix, string_class): + if self._data_suffix_specified or self.config.parallel: + if not isinstance(self._data_suffix_specified, string_class): # if data_suffix=True, use .machinename.pid.random - self._data_suffix = True + self._data_suffix_specified = True else: - self._data_suffix = None - self.data_suffix = None - self.run_suffix = self._data_suffix + self._data_suffix_specified = None + self._data_suffix = None + self._run_suffix = self._data_suffix_specified # Create the data file. We do this at construction time so that the # data file will be written into the directory where the process # started rather than wherever the process eventually chdir'd to. - self.data = CoverageData(debug=self.debug) - self.data_files = CoverageDataFiles( - basename=self.config.data_file, warn=self._warn, debug=self.debug, + self._data = CoverageData(debug=self._debug) + self._data_files = CoverageDataFiles( + basename=self.config.data_file, warn=self._warn, debug=self._debug, ) - # The directories for files considered "installed with the interpreter". - self.pylib_paths = set() - if not self.config.cover_pylib: - # Look at where some standard modules are located. That's the - # indication for "installed with the interpreter". In some - # environments (virtualenv, for example), these modules may be - # spread across a few locations. Look at all the candidate modules - # we've imported, and take all the different ones. - for m in (atexit, inspect, os, platform, _pypy_irc_topic, re, _structseq, traceback): - if m is not None and hasattr(m, "__file__"): - self.pylib_paths.add(self._canonical_path(m, directory=True)) - - if _structseq and not hasattr(_structseq, '__file__'): - # PyPy 2.4 has no __file__ in the builtin modules, but the code - # objects still have the file names. So dig into one to find - # the path to exclude. - structseq_new = _structseq.structseq_new - try: - structseq_file = structseq_new.func_code.co_filename - except AttributeError: - structseq_file = structseq_new.__code__.co_filename - self.pylib_paths.add(self._canonical_path(structseq_file)) - - # To avoid tracing the coverage.py code itself, we skip anything - # located where we are. - self.cover_paths = [self._canonical_path(__file__, directory=True)] - if env.TESTING: - # Don't include our own test code. - self.cover_paths.append(os.path.join(self.cover_paths[0], "tests")) - - # When testing, we use PyContracts, which should be considered - # part of coverage.py, and it uses six. Exclude those directories - # just as we exclude ourselves. - import contracts - import six - for mod in [contracts, six]: - self.cover_paths.append(self._canonical_path(mod)) - # Set the reporting precision. Numbers.set_precision(self.config.precision) atexit.register(self._atexit) - # Create the matchers we need for _should_trace - if self.source or self.source_pkgs: - self.source_match = TreeMatcher(self.source) - self.source_pkgs_match = ModuleMatcher(self.source_pkgs) - else: - if self.cover_paths: - self.cover_match = TreeMatcher(self.cover_paths) - if self.pylib_paths: - self.pylib_match = TreeMatcher(self.pylib_paths) - if self.include: - self.include_match = FnmatchMatcher(self.include) - if self.omit: - self.omit_match = FnmatchMatcher(self.omit) - # The user may want to debug things, show info if desired. self._write_startup_debug() def _write_startup_debug(self): """Write out debug info at startup if needed.""" wrote_any = False - with self.debug.without_callers(): - if self.debug.should('config'): + with self._debug.without_callers(): + if self._debug.should('config'): config_info = sorted(self.config.__dict__.items()) - write_formatted_info(self.debug, "config", config_info) + write_formatted_info(self._debug, "config", config_info) wrote_any = True - if self.debug.should('sys'): - write_formatted_info(self.debug, "sys", self.sys_info()) - for plugin in self.plugins: + if self._debug.should('sys'): + write_formatted_info(self._debug, "sys", self.sys_info()) + for plugin in self._plugins: header = "sys: " + plugin._coverage_plugin_name info = plugin.sys_info() - write_formatted_info(self.debug, header, info) + write_formatted_info(self._debug, header, info) wrote_any = True if wrote_any: - write_formatted_info(self.debug, "end", ()) - - def _canonical_path(self, morf, directory=False): - """Return the canonical path of the module or file `morf`. - - If the module is a package, then return its directory. If it is a - module, then return its file, unless `directory` is True, in which - case return its enclosing directory. - - """ - morf_path = PythonFileReporter(morf, self).filename - if morf_path.endswith("__init__.py") or directory: - morf_path = os.path.split(morf_path)[0] - return morf_path - - def _name_for_module(self, module_globals, filename): - """Get the name of the module for a set of globals and file name. - - For configurability's sake, we allow __main__ modules to be matched by - their importable name. - - If loaded via runpy (aka -m), we can usually recover the "original" - full dotted module name, otherwise, we resort to interpreting the - file name to get the module's name. In the case that the module name - can't be determined, None is returned. - - """ - if module_globals is None: # pragma: only ironpython - # IronPython doesn't provide globals: https://github.com/IronLanguages/main/issues/1296 - module_globals = {} - - dunder_name = module_globals.get('__name__', None) - - if isinstance(dunder_name, str) and dunder_name != '__main__': - # This is the usual case: an imported module. - return dunder_name - - loader = module_globals.get('__loader__', None) - for attrname in ('fullname', 'name'): # attribute renamed in py3.2 - if hasattr(loader, attrname): - fullname = getattr(loader, attrname) - else: - continue - - if isinstance(fullname, str) and fullname != '__main__': - # Module loaded via: runpy -m - return fullname - - # Script as first argument to Python command line. - inspectedname = inspect.getmodulename(filename) - if inspectedname is not None: - return inspectedname - else: - return dunder_name - - def _should_trace_internal(self, filename, frame): - """Decide whether to trace execution in `filename`, with a reason. - - This function is called from the trace function. As each new file name - is encountered, this function determines whether it is traced or not. - - Returns a FileDisposition object. - - """ - original_filename = filename - disp = _disposition_init(self.collector.file_disposition_class, filename) - - def nope(disp, reason): - """Simple helper to make it easy to return NO.""" - disp.trace = False - disp.reason = reason - return disp - - # Compiled Python files have two file names: frame.f_code.co_filename is - # the file name at the time the .pyc was compiled. The second name is - # __file__, which is where the .pyc was actually loaded from. Since - # .pyc files can be moved after compilation (for example, by being - # installed), we look for __file__ in the frame and prefer it to the - # co_filename value. - dunder_file = frame.f_globals and frame.f_globals.get('__file__') - if dunder_file: - filename = source_for_file(dunder_file) - if original_filename and not original_filename.startswith('<'): - orig = os.path.basename(original_filename) - if orig != os.path.basename(filename): - # Files shouldn't be renamed when moved. This happens when - # exec'ing code. If it seems like something is wrong with - # the frame's file name, then just use the original. - filename = original_filename - - if not filename: - # Empty string is pretty useless. - return nope(disp, "empty string isn't a file name") - - if filename.startswith('memory:'): - return nope(disp, "memory isn't traceable") - - if filename.startswith('<'): - # Lots of non-file execution is represented with artificial - # file names like "<string>", "<doctest readme.txt[0]>", or - # "<exec_function>". Don't ever trace these executions, since we - # can't do anything with the data later anyway. - return nope(disp, "not a real file name") - - # pyexpat does a dumb thing, calling the trace function explicitly from - # C code with a C file name. - if re.search(r"[/\\]Modules[/\\]pyexpat.c", filename): - return nope(disp, "pyexpat lies about itself") - - # Jython reports the .class file to the tracer, use the source file. - if filename.endswith("$py.class"): - filename = filename[:-9] + ".py" - - canonical = canonical_filename(filename) - disp.canonical_filename = canonical - - # Try the plugins, see if they have an opinion about the file. - plugin = None - for plugin in self.plugins.file_tracers: - if not plugin._coverage_enabled: - continue - - try: - file_tracer = plugin.file_tracer(canonical) - if file_tracer is not None: - file_tracer._coverage_plugin = plugin - disp.trace = True - disp.file_tracer = file_tracer - if file_tracer.has_dynamic_source_filename(): - disp.has_dynamic_filename = True - else: - disp.source_filename = canonical_filename( - file_tracer.source_filename() - ) - break - except Exception: - self._warn( - "Disabling plug-in %r due to an exception:" % ( - plugin._coverage_plugin_name - ) - ) - traceback.print_exc() - plugin._coverage_enabled = False - continue - else: - # No plugin wanted it: it's Python. - disp.trace = True - disp.source_filename = canonical - - if not disp.has_dynamic_filename: - if not disp.source_filename: - raise CoverageException( - "Plugin %r didn't set source_filename for %r" % - (plugin, disp.original_filename) - ) - reason = self._check_include_omit_etc_internal( - disp.source_filename, frame, - ) - if reason: - nope(disp, reason) - - return disp - - def _check_include_omit_etc_internal(self, filename, frame): - """Check a file name against the include, omit, etc, rules. - - Returns a string or None. String means, don't trace, and is the reason - why. None means no reason found to not trace. - - """ - modulename = self._name_for_module(frame.f_globals, filename) - - # If the user specified source or include, then that's authoritative - # about the outer bound of what to measure and we don't have to apply - # any canned exclusions. If they didn't, then we have to exclude the - # stdlib and coverage.py directories. - if self.source_match: - if self.source_pkgs_match.match(modulename): - if modulename in self.source_pkgs_unmatched: - self.source_pkgs_unmatched.remove(modulename) - elif not self.source_match.match(filename): - return "falls outside the --source trees" - elif self.include_match: - if not self.include_match.match(filename): - return "falls outside the --include trees" - else: - # If we aren't supposed to trace installed code, then check if this - # is near the Python standard library and skip it if so. - if self.pylib_match and self.pylib_match.match(filename): - return "is in the stdlib" - - # We exclude the coverage.py code itself, since a little of it - # will be measured otherwise. - if self.cover_match and self.cover_match.match(filename): - return "is part of coverage.py" - - # Check the file against the omit pattern. - if self.omit_match and self.omit_match.match(filename): - return "is inside an --omit pattern" - - # No reason found to skip this file. - return None + write_formatted_info(self._debug, "end", ()) def _should_trace(self, filename, frame): """Decide whether to trace execution in `filename`. @@ -588,9 +309,9 @@ class Coverage(object): Calls `_should_trace_internal`, and returns the FileDisposition. """ - disp = self._should_trace_internal(filename, frame) - if self.debug.should('trace'): - self.debug.write(_disposition_debug_msg(disp)) + disp = self._inorout.should_trace(filename, frame) + if self._debug.should('trace'): + self._debug.write(disposition_debug_msg(disp)) return disp def _check_include_omit_etc(self, filename, frame): @@ -599,13 +320,13 @@ class Coverage(object): Returns a boolean: True if the file should be traced, False if not. """ - reason = self._check_include_omit_etc_internal(filename, frame) - if self.debug.should('trace'): + reason = self._inorout.check_include_omit_etc(filename, frame) + if self._debug.should('trace'): if not reason: msg = "Including %r" % (filename,) else: msg = "Not including %r: %s" % (filename, reason) - self.debug.write(msg) + self._debug.write(msg) return not reason @@ -621,7 +342,7 @@ class Coverage(object): self._warnings.append(msg) if slug: msg = "%s (%s)" % (msg, slug) - if self.debug.should('pid'): + if self._debug.should('pid'): msg = "[%d] %s" % (os.getpid(), msg) sys.stderr.write("Coverage.py warning: %s\n" % msg) @@ -673,8 +394,8 @@ class Coverage(object): def load(self): """Load previously-collected coverage data from the data file.""" self._init() - self.collector.reset() - self.data_files.read(self.data) + self._collector.reset() + self._data_files.read(self._data) def start(self): """Start measuring code coverage. @@ -688,29 +409,32 @@ class Coverage(object): """ self._init() - if self.include: - if self.source or self.source_pkgs: - self._warn("--include is ignored because --source is set", slug="include-ignored") - if self.run_suffix: + self._inorout.warn_conflicting_settings() + + if self._run_suffix: # Calling start() means we're running code, so use the run_suffix # as the data_suffix when we eventually save the data. - self.data_suffix = self.run_suffix + self._data_suffix = self._run_suffix if self._auto_load: self.load() - self.collector.start() + # See if we think some code that would eventually be measured has already been imported. + if self._warn_preimported_source: + self._inorout.warn_already_imported_files() + + self._collector.start() self._started = True def stop(self): """Stop measuring code coverage.""" if self._started: - self.collector.stop() + self._collector.stop() self._started = False def _atexit(self): """Clean up on process shutdown.""" - if self.debug.should("process"): - self.debug.write("atexit: {0!r}".format(self)) + if self._debug.should("process"): + self._debug.write("atexit: {0!r}".format(self)) if self._started: self.stop() if self._auto_save: @@ -724,9 +448,9 @@ class Coverage(object): """ self._init() - self.collector.reset() - self.data.erase() - self.data_files.erase(parallel=self.config.parallel) + self._collector.reset() + self._data.erase() + self._data_files.erase(parallel=self.config.parallel) def clear_exclude(self, which='exclude'): """Clear the exclude list.""" @@ -778,8 +502,8 @@ class Coverage(object): def save(self): """Save the collected coverage data to the data file.""" self._init() - self.get_data() - self.data_files.write(self.data, suffix=self.data_suffix) + data = self.get_data() + self._data_files.write(data, suffix=self._data_suffix) def combine(self, data_paths=None, strict=False): """Combine together a number of similarly-named coverage data files. @@ -814,8 +538,8 @@ class Coverage(object): for pattern in paths[1:]: aliases.add(pattern, result) - self.data_files.combine_parallel_data( - self.data, aliases=aliases, data_paths=data_paths, strict=strict, + self._data_files.combine_parallel_data( + self._data, aliases=aliases, data_paths=data_paths, strict=strict, ) def get_data(self): @@ -830,10 +554,10 @@ class Coverage(object): """ self._init() - if self.collector.save_data(self.data): + if self._collector.save_data(self._data): self._post_save_work() - return self.data + return self._data def _post_save_work(self): """After saving data, look for warnings, post-work, etc. @@ -845,82 +569,18 @@ class Coverage(object): # If there are still entries in the source_pkgs_unmatched list, # then we never encountered those packages. if self._warn_unimported_source: - for pkg in self.source_pkgs_unmatched: - self._warn_about_unmeasured_code(pkg) + self._inorout.warn_unimported_source() # Find out if we got any data. - if not self.data and self._warn_no_data: + if not self._data and self._warn_no_data: self._warn("No data was collected.", slug="no-data-collected") # Find files that were never executed at all. - for pkg in self.source_pkgs: - if (not pkg in sys.modules or - not hasattr(sys.modules[pkg], '__file__') or - not os.path.exists(sys.modules[pkg].__file__)): - continue - pkg_file = source_for_file(sys.modules[pkg].__file__) - self._find_unexecuted_files(self._canonical_path(pkg_file)) - - for src in self.source: - self._find_unexecuted_files(src) + for file_path, plugin_name in self._inorout.find_unexecuted_files(): + self._data.touch_file(file_path, plugin_name) if self.config.note: - self.data.add_run_info(note=self.config.note) - - def _warn_about_unmeasured_code(self, pkg): - """Warn about a package or module that we never traced. - - `pkg` is a string, the name of the package or module. - - """ - mod = sys.modules.get(pkg) - if mod is None: - self._warn("Module %s was never imported." % pkg, slug="module-not-imported") - return - - is_namespace = hasattr(mod, '__path__') and not hasattr(mod, '__file__') - has_file = hasattr(mod, '__file__') and os.path.exists(mod.__file__) - - if is_namespace: - # A namespace package. It's OK for this not to have been traced, - # since there is no code directly in it. - return - - if not has_file: - self._warn("Module %s has no Python source." % pkg, slug="module-not-python") - return - - # The module was in sys.modules, and seems like a module with code, but - # we never measured it. I guess that means it was imported before - # coverage even started. - self._warn( - "Module %s was previously imported, but not measured" % pkg, - slug="module-not-measured", - ) - - def _find_plugin_files(self, src_dir): - """Get executable files from the plugins.""" - for plugin in self.plugins.file_tracers: - for x_file in plugin.find_executable_files(src_dir): - yield x_file, plugin._coverage_plugin_name - - def _find_unexecuted_files(self, src_dir): - """Find unexecuted files in `src_dir`. - - Search for files in `src_dir` that are probably importable, - and add them as unexecuted files in `self.data`. - - """ - py_files = ((py_file, None) for py_file in find_python_files(src_dir)) - plugin_files = self._find_plugin_files(src_dir) - - for file_path, plugin_name in itertools.chain(py_files, plugin_files): - file_path = canonical_filename(file_path) - if self.omit_match and self.omit_match.match(file_path): - # Turns out this file was omitted, so don't pull it back - # in as unexecuted. - continue - self.data.touch_file(file_path, plugin_name) + self._data.add_run_info(note=self.config.note) # Backward compatibility with version 1. def analysis(self, morf): @@ -961,11 +621,11 @@ class Coverage(object): Returns an `Analysis` object. """ - self.get_data() + data = self.get_data() if not isinstance(it, FileReporter): it = self._get_file_reporter(it) - return Analysis(self.data, it) + return Analysis(data, it) def _get_file_reporter(self, morf): """Get a FileReporter for a module or file name.""" @@ -974,9 +634,9 @@ class Coverage(object): if isinstance(morf, string_class): abs_morf = abs_file(morf) - plugin_name = self.data.file_tracer(abs_morf) + plugin_name = self._data.file_tracer(abs_morf) if plugin_name: - plugin = self.plugins.get(plugin_name) + plugin = self._plugins.get(plugin_name) if plugin: file_reporter = plugin.file_reporter(abs_morf) @@ -1004,7 +664,7 @@ class Coverage(object): """ if not morfs: - morfs = self.data.measured_files() + morfs = self._data.measured_files() # Be sure we have a list. if not isinstance(morfs, (list, tuple)): @@ -1036,7 +696,6 @@ class Coverage(object): Returns a float, the total percentage covered. """ - self.get_data() self.config.from_args( ignore_errors=ignore_errors, report_omit=omit, report_include=include, show_missing=show_missing, skip_covered=skip_covered, @@ -1058,7 +717,6 @@ class Coverage(object): See :meth:`report` for other arguments. """ - self.get_data() self.config.from_args( ignore_errors=ignore_errors, report_omit=omit, report_include=include ) @@ -1085,7 +743,6 @@ class Coverage(object): Returns a float, the total percentage covered. """ - self.get_data() self.config.from_args( ignore_errors=ignore_errors, report_omit=omit, report_include=include, html_dir=directory, extra_css=extra_css, html_title=title, @@ -1110,7 +767,6 @@ class Coverage(object): Returns a float, the total percentage covered. """ - self.get_data() self.config.from_args( ignore_errors=ignore_errors, report_omit=omit, report_include=include, xml_output=outfile, @@ -1165,14 +821,13 @@ class Coverage(object): info = [ ('version', covmod.__version__), ('coverage', covmod.__file__), - ('cover_paths', self.cover_paths), - ('pylib_paths', self.pylib_paths), - ('tracer', self.collector.tracer_name()), - ('plugins.file_tracers', plugin_info(self.plugins.file_tracers)), - ('plugins.configurers', plugin_info(self.plugins.configurers)), - ('config_files', self.config.attempted_config_files), - ('configs_read', self.config.config_files), - ('data_path', self.data_files.filename), + ('tracer', self._collector.tracer_name()), + ('plugins.file_tracers', plugin_info(self._plugins.file_tracers)), + ('plugins.configurers', plugin_info(self._plugins.configurers)), + ('configs_attempted', self.config.attempted_config_files), + ('configs_read', self.config.config_files_read), + ('config_file', self.config.config_file), + ('data_path', self._data_files.filename), ('python', sys.version.replace('\n', '')), ('platform', platform.platform()), ('implementation', platform.python_implementation()), @@ -1187,51 +842,11 @@ class Coverage(object): ('command_line', " ".join(getattr(sys, 'argv', ['???']))), ] - matcher_names = [ - 'source_match', 'source_pkgs_match', - 'include_match', 'omit_match', - 'cover_match', 'pylib_match', - ] - - for matcher_name in matcher_names: - matcher = getattr(self, matcher_name) - if matcher: - matcher_info = matcher.info() - else: - matcher_info = '-none-' - info.append((matcher_name, matcher_info)) + info.extend(self._inorout.sys_info()) return info -# FileDisposition "methods": FileDisposition is a pure value object, so it can -# be implemented in either C or Python. Acting on them is done with these -# functions. - -def _disposition_init(cls, original_filename): - """Construct and initialize a new FileDisposition object.""" - disp = cls() - disp.original_filename = original_filename - disp.canonical_filename = original_filename - disp.source_filename = None - disp.trace = False - disp.reason = "" - disp.file_tracer = None - disp.has_dynamic_filename = False - return disp - - -def _disposition_debug_msg(disp): - """Make a nice debug message of what the FileDisposition is doing.""" - if disp.trace: - msg = "Tracing %r" % (disp.original_filename,) - if disp.file_tracer: - msg += ": will be traced by %r" % disp.file_tracer - else: - msg = "Not tracing %r: %s" % (disp.original_filename, disp.reason) - return msg - - def process_startup(): """Call this at Python start-up to perhaps measure coverage. @@ -1277,10 +892,11 @@ def process_startup(): cov = Coverage(config_file=cps) process_startup.coverage = cov - cov.start() cov._warn_no_data = False cov._warn_unimported_source = False + cov._warn_preimported_source = False cov._auto_save = True + cov.start() return cov diff --git a/coverage/ctracer/datastack.c b/coverage/ctracer/datastack.c index 515ba924..a9cfcc2c 100644 --- a/coverage/ctracer/datastack.c +++ b/coverage/ctracer/datastack.c @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #include "util.h" #include "datastack.h" diff --git a/coverage/ctracer/datastack.h b/coverage/ctracer/datastack.h index b2dbeb95..3b3078ba 100644 --- a/coverage/ctracer/datastack.h +++ b/coverage/ctracer/datastack.h @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #ifndef _COVERAGE_DATASTACK_H #define _COVERAGE_DATASTACK_H diff --git a/coverage/ctracer/filedisp.c b/coverage/ctracer/filedisp.c index 479a2c9f..47782ae0 100644 --- a/coverage/ctracer/filedisp.c +++ b/coverage/ctracer/filedisp.c @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #include "util.h" #include "filedisp.h" diff --git a/coverage/ctracer/filedisp.h b/coverage/ctracer/filedisp.h index ada68eaf..860f9a50 100644 --- a/coverage/ctracer/filedisp.h +++ b/coverage/ctracer/filedisp.h @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #ifndef _COVERAGE_FILEDISP_H #define _COVERAGE_FILEDISP_H diff --git a/coverage/ctracer/module.c b/coverage/ctracer/module.c index 76231859..f308902b 100644 --- a/coverage/ctracer/module.c +++ b/coverage/ctracer/module.c @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #include "util.h" #include "tracer.h" diff --git a/coverage/ctracer/stats.h b/coverage/ctracer/stats.h index c5ffdf5f..05173369 100644 --- a/coverage/ctracer/stats.h +++ b/coverage/ctracer/stats.h @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #ifndef _COVERAGE_STATS_H #define _COVERAGE_STATS_H diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index 6dcdc576..01f8b19b 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ /* C-based Tracer for coverage.py. */ diff --git a/coverage/ctracer/tracer.h b/coverage/ctracer/tracer.h index d5d630fb..61c01b41 100644 --- a/coverage/ctracer/tracer.h +++ b/coverage/ctracer/tracer.h @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #ifndef _COVERAGE_TRACER_H #define _COVERAGE_TRACER_H diff --git a/coverage/ctracer/util.h b/coverage/ctracer/util.h index f0c302cf..96d2e51c 100644 --- a/coverage/ctracer/util.h +++ b/coverage/ctracer/util.h @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ #ifndef _COVERAGE_UTIL_H #define _COVERAGE_UTIL_H diff --git a/coverage/data.py b/coverage/data.py index 6f76a727..9f2d1308 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Coverage data for coverage.py.""" diff --git a/coverage/debug.py b/coverage/debug.py index e68736f6..d63a9070 100644 --- a/coverage/debug.py +++ b/coverage/debug.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Control of and utilities for debugging.""" @@ -215,7 +215,7 @@ class DebugOutputFile(object): # pragma: debugging self.write("New process: executable: %s\n" % (sys.executable,)) self.write("New process: cmd: %s\n" % (cmd,)) if hasattr(os, 'getppid'): - self.write("New process: parent pid: %s\n" % (os.getppid(),)) + self.write("New process: pid: %s, parent pid: %s\n" % (os.getpid(), os.getppid())) SYS_MOD_NAME = '$coverage.debug.DebugOutputFile.the_one' @@ -234,7 +234,8 @@ class DebugOutputFile(object): # pragma: debugging # on a class attribute. Yes, this is aggressively gross. the_one = sys.modules.get(cls.SYS_MOD_NAME) if the_one is None: - assert fileobj is not None + if fileobj is None: + fileobj = open("/tmp/debug_log.txt", "a") sys.modules[cls.SYS_MOD_NAME] = the_one = cls(fileobj, show_process, filters) return the_one diff --git a/coverage/disposition.py b/coverage/disposition.py new file mode 100644 index 00000000..9b9a997d --- /dev/null +++ b/coverage/disposition.py @@ -0,0 +1,37 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Simple value objects for tracking what to do with files.""" + + +class FileDisposition(object): + """A simple value type for recording what to do with a file.""" + pass + + +# FileDisposition "methods": FileDisposition is a pure value object, so it can +# be implemented in either C or Python. Acting on them is done with these +# functions. + +def disposition_init(cls, original_filename): + """Construct and initialize a new FileDisposition object.""" + disp = cls() + disp.original_filename = original_filename + disp.canonical_filename = original_filename + disp.source_filename = None + disp.trace = False + disp.reason = "" + disp.file_tracer = None + disp.has_dynamic_filename = False + return disp + + +def disposition_debug_msg(disp): + """Make a nice debug message of what the FileDisposition is doing.""" + if disp.trace: + msg = "Tracing %r" % (disp.original_filename,) + if disp.file_tracer: + msg += ": will be traced by %r" % disp.file_tracer + else: + msg = "Not tracing %r: %s" % (disp.original_filename, disp.reason) + return msg diff --git a/coverage/env.py b/coverage/env.py index 4699a1e5..e35d026b 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Determine facts about the environment.""" diff --git a/coverage/execfile.py b/coverage/execfile.py index 42e0d96a..b2b78444 100644 --- a/coverage/execfile.py +++ b/coverage/execfile.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Execute files of Python code.""" @@ -9,6 +9,7 @@ import struct import sys import types +from coverage import env from coverage.backward import BUILTINS from coverage.backward import PYC_MAGIC_NUMBER, imp, importlib_util_find_spec from coverage.misc import CoverageException, ExceptionDuringRun, NoCode, NoSource, isolate_module @@ -111,7 +112,15 @@ def run_python_module(modulename, args): pathname = os.path.abspath(pathname) args[0] = pathname - run_python_file(pathname, args, package=packagename, modulename=modulename, path0="") + # Python 3.7.0b3 changed the behavior of the sys.path[0] entry for -m. It + # used to be an empty string (meaning the current directory). It changed + # to be the actual path to the current directory, so that os.chdir wouldn't + # affect the outcome. + if env.PYVERSION >= (3, 7, 0, 'beta', 3): + path0 = os.getcwd() + else: + path0 = "" + run_python_file(pathname, args, package=packagename, modulename=modulename, path0=path0) def run_python_file(filename, args, package=None, modulename=None, path0=None): @@ -128,7 +137,7 @@ def run_python_file(filename, args, package=None, modulename=None, path0=None): function will decide on a value. """ - if modulename is None and sys.version_info >= (3, 3): + if modulename is None and env.PYVERSION >= (3, 3): modulename = '__main__' # Create a module to serve as __main__ @@ -255,7 +264,7 @@ def make_code_from_pyc(filename): raise NoCode("Bad magic number in .pyc file") date_based = True - if sys.version_info >= (3, 7, 0, 'alpha', 4): + if env.PYVERSION >= (3, 7, 0, 'alpha', 4): flags = struct.unpack('<L', fpyc.read(4))[0] hash_based = flags & 0x01 if hash_based: @@ -264,7 +273,7 @@ def make_code_from_pyc(filename): if date_based: # Skip the junk in the header that we don't need. fpyc.read(4) # Skip the moddate. - if sys.version_info >= (3, 3): + if env.PYVERSION >= (3, 3): # 3.3 added another long to the header (size), skip it. fpyc.read(4) diff --git a/coverage/files.py b/coverage/files.py index 759ec2c9..70fde9db 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """File wrangling.""" diff --git a/coverage/fullcoverage/encodings.py b/coverage/fullcoverage/encodings.py index 699f3863..aeb416e4 100644 --- a/coverage/fullcoverage/encodings.py +++ b/coverage/fullcoverage/encodings.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Imposter encodings module that installs a coverage-style tracer. diff --git a/coverage/html.py b/coverage/html.py index b0c61649..186e9d22 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -1,11 +1,12 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """HTML reporting for coverage.py.""" import datetime import json import os +import re import shutil import coverage @@ -66,6 +67,7 @@ def read_data(fname): def write_html(fname, html): """Write `html` to `fname`, properly encoded.""" + html = re.sub(r"(\A\s+)|(\s+$)", "", html, flags=re.MULTILINE) with open(fname, "wb") as fout: fout.write(html.encode('ascii', 'xmlcharrefreplace')) @@ -102,11 +104,11 @@ class HtmlReporter(Reporter): } self.source_tmpl = Templite(read_data("pyfile.html"), self.template_globals) - self.coverage = cov + self.data = cov.get_data() self.files = [] self.all_files_nums = [] - self.has_arcs = self.coverage.data.has_arcs() + self.has_arcs = self.data.has_arcs() self.status = HtmlStatus() self.extra_css = None self.totals = Numbers() @@ -167,7 +169,7 @@ class HtmlReporter(Reporter): """Compute a hash that changes if the file needs to be re-reported.""" m = Hasher() m.update(source) - self.coverage.data.add_to_hash(fr.filename, m) + self.data.add_to_hash(fr.filename, m) return m.hexdigest() def html_file(self, fr, analysis): diff --git a/coverage/htmlfiles/coverage_html.js b/coverage/htmlfiles/coverage_html.js index f6f5de20..7fc2963c 100644 --- a/coverage/htmlfiles/coverage_html.js +++ b/coverage/htmlfiles/coverage_html.js @@ -1,5 +1,5 @@ // Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -// For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +// For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt // Coverage.py HTML report browser code. /*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */ @@ -555,11 +555,16 @@ coverage.resize_scroll_markers = function () { var previous_line = -99, last_mark, - last_top; + last_top, + offsets = {}; + // Calculate line offsets outside loop to prevent relayouts + c.missed_lines.each(function() { + offsets[this.id] = $(this).offset().top; + }); c.missed_lines.each(function () { - var line_top = Math.round($(this).offset().top * marker_scale), - id_name = $(this).attr('id'), + var id_name = $(this).attr('id'), + line_top = Math.round(offsets[id_name] * marker_scale), line_number = parseInt(id_name.substring(1, id_name.length)); if (line_number === previous_line + 1) { diff --git a/coverage/htmlfiles/index.html b/coverage/htmlfiles/index.html index 1e3999f9..4129bc31 100644 --- a/coverage/htmlfiles/index.html +++ b/coverage/htmlfiles/index.html @@ -1,5 +1,5 @@ {# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 #} -{# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt #} +{# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt #} <!DOCTYPE html> <html> diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index 8542a467..245ecf41 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -1,5 +1,5 @@ {# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 #} -{# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt #} +{# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt #} <!DOCTYPE html> <html> diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css index 86b82091..14592865 100644 --- a/coverage/htmlfiles/style.css +++ b/coverage/htmlfiles/style.css @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ /* CSS styles for coverage.py. */ @@ -365,6 +365,7 @@ td.text { height: 100%; background: white; border-left: 1px solid #eee; + will-change: transform; /* for faster scrolling of fixed element in Chrome */ } #scroll_marker .marker { diff --git a/coverage/inorout.py b/coverage/inorout.py new file mode 100644 index 00000000..15e496af --- /dev/null +++ b/coverage/inorout.py @@ -0,0 +1,461 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Determining whether files are being measured/reported or not.""" + +# For finding the stdlib +import atexit +import inspect +import itertools +import os +import platform +import re +import sys +import traceback + +from coverage import env +from coverage.disposition import FileDisposition, disposition_init +from coverage.files import TreeMatcher, FnmatchMatcher, ModuleMatcher +from coverage.files import prep_patterns, find_python_files, canonical_filename +from coverage.misc import CoverageException +from coverage.python import source_for_file, source_for_morf + + +# Pypy has some unusual stuff in the "stdlib". Consider those locations +# when deciding where the stdlib is. These modules are not used for anything, +# they are modules importable from the pypy lib directories, so that we can +# find those directories. +_structseq = _pypy_irc_topic = None +if env.PYPY: + try: + import _structseq + except ImportError: + pass + + try: + import _pypy_irc_topic + except ImportError: + pass + + +def canonical_path(morf, directory=False): + """Return the canonical path of the module or file `morf`. + + If the module is a package, then return its directory. If it is a + module, then return its file, unless `directory` is True, in which + case return its enclosing directory. + + """ + morf_path = canonical_filename(source_for_morf(morf)) + if morf_path.endswith("__init__.py") or directory: + morf_path = os.path.split(morf_path)[0] + return morf_path + + +def name_for_module(filename, frame): + """Get the name of the module for a filename and frame. + + For configurability's sake, we allow __main__ modules to be matched by + their importable name. + + If loaded via runpy (aka -m), we can usually recover the "original" + full dotted module name, otherwise, we resort to interpreting the + file name to get the module's name. In the case that the module name + can't be determined, None is returned. + + """ + module_globals = frame.f_globals if frame is not None else {} + if module_globals is None: # pragma: only ironpython + # IronPython doesn't provide globals: https://github.com/IronLanguages/main/issues/1296 + module_globals = {} + + dunder_name = module_globals.get('__name__', None) + + if isinstance(dunder_name, str) and dunder_name != '__main__': + # This is the usual case: an imported module. + return dunder_name + + loader = module_globals.get('__loader__', None) + for attrname in ('fullname', 'name'): # attribute renamed in py3.2 + if hasattr(loader, attrname): + fullname = getattr(loader, attrname) + else: + continue + + if isinstance(fullname, str) and fullname != '__main__': + # Module loaded via: runpy -m + return fullname + + # Script as first argument to Python command line. + inspectedname = inspect.getmodulename(filename) + if inspectedname is not None: + return inspectedname + else: + return dunder_name + + +def module_is_namespace(mod): + """Is the module object `mod` a PEP420 namespace module?""" + return hasattr(mod, '__path__') and getattr(mod, '__file__', None) is None + + +def module_has_file(mod): + """Does the module object `mod` have an existing __file__ ?""" + mod__file__ = getattr(mod, '__file__', None) + if mod__file__ is None: + return False + return os.path.exists(mod__file__) + + +class InOrOut(object): + """Machinery for determining what files to measure.""" + + def __init__(self, warn): + self.warn = warn + + # The matchers for should_trace. + self.source_match = None + self.source_pkgs_match = None + self.pylib_paths = self.cover_paths = None + self.pylib_match = self.cover_match = None + self.include_match = self.omit_match = None + self.plugins = [] + self.disp_class = FileDisposition + + # The source argument can be directories or package names. + self.source = [] + self.source_pkgs = [] + self.source_pkgs_unmatched = [] + self.omit = self.include = None + + def configure(self, config): + """Apply the configuration to get ready for decision-time.""" + for src in config.source or []: + if os.path.isdir(src): + self.source.append(canonical_filename(src)) + else: + self.source_pkgs.append(src) + self.source_pkgs_unmatched = self.source_pkgs[:] + + self.omit = prep_patterns(config.run_omit) + self.include = prep_patterns(config.run_include) + + # The directories for files considered "installed with the interpreter". + self.pylib_paths = set() + if not config.cover_pylib: + # Look at where some standard modules are located. That's the + # indication for "installed with the interpreter". In some + # environments (virtualenv, for example), these modules may be + # spread across a few locations. Look at all the candidate modules + # we've imported, and take all the different ones. + for m in (atexit, inspect, os, platform, _pypy_irc_topic, re, _structseq, traceback): + if m is not None and hasattr(m, "__file__"): + self.pylib_paths.add(canonical_path(m, directory=True)) + + if _structseq and not hasattr(_structseq, '__file__'): + # PyPy 2.4 has no __file__ in the builtin modules, but the code + # objects still have the file names. So dig into one to find + # the path to exclude. + structseq_new = _structseq.structseq_new + try: + structseq_file = structseq_new.func_code.co_filename + except AttributeError: + structseq_file = structseq_new.__code__.co_filename + self.pylib_paths.add(canonical_path(structseq_file)) + + # To avoid tracing the coverage.py code itself, we skip anything + # located where we are. + self.cover_paths = [canonical_path(__file__, directory=True)] + if env.TESTING: + # Don't include our own test code. + self.cover_paths.append(os.path.join(self.cover_paths[0], "tests")) + + # When testing, we use PyContracts, which should be considered + # part of coverage.py, and it uses six. Exclude those directories + # just as we exclude ourselves. + import contracts + import six + for mod in [contracts, six]: + self.cover_paths.append(canonical_path(mod)) + + # Create the matchers we need for should_trace + if self.source or self.source_pkgs: + self.source_match = TreeMatcher(self.source) + self.source_pkgs_match = ModuleMatcher(self.source_pkgs) + else: + if self.cover_paths: + self.cover_match = TreeMatcher(self.cover_paths) + if self.pylib_paths: + self.pylib_match = TreeMatcher(self.pylib_paths) + if self.include: + self.include_match = FnmatchMatcher(self.include) + if self.omit: + self.omit_match = FnmatchMatcher(self.omit) + + def should_trace(self, filename, frame=None): + """Decide whether to trace execution in `filename`, with a reason. + + This function is called from the trace function. As each new file name + is encountered, this function determines whether it is traced or not. + + Returns a FileDisposition object. + + """ + original_filename = filename + disp = disposition_init(self.disp_class, filename) + + def nope(disp, reason): + """Simple helper to make it easy to return NO.""" + disp.trace = False + disp.reason = reason + return disp + + if frame is not None: + # Compiled Python files have two file names: frame.f_code.co_filename is + # the file name at the time the .pyc was compiled. The second name is + # __file__, which is where the .pyc was actually loaded from. Since + # .pyc files can be moved after compilation (for example, by being + # installed), we look for __file__ in the frame and prefer it to the + # co_filename value. + dunder_file = frame.f_globals and frame.f_globals.get('__file__') + if dunder_file: + filename = source_for_file(dunder_file) + if original_filename and not original_filename.startswith('<'): + orig = os.path.basename(original_filename) + if orig != os.path.basename(filename): + # Files shouldn't be renamed when moved. This happens when + # exec'ing code. If it seems like something is wrong with + # the frame's file name, then just use the original. + filename = original_filename + + if not filename: + # Empty string is pretty useless. + return nope(disp, "empty string isn't a file name") + + if filename.startswith('memory:'): + return nope(disp, "memory isn't traceable") + + if filename.startswith('<'): + # Lots of non-file execution is represented with artificial + # file names like "<string>", "<doctest readme.txt[0]>", or + # "<exec_function>". Don't ever trace these executions, since we + # can't do anything with the data later anyway. + return nope(disp, "not a real file name") + + # pyexpat does a dumb thing, calling the trace function explicitly from + # C code with a C file name. + if re.search(r"[/\\]Modules[/\\]pyexpat.c", filename): + return nope(disp, "pyexpat lies about itself") + + # Jython reports the .class file to the tracer, use the source file. + if filename.endswith("$py.class"): + filename = filename[:-9] + ".py" + + canonical = canonical_filename(filename) + disp.canonical_filename = canonical + + # Try the plugins, see if they have an opinion about the file. + plugin = None + for plugin in self.plugins.file_tracers: + if not plugin._coverage_enabled: + continue + + try: + file_tracer = plugin.file_tracer(canonical) + if file_tracer is not None: + file_tracer._coverage_plugin = plugin + disp.trace = True + disp.file_tracer = file_tracer + if file_tracer.has_dynamic_source_filename(): + disp.has_dynamic_filename = True + else: + disp.source_filename = canonical_filename( + file_tracer.source_filename() + ) + break + except Exception: + self.warn( + "Disabling plug-in %r due to an exception:" % (plugin._coverage_plugin_name) + ) + traceback.print_exc() + plugin._coverage_enabled = False + continue + else: + # No plugin wanted it: it's Python. + disp.trace = True + disp.source_filename = canonical + + if not disp.has_dynamic_filename: + if not disp.source_filename: + raise CoverageException( + "Plugin %r didn't set source_filename for %r" % + (plugin, disp.original_filename) + ) + reason = self.check_include_omit_etc(disp.source_filename, frame) + if reason: + nope(disp, reason) + + return disp + + def check_include_omit_etc(self, filename, frame): + """Check a file name against the include, omit, etc, rules. + + Returns a string or None. String means, don't trace, and is the reason + why. None means no reason found to not trace. + + """ + modulename = name_for_module(filename, frame) + + # If the user specified source or include, then that's authoritative + # about the outer bound of what to measure and we don't have to apply + # any canned exclusions. If they didn't, then we have to exclude the + # stdlib and coverage.py directories. + if self.source_match: + if self.source_pkgs_match.match(modulename): + if modulename in self.source_pkgs_unmatched: + self.source_pkgs_unmatched.remove(modulename) + elif not self.source_match.match(filename): + return "falls outside the --source trees" + elif self.include_match: + if not self.include_match.match(filename): + return "falls outside the --include trees" + else: + # If we aren't supposed to trace installed code, then check if this + # is near the Python standard library and skip it if so. + if self.pylib_match and self.pylib_match.match(filename): + return "is in the stdlib" + + # We exclude the coverage.py code itself, since a little of it + # will be measured otherwise. + if self.cover_match and self.cover_match.match(filename): + return "is part of coverage.py" + + # Check the file against the omit pattern. + if self.omit_match and self.omit_match.match(filename): + return "is inside an --omit pattern" + + # No reason found to skip this file. + return None + + def warn_conflicting_settings(self): + """Warn if there are settings that conflict.""" + if self.include: + if self.source or self.source_pkgs: + self.warn("--include is ignored because --source is set", slug="include-ignored") + + def warn_already_imported_files(self): + """Warn if files have already been imported that we will be measuring.""" + if self.include or self.source or self.source_pkgs: + warned = set() + for mod in list(sys.modules.values()): + filename = getattr(mod, "__file__", None) + if filename is None: + continue + if filename in warned: + continue + + disp = self.should_trace(filename) + if disp.trace: + msg = "Already imported a file that will be measured: {0}".format(filename) + self.warn(msg, slug="already-imported") + warned.add(filename) + + def warn_unimported_source(self): + """Warn about source packages that were of interest, but never traced.""" + for pkg in self.source_pkgs_unmatched: + self._warn_about_unmeasured_code(pkg) + + def _warn_about_unmeasured_code(self, pkg): + """Warn about a package or module that we never traced. + + `pkg` is a string, the name of the package or module. + + """ + mod = sys.modules.get(pkg) + if mod is None: + self.warn("Module %s was never imported." % pkg, slug="module-not-imported") + return + + if module_is_namespace(mod): + # A namespace package. It's OK for this not to have been traced, + # since there is no code directly in it. + return + + if not module_has_file(mod): + self.warn("Module %s has no Python source." % pkg, slug="module-not-python") + return + + # The module was in sys.modules, and seems like a module with code, but + # we never measured it. I guess that means it was imported before + # coverage even started. + self.warn( + "Module %s was previously imported, but not measured" % pkg, + slug="module-not-measured", + ) + + def find_unexecuted_files(self): + """Find files in the areas of interest that weren't traced. + + Yields pairs: file path, and responsible plug-in name. + """ + for pkg in self.source_pkgs: + if (not pkg in sys.modules or + not module_has_file(sys.modules[pkg])): + continue + pkg_file = source_for_file(sys.modules[pkg].__file__) + for ret in self._find_unexecuted_files(canonical_path(pkg_file)): + yield ret + + for src in self.source: + for ret in self._find_unexecuted_files(src): + yield ret + + def _find_plugin_files(self, src_dir): + """Get executable files from the plugins.""" + for plugin in self.plugins.file_tracers: + for x_file in plugin.find_executable_files(src_dir): + yield x_file, plugin._coverage_plugin_name + + def _find_unexecuted_files(self, src_dir): + """Find unexecuted files in `src_dir`. + + Search for files in `src_dir` that are probably importable, + and add them as unexecuted files in `self.data`. + + """ + py_files = ((py_file, None) for py_file in find_python_files(src_dir)) + plugin_files = self._find_plugin_files(src_dir) + + for file_path, plugin_name in itertools.chain(py_files, plugin_files): + file_path = canonical_filename(file_path) + if self.omit_match and self.omit_match.match(file_path): + # Turns out this file was omitted, so don't pull it back + # in as unexecuted. + continue + yield file_path, plugin_name + + def sys_info(self): + """Our information for Coverage.sys_info. + + Returns a list of (key, value) pairs. + """ + info = [ + ('cover_paths', self.cover_paths), + ('pylib_paths', self.pylib_paths), + ] + + matcher_names = [ + 'source_match', 'source_pkgs_match', + 'include_match', 'omit_match', + 'cover_match', 'pylib_match', + ] + + for matcher_name in matcher_names: + matcher = getattr(self, matcher_name) + if matcher: + matcher_info = matcher.info() + else: + matcher_info = '-none-' + info.append((matcher_name, matcher_info)) + + return info diff --git a/coverage/misc.py b/coverage/misc.py index 28aa3b06..fff2a187 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Miscellaneous stuff for coverage.py.""" diff --git a/coverage/multiproc.py b/coverage/multiproc.py index fe837318..62f6beb7 100644 --- a/coverage/multiproc.py +++ b/coverage/multiproc.py @@ -1,24 +1,21 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Monkey-patching to add multiprocessing support for coverage.py""" import multiprocessing import multiprocessing.process import os -import sys +from coverage import env from coverage.misc import contract # An attribute that will be set on the module to indicate that it has been # monkey-patched. PATCHED_MARKER = "_coverage$patched" -# The environment variable that specifies the rcfile for subprocesses. -COVERAGE_RCFILE_ENV = "_COVERAGE_RCFILE" - -if sys.version_info >= (3, 4): +if env.PYVERSION >= (3, 4): OriginalProcess = multiprocessing.process.BaseProcess else: OriginalProcess = multiprocessing.Process @@ -31,10 +28,10 @@ class ProcessWithCoverage(OriginalProcess): def _bootstrap(self): """Wrapper around _bootstrap to start coverage.""" from coverage import Coverage # avoid circular import - rcfile = os.environ[COVERAGE_RCFILE_ENV] - cov = Coverage(data_suffix=True, config_file=rcfile) + cov = Coverage(data_suffix=True) + cov._warn_preimported_source = False cov.start() - debug = cov.debug + debug = cov._debug try: if debug.should("multiproc"): debug.write("Calling multiprocessing bootstrap") @@ -73,14 +70,14 @@ def patch_multiprocessing(rcfile): if hasattr(multiprocessing, PATCHED_MARKER): return - if sys.version_info >= (3, 4): + if env.PYVERSION >= (3, 4): OriginalProcess._bootstrap = ProcessWithCoverage._bootstrap else: multiprocessing.Process = ProcessWithCoverage # Set the value in ProcessWithCoverage that will be pickled into the child # process. - os.environ[COVERAGE_RCFILE_ENV] = rcfile + os.environ["COVERAGE_RCFILE"] = rcfile # When spawning processes rather than forking them, we have no state in the # new process. We sneak in there with a Stowaway: we stuff one of our own diff --git a/coverage/parser.py b/coverage/parser.py index 6e6cccd5..c9eb793f 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Code parsing for coverage.py.""" diff --git a/coverage/phystokens.py b/coverage/phystokens.py index a2b23cfc..ccfe63b3 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Better tokenizing for coverage.py.""" diff --git a/coverage/pickle2json.py b/coverage/pickle2json.py deleted file mode 100644 index 95b42ef3..00000000 --- a/coverage/pickle2json.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt - -"""Convert pickle to JSON for coverage.py.""" - -from coverage.backward import pickle -from coverage.data import CoverageData - - -def pickle_read_raw_data(cls_unused, file_obj): - """Replacement for CoverageData._read_raw_data.""" - return pickle.load(file_obj) - - -def pickle2json(infile, outfile): - """Convert a coverage.py 3.x pickle data file to a 4.x JSON data file.""" - try: - old_read_raw_data = CoverageData._read_raw_data - CoverageData._read_raw_data = pickle_read_raw_data - - covdata = CoverageData() - - with open(infile, 'rb') as inf: - covdata.read_fileobj(inf) - - covdata.write_file(outfile) - finally: - CoverageData._read_raw_data = old_read_raw_data - - -if __name__ == "__main__": - from optparse import OptionParser - - parser = OptionParser(usage="usage: %s [options]" % __file__) - parser.description = "Convert .coverage files from pickle to JSON format" - parser.add_option( - "-i", "--input-file", action="store", default=".coverage", - help="Name of input file. Default .coverage", - ) - parser.add_option( - "-o", "--output-file", action="store", default=".coverage", - help="Name of output file. Default .coverage", - ) - - (options, args) = parser.parse_args() - - pickle2json(options.input_file, options.output_file) diff --git a/coverage/plugin.py b/coverage/plugin.py index db7ca0a7..f65d419c 100644 --- a/coverage/plugin.py +++ b/coverage/plugin.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """ .. versionadded:: 4.0 @@ -134,7 +134,8 @@ class CoveragePlugin(object): This will only be invoked if `filename` returns non-None from :meth:`file_tracer`. It's an error to return None from this method. - Returns a :class:`FileReporter` object to use to report on `filename`. + Returns a :class:`FileReporter` object to use to report on `filename`, + or the string `"python"` to have coverage.py treat the file as Python. """ _needs_to_implement(self, "file_reporter") diff --git a/coverage/plugin_support.py b/coverage/plugin_support.py index c737a42c..0727a3b0 100644 --- a/coverage/plugin_support.py +++ b/coverage/plugin_support.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Support for plugins.""" diff --git a/coverage/python.py b/coverage/python.py index 372347f5..31db1a27 100644 --- a/coverage/python.py +++ b/coverage/python.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Python source expertise for coverage.py""" @@ -97,7 +97,7 @@ def get_zip_bytes(filename): def source_for_file(filename): - """Return the source file for `filename`. + """Return the source filename for `filename`. Given a file name being traced, return the best guess as to the source file to attribute it to. @@ -129,22 +129,28 @@ def source_for_file(filename): return filename +def source_for_morf(morf): + """Get the source filename for the module-or-file `morf`.""" + if hasattr(morf, '__file__') and morf.__file__: + filename = morf.__file__ + elif isinstance(morf, types.ModuleType): + # A module should have had .__file__, otherwise we can't use it. + # This could be a PEP-420 namespace package. + raise CoverageException("Module {0} has no file".format(morf)) + else: + filename = morf + + filename = source_for_file(files.unicode_filename(filename)) + return filename + + class PythonFileReporter(FileReporter): """Report support for a Python file.""" def __init__(self, morf, coverage=None): self.coverage = coverage - if hasattr(morf, '__file__'): - filename = morf.__file__ - elif isinstance(morf, types.ModuleType): - # A module should have had .__file__, otherwise we can't use it. - # This could be a PEP-420 namespace package. - raise CoverageException("Module {0} has no file".format(morf)) - else: - filename = morf - - filename = source_for_file(files.unicode_filename(filename)) + filename = source_for_morf(morf) super(PythonFileReporter, self).__init__(files.canonical_filename(filename)) diff --git a/coverage/pytracer.py b/coverage/pytracer.py index 7e70bab6..d0549f72 100644 --- a/coverage/pytracer.py +++ b/coverage/pytracer.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Raw data collector for coverage.py.""" diff --git a/coverage/report.py b/coverage/report.py index b4608633..e4378f6d 100644 --- a/coverage/report.py +++ b/coverage/report.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Reporter foundation for coverage.py.""" diff --git a/coverage/results.py b/coverage/results.py index 5f84a689..7e3bd268 100644 --- a/coverage/results.py +++ b/coverage/results.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Results of coverage measurement.""" diff --git a/coverage/summary.py b/coverage/summary.py index 271b648a..95afbcf0 100644 --- a/coverage/summary.py +++ b/coverage/summary.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Summary reporting""" @@ -16,7 +16,8 @@ class SummaryReporter(Reporter): def __init__(self, coverage, config): super(SummaryReporter, self).__init__(coverage, config) - self.branches = coverage.data.has_arcs() + data = coverage.get_data() + self.branches = data.has_arcs() def report(self, morfs, outfile=None): """Writes a report summarizing coverage statistics per module. diff --git a/coverage/templite.py b/coverage/templite.py index 9944695a..b546ef7c 100644 --- a/coverage/templite.py +++ b/coverage/templite.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """A simple Python template renderer, for a nano-subset of Django syntax. diff --git a/coverage/version.py b/coverage/version.py index 7dc59e27..2639941a 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -1,11 +1,11 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """The version and URL for coverage.py""" # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (4, 5, 1, 'final', 0) +version_info = (5, 0, 0, 'alpha', 2) def _make_version(major, minor, micro, releaselevel, serial): diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index 3b651d46..5148b54a 100644 --- a/coverage/xmlreport.py +++ b/coverage/xmlreport.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """XML reporting for coverage.py""" @@ -42,7 +42,8 @@ class XmlReporter(Reporter): self.source_paths.add(files.canonical_filename(src)) self.packages = {} self.xml_out = None - self.has_arcs = coverage.data.has_arcs() + self.data = coverage.get_data() + self.has_arcs = self.data.has_arcs() def report(self, morfs, outfile=None): """Generate a Cobertura-compatible XML report for `morfs`. diff --git a/doc/api.rst b/doc/api.rst index 26db06ef..d485d90a 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _api: diff --git a/doc/api_coverage.rst b/doc/api_coverage.rst index 70a57eef..9ee95967 100644 --- a/doc/api_coverage.rst +++ b/doc/api_coverage.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _api_coverage: diff --git a/doc/api_coveragedata.rst b/doc/api_coveragedata.rst index 75215a3d..b3b64328 100644 --- a/doc/api_coveragedata.rst +++ b/doc/api_coveragedata.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _api_coveragedata: diff --git a/doc/api_plugin.rst b/doc/api_plugin.rst index e400a298..d070e2bf 100644 --- a/doc/api_plugin.rst +++ b/doc/api_plugin.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _api_plugin: diff --git a/doc/branch.rst b/doc/branch.rst index f95f1d47..92cab27b 100644 --- a/doc/branch.rst +++ b/doc/branch.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _branch: diff --git a/doc/changes.rst b/doc/changes.rst index 0243b5c1..1dd7b911 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _changes: diff --git a/doc/cmd.rst b/doc/cmd.rst index ef4c1135..d198178f 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _cmd: @@ -171,6 +171,13 @@ could affect the measurement process. The possible warnings include: when coverage started. This meant coverage.py couldn't monitor its execution. +* "Already imported a file that will be measured: XXX (already-imported)" + + File XXX had already been imported when coverage.py started measurement. Your + setting for ``--source`` or ``--include`` indicates that you wanted to + measure that file. Lines will be missing from the coverage report since the + execution during import hadn't been measured. + * "--include is ignored because --source is set (include-ignored)" Both ``--include`` and ``--source`` were specified while running code. Both diff --git a/doc/conf.py b/doc/conf.py index 08c88537..9936d1b9 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # # coverage.py documentation build configuration file, created by @@ -56,9 +56,9 @@ copyright = u'2009\N{EN DASH}2018, Ned Batchelder' # CHANGEME # built documents. # # The short X.Y version. -version = '4.5' # CHANGEME +version = '5.0' # CHANGEME # The full version, including alpha/beta/rc tags. -release = '4.5.1' # CHANGEME +release = '5.0a1' # CHANGEME # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/config.rst b/doc/config.rst index c1fb4b1b..3e76e3d0 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _config: @@ -33,8 +33,9 @@ configuration file are tied to your source code and how it should be measured, so it should be stored with your source, and checked into source control, rather than put in your home directory. -A different name for the configuration file can be specified with the -``--rcfile=FILE`` command line option. +A different location for the configuration file can be specified with the +``--rcfile=FILE`` command line option or with the ``COVERAGE_RCFILE`` +environment variable. Coverage.py will read settings from other usual configuration files if no other configuration file is used. It will automatically read from "setup.cfg" or diff --git a/doc/contributing.rst b/doc/contributing.rst index 3f628109..71fa6937 100644 --- a/doc/contributing.rst +++ b/doc/contributing.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _contributing: @@ -117,7 +117,7 @@ the second uses the C implementation. To limit tox to just a few versions of Python, use the ``-e`` switch:: - $ tox -e py27,py33 + $ tox -e py27,py37 To run just a few tests, you can use `pytest test selectors`_:: @@ -128,6 +128,21 @@ To run just a few tests, you can use `pytest test selectors`_:: These command run the tests in one file, one class, and just one test, respectively. +You can also affect the test runs with environment variables: + +- COVERAGE_NO_PYTRACER disables the Python tracer if you only want to run the + CTracer tests. + +- COVERAGE_NO_CTRACER disables the C tracer if you only want to run the + PyTracer tests. + +- COVEGE_AST_DUMP will dump the AST tree as it is being used during code + parsing. + +- COVERAGE_KEEP_OUTPUT will save the output files that were generated by the + gold-file tests, ones that compare output files to saved gold files. + + Of course, run all the tests on every version of Python you have, before submitting a change. diff --git a/doc/excluding.rst b/doc/excluding.rst index 465afe16..e56cf0a7 100644 --- a/doc/excluding.rst +++ b/doc/excluding.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _excluding: diff --git a/doc/faq.rst b/doc/faq.rst index a0145362..293b34b0 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _faq: @@ -109,15 +109,15 @@ __ https://nedbatchelder.com/blog/200710/flaws_in_coverage_measurement.html - `trialcoverage`_ is a plug-in for Twisted trial. - .. _trialcoverage: https://pypi.python.org/pypi/trialcoverage + .. _trialcoverage: https://pypi.org/project/trialcoverage/ - `pytest-coverage`_ - .. _pytest-coverage: https://pypi.python.org/pypi/pytest-coverage + .. _pytest-coverage: https://pypi.org/project/pytest-coverage/ - `django-coverage`_ for use with Django. - .. _django-coverage: https://pypi.python.org/pypi/django-coverage + .. _django-coverage: https://pypi.org/project/django-coverage/ **Q: Where can I get more help with coverage.py?** diff --git a/doc/howitworks.rst b/doc/howitworks.rst index 764472be..62af42e3 100644 --- a/doc/howitworks.rst +++ b/doc/howitworks.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _howitworks: diff --git a/doc/index.rst b/doc/index.rst index 44e53946..78496cdb 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt =========== Coverage.py @@ -77,21 +77,21 @@ not. .. ifconfig:: prerelease - The latest version is coverage.py 4.4b1, released April 4th 2017. It is + The latest version is coverage.py 5.0a1, released June 5th 2018. It is supported on: - * Python versions 2.6, 2.7, 3.3, 3.4, 3.5, and 3.6. + * Python versions 2.7, 3.4, 3.5, 3.6, and 3.7. - * PyPy2 5.6 and PyPy3 5.5. + * PyPy2 6.0 and PyPy3 6.0. * Jython 2.7.1, though only for running code, not reporting. * IronPython 2.7.7, though only for running code, not reporting. **This is a pre-release build. The usual warnings about possible bugs - apply.** The latest stable version is coverage.py 4.3.4, `described here`_. + apply.** The latest stable version is coverage.py 4.5.1, `described here`_. -.. _described here: https://nedbatchelder.com/code/coverage +.. _described here: http://coverage.readthedocs.io/ Quick start @@ -145,7 +145,7 @@ Getting started is easy: Then visit htmlcov/index.html in your browser, to see a `report like this one`_. -.. _coverage.py page on the Python Package Index: https://pypi.python.org/pypi/coverage +.. _coverage.py page on the Python Package Index: https://pypi.org/project/coverage/ .. _report like this: https://nedbatchelder.com/files/sample_coverage_html/index.html .. _report like this one: https://nedbatchelder.com/files/sample_coverage_html_beta/index.html diff --git a/doc/install.rst b/doc/install.rst index 29bc833e..62bd0b98 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _install: @@ -29,8 +29,8 @@ Installation .. highlight:: console -.. _coverage_pypi: https://pypi.python.org/pypi/coverage -.. _setuptools: https://pypi.python.org/pypi/setuptools +.. _coverage_pypi: https://pypi.org/project/coverage/ +.. _setuptools: https://pypi.org/project/setuptools/ You can install coverage.py in the usual ways. The simplest way is with pip:: @@ -95,36 +95,19 @@ Checking the installation If all went well, you should be able to open a command prompt, and see coverage.py installed properly: -.. ifconfig:: not prerelease +.. In the output below, the URL should actually have the release in it for + pre-release, but Sphinx couldn't make a URL like that, so whatever. - .. parsed-literal:: +.. parsed-literal:: - $ coverage --version - Coverage.py, version |release| with C extension - Documentation at https://coverage.readthedocs.io - -.. ifconfig:: prerelease - - .. parsed-literal:: - - $ coverage --version - Coverage.py, version |release| with C extension - Documentation at https://coverage.readthedocs.io/en/coverage-|release| + $ coverage --version + Coverage.py, version |release| with C extension + Documentation at https://coverage.readthedocs.io You can also invoke coverage.py as a module: -.. ifconfig:: not prerelease +.. parsed-literal:: - .. parsed-literal:: - - $ python -m coverage --version - Coverage.py, version |release| with C extension - Documentation at https://coverage.readthedocs.io - -.. ifconfig:: prerelease - - .. parsed-literal:: - - $ python -m coverage --version - Coverage.py, version |release| with C extension - Documentation at https://coverage.readthedocs.io/en/coverage-|release| + $ python -m coverage --version + Coverage.py, version |release| with C extension + Documentation at https://coverage.readthedocs.io diff --git a/doc/plugins.rst b/doc/plugins.rst index f2bad6d4..c77c1e33 100644 --- a/doc/plugins.rst +++ b/doc/plugins.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _plugins: @@ -66,7 +66,7 @@ Some coverage.py plug-ins you might find useful: * `Django template coverage.py plug-in`__: for measuring coverage in Django templates. - .. __: https://pypi.python.org/pypi/django_coverage_plugin + .. __: https://pypi.org/project/django_coverage_plugin/ * `Mako template coverage plug-in`__: for measuring coverage in Mako templates. Doesn't work yet, probably needs some changes in Mako itself. diff --git a/doc/python-coverage.1.txt b/doc/python-coverage.1.txt index 94402b84..a415f080 100644 --- a/doc/python-coverage.1.txt +++ b/doc/python-coverage.1.txt @@ -8,7 +8,7 @@ measure code coverage of Python program execution :Author: Ned Batchelder <ned@nedbatchelder.com> :Author: |author| -:Date: 2015-09-20 +:Date: 2018-05-28 :Copyright: Apache 2.0 license, attribution and disclaimer required. :Manual section: 1 :Manual group: Coverage.py @@ -219,6 +219,10 @@ COVERAGE_FILE Path to the file where coverage measurements are collected to and reported from. Default: ``.coverage`` in the current working directory. +COVERAGE_RCFILE + + Path to the configuration file, often named ``.coveragerc``. + HISTORY ======= diff --git a/doc/requirements.pip b/doc/requirements.pip index 73467c94..c1297408 100644 --- a/doc/requirements.pip +++ b/doc/requirements.pip @@ -3,9 +3,9 @@ # https://requires.io/github/nedbat/coveragepy/requirements/ pyenchant==2.0.0 -sphinx==1.6.6 -sphinxcontrib-spelling==4.0.1 -sphinx_rtd_theme==0.2.4 +sphinx==1.7.5 +sphinxcontrib-spelling==4.2.0 +sphinx_rtd_theme==0.4.0 # A version of doc8 with a -q flag. git+https://github.com/nedbat/doc8.git#egg=doc8==0.0 diff --git a/doc/source.rst b/doc/source.rst index 640fc431..e1bc8038 100644 --- a/doc/source.rst +++ b/doc/source.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _source: diff --git a/doc/subprocess.rst b/doc/subprocess.rst index 7236b7ef..06068959 100644 --- a/doc/subprocess.rst +++ b/doc/subprocess.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _subprocess: diff --git a/doc/trouble.rst b/doc/trouble.rst index e3951218..8f260604 100644 --- a/doc/trouble.rst +++ b/doc/trouble.rst @@ -1,5 +1,5 @@ .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -.. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt .. _trouble: @@ -64,7 +64,7 @@ timid=True`` configuration option. DecoratorTools fiddles with the trace function. You will need to use ``--timid``. -.. _DecoratorTools: https://pypi.python.org/pypi/DecoratorTools +.. _DecoratorTools: https://pypi.org/project/DecoratorTools/ .. _TurboGears: http://turbogears.org/ @@ -10,6 +10,7 @@ - Update CHANGES.rst, including release date. - Update README.rst - "New in x.y:" + - Python versions supported - Update docs - Version, date and python versions in doc/index.rst - Version and copyright date in doc/conf.py @@ -57,7 +58,8 @@ - Update PyPi: - upload kits: - $ make kit_upload - - Visit https://pypi.python.org/pypi?:action=pkg_edit&name=coverage : + - DON'T NEED TO DO THIS ANY MORE? + - Visit https://pypi.python.org/pypi?:action=pkg_edit&name=coverage : - show/hide the proper versions. - Tag the tree - hg tag -m "Coverage 3.0.1" coverage-3.0.1 @@ -74,13 +76,17 @@ - Update readthedocs - visit https://readthedocs.org/projects/coverage/versions/ - find the latest tag in the inactive list, edit it, make it active. + - keep just the latest version of each x.y release, make the rest inactive. - IF NOT BETA: + - visit https://readthedocs.org/projects/coverage/builds/ + - wait for the new tag build to finish successfully. - visit https://readthedocs.org/dashboard/coverage/versions/ - change the default version to the new version - Update bitbucket: - Issue tracker should get new version number in picker. # Note: don't delete old version numbers: it marks changes on the tickets # with that number. +- Visit the fixed issues on bitbucket and mention the version it was fixed in. - Announce on coveragepy-announce@googlegroups.com . - Announce on TIP. @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Helper for building, testing, and linting coverage.py. @@ -122,11 +122,8 @@ def run_tests_with_coverage(tracer, *runner_args): import coverage cov = coverage.Coverage(config_file="metacov.ini", data_suffix=False) - # Cheap trick: the coverage.py code itself is excluded from measurement, - # but if we clobber the cover_prefix in the coverage object, we can defeat - # the self-detection. - cov.cover_prefix = "Please measure coverage.py!" cov._warn_unimported_source = False + cov._warn_preimported_source = False cov.start() try: @@ -297,7 +294,6 @@ def do_check_eol(): check_file("setup.py") check_file("igor.py") check_file("Makefile") - check_file(".hgignore") check_file(".travis.yml") check_files(".", ["*.rst", "*.txt"]) check_files(".", ["*.pip"]) diff --git a/lab/README.txt b/lab/README.txt new file mode 100644 index 00000000..3263667a --- /dev/null +++ b/lab/README.txt @@ -0,0 +1,4 @@ +The lab directory is not part of the installed coverage.py code. These programs +are tools I have used while diagnosing problems, investigating functionality, +and so on. They are not guaranteed to work, or to be suitable for any given +purpose. If you find them useful, enjoy! diff --git a/lab/branches.py b/lab/branches.py index d1908d0f..c2b838dd 100644 --- a/lab/branches.py +++ b/lab/branches.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Demonstrate some issues with coverage.py branch testing. @@ -13,11 +13,11 @@ def my_function(x): i = 0 while True: - print "In while True" + print("In while True") if i > 0: break i += 1 - print "Left the True loop" + print("Left the True loop") # Notice that "while 1" also has this problem. Even though the compiler # knows there's no computation at the top of the loop, it's still expressed @@ -25,11 +25,11 @@ def my_function(x): i = 0 while 1: - print "In while 1" + print("In while 1") if i > 0: break i += 1 - print "Left the 1 loop" + print("Left the 1 loop") # Coverage.py lets developers exclude lines that they know will not be # executed. So far, the branch coverage doesn't use all that information @@ -40,9 +40,9 @@ def my_function(x): if x < 1000: # This branch is always taken - print "x is reasonable" + print("x is reasonable") else: # pragma: nocover - print "this never happens" + print("this never happens") # try-except structures are complex branches. An except clause with a # type is a three-way branch: there could be no exception, there could be @@ -57,9 +57,9 @@ def my_function(x): if y % 2: raise ValueError("y is odd!") except ValueError: - print "y must have been odd" - print "done with y" - print "done with 1, 2" + print("y must have been odd") + print("done with y") + print("done with 1, 2") # Another except clause, but this time all three cases are executed. No # partial lines are shown: @@ -71,11 +71,11 @@ def my_function(x): if y == 0: raise Exception("zero!") except ValueError: - print "y must have been odd" + print("y must have been odd") except: - print "y is something else" - print "done with y" - print "done with 0, 1, 2" + print("y is something else") + print("done with y") + print("done with 0, 1, 2") my_function(1) diff --git a/lab/hack_pyc.py b/lab/hack_pyc.py index 0ebd9948..d63da8fa 100644 --- a/lab/hack_pyc.py +++ b/lab/hack_pyc.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """ Wicked hack to get .pyc files to do bytecode tracing instead of line tracing. diff --git a/lab/parser.py b/lab/parser.py index 0393d209..b3560506 100644 --- a/lab/parser.py +++ b/lab/parser.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Parser.py: a main for invoking code in coverage/parser.py""" diff --git a/lab/platform_info.py b/lab/platform_info.py index 8caea50f..61e02dd2 100644 --- a/lab/platform_info.py +++ b/lab/platform_info.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Dump information so we can get a quick look at what's available.""" diff --git a/lab/run_trace.py b/lab/run_trace.py index ea0a6cb7..27c24a1d 100644 --- a/lab/run_trace.py +++ b/lab/run_trace.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Run a simple trace function on a file of Python code.""" @@ -14,13 +14,13 @@ def trace(frame, event, arg): # This can happen when Python is shutting down. return None - print "%s%s %s %d @%d" % ( + print("%s%s %s %d @%d" % ( " " * nest, event, os.path.basename(frame.f_code.co_filename), frame.f_lineno, frame.f_lasti, - ) + )) if event == 'call': nest += 1 diff --git a/lab/show_platform.py b/lab/show_platform.py index 76122d58..e4f4dc2a 100644 --- a/lab/show_platform.py +++ b/lab/show_platform.py @@ -13,4 +13,4 @@ for n in dir(platform): n += "()" except: continue - print "%30s: %r" % (n, v) + print("%30s: %r" % (n, v)) diff --git a/lab/show_pyc.py b/lab/show_pyc.py index 525797a8..7573c1c3 100644 --- a/lab/show_pyc.py +++ b/lab/show_pyc.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt import binascii import dis diff --git a/metacov.ini b/metacov.ini index 55d0225e..50ea524d 100644 --- a/metacov.ini +++ b/metacov.ini @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Settings to use when using coverage.py to measure itself. [run] @@ -35,6 +35,10 @@ exclude_lines = # OS error conditions that we can't (or don't care to) replicate. pragma: cant happen + # Obscure bugs in specific versions of interpreters, and so probably no + # longer tested. + pragma: obscure + # Jython needs special care. pragma: only jython skip.*Jython diff --git a/perf/perf_measure.py b/perf/perf_measure.py index 3b0ae52a..a8f2ffaa 100644 --- a/perf/perf_measure.py +++ b/perf/perf_measure.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Run like this: # .tox/py36/bin/python perf/perf_measure.py @@ -78,7 +78,7 @@ class StressTest(object): finally: # pragma: nested # Stop coverage.py. covered = time.perf_counter() - start - stats = cov.collector.tracers[0].get_stats() + stats = cov._collector.tracers[0].get_stats() if stats: stats = stats.copy() cov.stop() diff --git a/perf/solve_poly.py b/perf/solve_poly.py index 41365f48..66231725 100644 --- a/perf/solve_poly.py +++ b/perf/solve_poly.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Given empirical data from perf_measure.py, calculate the coefficients of the # polynomials for file, call, and line operation counts. @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # lint Python modules using external checkers. # @@ -327,13 +327,3 @@ ignore-comments=yes # Ignore docstrings when computing similarities. ignore-docstrings=yes - -# -# SPELLING -# - -spelling-dict=en_US -# pylint doesn't strip the words, so insert a dummy x at the beginning to make -# the other words work properly. -# https://bitbucket.org/logilab/pylint/issue/398/spelling-words-need-to-be-stripped-or-the -spelling-private-dict-file=doc/dict.txt diff --git a/requirements/ci.pip b/requirements/ci.pip index 12e9c698..cb94d737 100644 --- a/requirements/ci.pip +++ b/requirements/ci.pip @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Things CI servers need to succeeed. -r tox.pip diff --git a/requirements/dev.pip b/requirements/dev.pip index 183d051f..965c5f48 100644 --- a/requirements/dev.pip +++ b/requirements/dev.pip @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Requirements for doing local development work on coverage.py. # https://requires.io/github/nedbat/coveragepy/requirements/ @@ -11,11 +11,12 @@ # for linting. greenlet==0.4.13 mock==2.0.0 -PyContracts==1.8.2 -pyenchant==2.0.0 -pylint==1.8.2 +PyContracts==1.8.3 +pylint==1.9.2 unittest-mixins==1.4 +check-manifest==0.37 +readme_renderer==21.0 # for kitting. -requests==2.18.4 -twine==1.9.1 +requests==2.19.1 +twine==1.11.0 diff --git a/requirements/pytest.pip b/requirements/pytest.pip index 17ccc0d8..6b2433ad 100644 --- a/requirements/pytest.pip +++ b/requirements/pytest.pip @@ -1,9 +1,8 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # The pytest specifics used by coverage.py -# Keep pytest at 3.2.x until we are done with Python 2.6 and 3.3 -pytest==3.2.5 -pytest-xdist==1.20.1 +pytest==3.6.2 +pytest-xdist==1.22.2 flaky==3.4.0 diff --git a/requirements/tox.pip b/requirements/tox.pip index b57aa388..a209ac7f 100644 --- a/requirements/tox.pip +++ b/requirements/tox.pip @@ -1,4 +1,4 @@ # The version of tox used by coverage.py -tox==2.9.1 +tox==3.0.0 # Adds env recreation on requirements file changes. -tox-battery==0.5 +tox-battery==0.5.1 diff --git a/requirements/wheel.pip b/requirements/wheel.pip index 6dfe70b2..9c6bf0ca 100644 --- a/requirements/wheel.pip +++ b/requirements/wheel.pip @@ -1,4 +1,3 @@ # Things needed to make wheels for coverage.py -setuptools==35.0.2 -# We need to stick with 0.29.0 until we drop 2.6 and 3.3 -wheel==0.29.0 +setuptools==39.2.0 +wheel==0.31.1 @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Code coverage measurement for Python""" @@ -24,10 +24,8 @@ License :: OSI Approved :: Apache Software License Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 2 -Programming Language :: Python :: 2.6 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 -Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 @@ -105,9 +103,9 @@ setup_args = dict( keywords='code coverage testing', license='Apache 2.0', classifiers=classifier_list, - url="https://bitbucket.org/ned/coveragepy", + url="https://github.com/nedbat/coveragepy", - python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", ) # A replacement for the build_ext command which raises a single exception diff --git a/tests/__init__.py b/tests/__init__.py index 1ff1e1be..38f2ff8b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,4 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Automated tests. Run with pytest.""" diff --git a/tests/backtest.py b/tests/backtest.py index 827e891f..979f6755 100644 --- a/tests/backtest.py +++ b/tests/backtest.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Add things to old Pythons so I can pretend they are newer, for tests.""" diff --git a/tests/conftest.py b/tests/conftest.py index a0c21a84..aeccec88 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """ Pytest auto configuration. @@ -10,9 +10,25 @@ This module is run automatically by pytest, to define and enable fixtures. import pytest import warnings +from coverage import env + @pytest.fixture(autouse=True) def set_warnings(): """Enable DeprecationWarnings during all tests.""" warnings.simplefilter("default") warnings.simplefilter("once", DeprecationWarning) + + # A warning to suppress: + # setuptools/py33compat.py:54: DeprecationWarning: The value of convert_charrefs will become + # True in 3.5. You are encouraged to set the value explicitly. + # unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape) + warnings.filterwarnings( + "ignore", + category=DeprecationWarning, + message="The value of convert_charrefs will become True in 3.5.", + ) + if env.PYPY and env.PY3: + # pypy3 warns about unclosed files a lot. + # pylint: disable=undefined-variable + warnings.filterwarnings("ignore", r".*unclosed file", category=ResourceWarning) diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 29d634c4..8e3fa05d 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Base test case class for coverage.py testing.""" diff --git a/tests/covmodzip1.py b/tests/covmodzip1.py index cab64281..0133ed6a 100644 --- a/tests/covmodzip1.py +++ b/tests/covmodzip1.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Module-level docstrings are counted differently in different versions of Python, # so don't add one here. diff --git a/tests/eggsrc/egg1/egg1.py b/tests/eggsrc/egg1/egg1.py index 72600808..939386e3 100644 --- a/tests/eggsrc/egg1/egg1.py +++ b/tests/eggsrc/egg1/egg1.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # My egg file! diff --git a/tests/eggsrc/setup.py b/tests/eggsrc/setup.py index c935798d..26a0b650 100644 --- a/tests/eggsrc/setup.py +++ b/tests/eggsrc/setup.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt from setuptools import setup diff --git a/tests/farm/annotate/annotate_dir.py b/tests/farm/annotate/annotate_dir.py index 3bb2dbe7..9bf1b768 100644 --- a/tests/farm/annotate/annotate_dir.py +++ b/tests/farm/annotate/annotate_dir.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt copy("src", "run") run(""" diff --git a/tests/farm/annotate/gold/white.py,cover b/tests/farm/annotate/gold/white.py,cover index fc163226..b190ffdb 100644 --- a/tests/farm/annotate/gold/white.py,cover +++ b/tests/farm/annotate/gold/white.py,cover @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A test case sent to me by Steve White diff --git a/tests/farm/annotate/gold_anno_dir/a_a.py,cover b/tests/farm/annotate/gold_anno_dir/a_a.py,cover index 4729cfbb..0bd0f4a5 100644 --- a/tests/farm/annotate/gold_anno_dir/a_a.py,cover +++ b/tests/farm/annotate/gold_anno_dir/a_a.py,cover @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt > def a(x): > if x == 1: diff --git a/tests/farm/annotate/gold_anno_dir/b_b.py,cover b/tests/farm/annotate/gold_anno_dir/b_b.py,cover index 228715f0..49f723ac 100644 --- a/tests/farm/annotate/gold_anno_dir/b_b.py,cover +++ b/tests/farm/annotate/gold_anno_dir/b_b.py,cover @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt > def b(x): > msg = "x is %s" % x diff --git a/tests/farm/annotate/gold_anno_dir/multi.py,cover b/tests/farm/annotate/gold_anno_dir/multi.py,cover index 90a13c91..980f4793 100644 --- a/tests/farm/annotate/gold_anno_dir/multi.py,cover +++ b/tests/farm/annotate/gold_anno_dir/multi.py,cover @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt > import a.a > import b.b diff --git a/tests/farm/annotate/gold_encodings/utf8.py,cover b/tests/farm/annotate/gold_encodings/utf8.py,cover index 3ef31e0f..0bd26415 100644 --- a/tests/farm/annotate/gold_encodings/utf8.py,cover +++ b/tests/farm/annotate/gold_encodings/utf8.py,cover @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # This comment has an accent: é diff --git a/tests/farm/annotate/gold_multi/a/a.py,cover b/tests/farm/annotate/gold_multi/a/a.py,cover index e5e97226..95f0d8c5 100644 --- a/tests/farm/annotate/gold_multi/a/a.py,cover +++ b/tests/farm/annotate/gold_multi/a/a.py,cover @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt > def a(x): > if x == 1: diff --git a/tests/farm/annotate/gold_multi/b/b.py,cover b/tests/farm/annotate/gold_multi/b/b.py,cover index 26b25548..18240bf0 100644 --- a/tests/farm/annotate/gold_multi/b/b.py,cover +++ b/tests/farm/annotate/gold_multi/b/b.py,cover @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt > def b(x): > print "x is %s" % x diff --git a/tests/farm/annotate/gold_multi/multi.py,cover b/tests/farm/annotate/gold_multi/multi.py,cover index 90a13c91..980f4793 100644 --- a/tests/farm/annotate/gold_multi/multi.py,cover +++ b/tests/farm/annotate/gold_multi/multi.py,cover @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 - # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt > import a.a > import b.b diff --git a/tests/farm/annotate/run.py b/tests/farm/annotate/run.py index 33e5f671..6c98a770 100644 --- a/tests/farm/annotate/run.py +++ b/tests/farm/annotate/run.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt copy("src", "out") run(""" diff --git a/tests/farm/annotate/run_encodings.py b/tests/farm/annotate/run_encodings.py index 46d8c643..8fd98fea 100644 --- a/tests/farm/annotate/run_encodings.py +++ b/tests/farm/annotate/run_encodings.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt copy("src", "out_encodings") run(""" diff --git a/tests/farm/annotate/run_multi.py b/tests/farm/annotate/run_multi.py index 4646293e..d3c4cf7c 100644 --- a/tests/farm/annotate/run_multi.py +++ b/tests/farm/annotate/run_multi.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt copy("src", "out_multi") run(""" diff --git a/tests/farm/annotate/src/a/a.py b/tests/farm/annotate/src/a/a.py index e3e6631d..411d3d8e 100644 --- a/tests/farm/annotate/src/a/a.py +++ b/tests/farm/annotate/src/a/a.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt def a(x): if x == 1: diff --git a/tests/farm/annotate/src/b/b.py b/tests/farm/annotate/src/b/b.py index b31d8c95..f0055b3b 100644 --- a/tests/farm/annotate/src/b/b.py +++ b/tests/farm/annotate/src/b/b.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt def b(x): msg = "x is %s" % x diff --git a/tests/farm/annotate/src/multi.py b/tests/farm/annotate/src/multi.py index bf8cfd5f..31155b40 100644 --- a/tests/farm/annotate/src/multi.py +++ b/tests/farm/annotate/src/multi.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt import a.a import b.b diff --git a/tests/farm/annotate/src/utf8.py b/tests/farm/annotate/src/utf8.py index fd43b2ab..f3988379 100644 --- a/tests/farm/annotate/src/utf8.py +++ b/tests/farm/annotate/src/utf8.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # This comment has an accent: é diff --git a/tests/farm/annotate/src/white.py b/tests/farm/annotate/src/white.py index 21e8a627..56608324 100644 --- a/tests/farm/annotate/src/white.py +++ b/tests/farm/annotate/src/white.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A test case sent to me by Steve White diff --git a/tests/farm/html/gold_a/a_py.html b/tests/farm/html/gold_a/a_py.html index 00ab529d..52c09526 100644 --- a/tests/farm/html/gold_a/a_py.html +++ b/tests/farm/html/gold_a/a_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for a.py: 67%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>a.py</b> : <span class="pc_cov">67%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 3 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">1 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -77,33 +64,29 @@ <p id="n8" class="stm run hide_run"><a href="#n8">8</a></p> <p id="n9" class="pln"><a href="#n9">9</a></p> <p id="n10" class="stm mis"><a href="#n10">10</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="pln"><span class="com"># A test file for HTML reporting by coverage.py.</span><span class="strut"> </span></p> <p id="t5" class="pln"><span class="strut"> </span></p> <p id="t6" class="stm run hide_run"><span class="key">if</span> <span class="num">1</span> <span class="op"><</span> <span class="num">2</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t7" class="pln"> <span class="com"># Needed a < to look at HTML entities.</span><span class="strut"> </span></p> -<p id="t8" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> +<p id="t7" class="pln"> <span class="com"># Needed a < to look at HTML entities.</span><span class="strut"> </span></p> +<p id="t8" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> <p id="t9" class="pln"><span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t10" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> - +<p id="t10" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:45 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_a/index.html b/tests/farm/html/gold_a/index.html index 35507b6f..e52d49b4 100644 --- a/tests/farm/html/gold_a/index.html +++ b/tests/farm/html/gold_a/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">67%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,63 +34,51 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>3</td> <td>1</td> <td>0</td> - <td class="right" data-ratio="2 3">67%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="a_py.html">a.py</a></td> <td>3</td> <td>1</td> <td>0</td> - <td class="right" data-ratio="2 3">67%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:45 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_b_branch/b_py.html b/tests/farm/html/gold_b_branch/b_py.html index 4a876500..6c3f75a8 100644 --- a/tests/farm/html/gold_b_branch/b_py.html +++ b/tests/farm/html/gold_b_branch/b_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for b.py: 70%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,51 +14,43 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>b.py</b> : <span class="pc_cov">70%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 17 statements <span class="run hide_run shortkey_r button_toggle_run">14 run</span> <span class="mis shortkey_m button_toggle_mis">3 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - <span class="par run hide_run shortkey_p button_toggle_par">4 partial</span> - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -101,55 +87,51 @@ <p id="n30" class="stm run hide_run"><a href="#n30">30</a></p> <p id="n31" class="pln"><a href="#n31">31</a></p> <p id="n32" class="stm run hide_run"><a href="#n32">32</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="pln"><span class="com"># A test file for HTML reporting by coverage.py.</span><span class="strut"> </span></p> <p id="t5" class="pln"><span class="strut"> </span></p> <p id="t6" class="stm run hide_run"><span class="key">def</span> <span class="nam">one</span><span class="op">(</span><span class="nam">x</span><span class="op">)</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t7" class="pln"> <span class="com"># This will be a branch that misses the else.</span><span class="strut"> </span></p> -<p id="t8" class="stm par run hide_run"><span class="annotate" title="no jump to this line number">11</span> <span class="key">if</span> <span class="nam">x</span> <span class="op"><</span> <span class="num">2</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t9" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> -<p id="t10" class="pln"> <span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t11" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> +<p id="t7" class="pln"> <span class="com"># This will be a branch that misses the else.</span><span class="strut"> </span></p> +<p id="t8" class="stm par run hide_run"><span class="annotate short">8 ↛ 11</span><span class="annotate long">line 8 didn't jump to line 11, because the condition on line 8 was never false</span> <span class="key">if</span> <span class="nam">x</span> <span class="op"><</span> <span class="num">2</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t9" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> +<p id="t10" class="pln"> <span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t11" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> <p id="t12" class="pln"><span class="strut"> </span></p> <p id="t13" class="stm run hide_run"><span class="nam">one</span><span class="op">(</span><span class="num">1</span><span class="op">)</span><span class="strut"> </span></p> <p id="t14" class="pln"><span class="strut"> </span></p> <p id="t15" class="stm run hide_run"><span class="key">def</span> <span class="nam">two</span><span class="op">(</span><span class="nam">x</span><span class="op">)</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t16" class="pln"> <span class="com"># A missed else that branches to "exit"</span><span class="strut"> </span></p> -<p id="t17" class="stm par run hide_run"><span class="annotate" title="no jump to this line number">exit</span> <span class="key">if</span> <span class="nam">x</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t18" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">5</span><span class="strut"> </span></p> +<p id="t16" class="pln"> <span class="com"># A missed else that branches to "exit"</span><span class="strut"> </span></p> +<p id="t17" class="stm par run hide_run"><span class="annotate short">17 ↛ exit</span><span class="annotate long">line 17 didn't return from function 'two', because the condition on line 17 was never false</span> <span class="key">if</span> <span class="nam">x</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t18" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">5</span><span class="strut"> </span></p> <p id="t19" class="pln"><span class="strut"> </span></p> <p id="t20" class="stm run hide_run"><span class="nam">two</span><span class="op">(</span><span class="num">1</span><span class="op">)</span><span class="strut"> </span></p> <p id="t21" class="pln"><span class="strut"> </span></p> <p id="t22" class="stm run hide_run"><span class="key">def</span> <span class="nam">three</span><span class="op">(</span><span class="op">)</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t23" class="stm run hide_run"> <span class="key">try</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t24" class="pln"> <span class="com"># This if has two branches, *neither* one taken.</span><span class="strut"> </span></p> -<p id="t25" class="stm par run hide_run"><span class="annotate" title="no jumps to these line numbers">26 28</span> <span class="key">if</span> <span class="nam">name_error_this_variable_doesnt_exist</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t26" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> -<p id="t27" class="pln"> <span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t28" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> -<p id="t29" class="stm run hide_run"> <span class="key">except</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t30" class="stm run hide_run"> <span class="key">pass</span><span class="strut"> </span></p> +<p id="t23" class="stm run hide_run"> <span class="key">try</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t24" class="pln"> <span class="com"># This if has two branches, *neither* one taken.</span><span class="strut"> </span></p> +<p id="t25" class="stm par run hide_run"><span class="annotate short">25 ↛ 26, 25 ↛ 28</span><span class="annotate long">2 missed branches: 1) line 25 didn't jump to line 26, because the condition on line 25 was never true, 2) line 25 didn't jump to line 28, because the condition on line 25 was never false</span> <span class="key">if</span> <span class="nam">name_error_this_variable_doesnt_exist</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t26" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> +<p id="t27" class="pln"> <span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t28" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> +<p id="t29" class="stm run hide_run"> <span class="key">except</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t30" class="stm run hide_run"> <span class="key">pass</span><span class="strut"> </span></p> <p id="t31" class="pln"><span class="strut"> </span></p> <p id="t32" class="stm run hide_run"><span class="nam">three</span><span class="op">(</span><span class="op">)</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:40 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_b_branch/index.html b/tests/farm/html/gold_b_branch/index.html index ebc3a106..844f79e1 100644 --- a/tests/farm/html/gold_b_branch/index.html +++ b/tests/farm/html/gold_b_branch/index.html @@ -4,9 +4,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -15,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">70%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -39,74 +34,59 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">b</span> <span class="key">p</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="shortkey_b">branches</th> <th class="shortkey_p">partial</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>17</td> <td>3</td> <td>0</td> - <td>6</td> <td>4</td> - <td class="right" data-ratio="16 23">70%</td> </tr> </tfoot> <tbody> - <tr class="file"> - <td class="name left"><a href="b.html">b</a></td> + <td class="name left"><a href="b_py.html">b.py</a></td> <td>17</td> <td>3</td> <td>0</td> - <td>6</td> <td>4</td> - <td class="right" data-ratio="16 23">70%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="http://nedbatchelder.com/code/coverage/4.0a1">coverage.py v4.0a1</a> + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:40 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_bom/2/bom_py.html b/tests/farm/html/gold_bom/2/bom_py.html new file mode 100644 index 00000000..78c498fd --- /dev/null +++ b/tests/farm/html/gold_bom/2/bom_py.html @@ -0,0 +1,100 @@ +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> + <title>Coverage for bom.py: 71%</title> + <link rel="stylesheet" href="style.css" type="text/css"> + <script type="text/javascript" src="jquery.min.js"></script> + <script type="text/javascript" src="jquery.hotkeys.js"></script> + <script type="text/javascript" src="jquery.isonscreen.js"></script> + <script type="text/javascript" src="coverage_html.js"></script> + <script type="text/javascript"> + jQuery(document).ready(coverage.pyfile_ready); + </script> +</head> +<body class="pyfile"> +<div id="header"> + <div class="content"> + <h1>Coverage for <b>bom.py</b> : + <span class="pc_cov">71%</span> + </h1> + <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> + <h2 class="stats"> + 7 statements + <span class="run hide_run shortkey_r button_toggle_run">5 run</span> + <span class="mis shortkey_m button_toggle_mis">2 missing</span> + <span class="exc shortkey_x button_toggle_exc">0 excluded</span> + </h2> + </div> +</div> +<div class="help_panel"> + <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> + <p class="legend">Hot-keys on this page</p> + <div> + <p class="keyhelp"> + <span class="key">r</span> + <span class="key">m</span> + <span class="key">x</span> + <span class="key">p</span> toggle line displays + </p> + <p class="keyhelp"> + <span class="key">j</span> + <span class="key">k</span> next/prev highlighted chunk + </p> + <p class="keyhelp"> + <span class="key">0</span> (zero) top of page + </p> + <p class="keyhelp"> + <span class="key">1</span> (one) first highlighted chunk + </p> + </div> +</div> +<div id="source"> + <table> + <tr> + <td class="linenos"> +<p id="n1" class="pln"><a href="#n1">1</a></p> +<p id="n2" class="pln"><a href="#n2">2</a></p> +<p id="n3" class="pln"><a href="#n3">3</a></p> +<p id="n4" class="pln"><a href="#n4">4</a></p> +<p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> +<p id="n6" class="pln"><a href="#n6">6</a></p> +<p id="n7" class="stm run hide_run"><a href="#n7">7</a></p> +<p id="n8" class="pln"><a href="#n8">8</a></p> +<p id="n9" class="stm run hide_run"><a href="#n9">9</a></p> +<p id="n10" class="stm mis"><a href="#n10">10</a></p> +<p id="n11" class="stm mis"><a href="#n11">11</a></p> +<p id="n12" class="pln"><a href="#n12">12</a></p> +<p id="n13" class="stm run hide_run"><a href="#n13">13</a></p> +<p id="n14" class="stm run hide_run"><a href="#n14">14</a></p> + </td> + <td class="text"> +<p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t3" class="pln"><span class="strut"> </span></p> +<p id="t4" class="pln"><span class="com"># A Python source file in utf-8, with BOM.</span><span class="strut"> </span></p> +<p id="t5" class="stm run hide_run"><span class="nam">math</span> <span class="op">=</span> <span class="str">"3×4 = 12, ÷2 = 6±0"</span><span class="strut"> </span></p> +<p id="t6" class="pln"><span class="strut"> </span></p> +<p id="t7" class="stm run hide_run"><span class="key">import</span> <span class="nam">sys</span><span class="strut"> </span></p> +<p id="t8" class="pln"><span class="strut"> </span></p> +<p id="t9" class="stm run hide_run"><span class="key">if</span> <span class="nam">sys</span><span class="op">.</span><span class="nam">version_info</span> <span class="op">>=</span> <span class="op">(</span><span class="num">3</span><span class="op">,</span> <span class="num">0</span><span class="op">)</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t10" class="stm mis"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">)</span> <span class="op">==</span> <span class="num">18</span><span class="strut"> </span></p> +<p id="t11" class="stm mis"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">.</span><span class="nam">encode</span><span class="op">(</span><span class="str">'utf-8'</span><span class="op">)</span><span class="op">)</span> <span class="op">==</span> <span class="num">21</span><span class="strut"> </span></p> +<p id="t12" class="pln"><span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t13" class="stm run hide_run"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">)</span> <span class="op">==</span> <span class="num">21</span><span class="strut"> </span></p> +<p id="t14" class="stm run hide_run"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">.</span><span class="nam">decode</span><span class="op">(</span><span class="str">'utf-8'</span><span class="op">)</span><span class="op">)</span> <span class="op">==</span> <span class="num">18</span><span class="strut"> </span></p> + </td> + </tr> + </table> +</div> +<div id="footer"> + <div class="content"> + <p> + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:46 + </p> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_bom/2/index.html b/tests/farm/html/gold_bom/2/index.html new file mode 100644 index 00000000..2d285ab1 --- /dev/null +++ b/tests/farm/html/gold_bom/2/index.html @@ -0,0 +1,84 @@ +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Coverage report</title> + <link rel="stylesheet" href="style.css" type="text/css"> + <script type="text/javascript" src="jquery.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> + <script type="text/javascript" src="jquery.tablesorter.min.js"></script> + <script type="text/javascript" src="jquery.hotkeys.js"></script> + <script type="text/javascript" src="coverage_html.js"></script> + <script type="text/javascript"> + jQuery(document).ready(coverage.index_ready); + </script> +</head> +<body class="indexfile"> +<div id="header"> + <div class="content"> + <h1>Coverage report: + <span class="pc_cov">71%</span> + </h1> + <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> + <form id="filter_container"> + <input id="filter" type="text" value="" placeholder="filter..." /> + </form> + </div> +</div> +<div class="help_panel"> + <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> + <p class="legend">Hot-keys on this page</p> + <div> + <p class="keyhelp"> + <span class="key">n</span> + <span class="key">s</span> + <span class="key">m</span> + <span class="key">x</span> + <span class="key">c</span> change column sorting + </p> + </div> +</div> +<div id="index"> + <table class="index"> + <thead> + <tr class="tablehead" title="Click to sort"> + <th class="name left headerSortDown shortkey_n">Module</th> + <th class="shortkey_s">statements</th> + <th class="shortkey_m">missing</th> + <th class="shortkey_x">excluded</th> + <th class="right shortkey_c">coverage</th> + </tr> + </thead> + <tfoot> + <tr class="total"> + <td class="name left">Total</td> + <td>7</td> + <td>2</td> + <td>0</td> + <td class="right" data-ratio="5 7">71%</td> + </tr> + </tfoot> + <tbody> + <tr class="file"> + <td class="name left"><a href="bom_py.html">bom.py</a></td> + <td>7</td> + <td>2</td> + <td>0</td> + <td class="right" data-ratio="5 7">71%</td> + </tr> + </tbody> + </table> + <p id="no_rows"> + No items found using the specified filter. + </p> +</div> +<div id="footer"> + <div class="content"> + <p> + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:46 + </p> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_bom/bom_py.html b/tests/farm/html/gold_bom/bom_py.html index 127f2f45..472f655b 100644 --- a/tests/farm/html/gold_bom/bom_py.html +++ b/tests/farm/html/gold_bom/bom_py.html @@ -2,12 +2,9 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> - <title>Coverage for bom: 71%</title> + <title>Coverage for bom.py: 71%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -17,91 +14,87 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> - <h1>Coverage for <b>bom</b> : + <h1>Coverage for <b>bom.py</b> : <span class="pc_cov">71%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 7 statements <span class="run hide_run shortkey_r button_toggle_run">5 run</span> <span class="mis shortkey_m button_toggle_mis">2 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> <td class="linenos"> <p id="n1" class="pln"><a href="#n1">1</a></p> -<p id="n2" class="stm run hide_run"><a href="#n2">2</a></p> +<p id="n2" class="pln"><a href="#n2">2</a></p> <p id="n3" class="pln"><a href="#n3">3</a></p> -<p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> -<p id="n5" class="pln"><a href="#n5">5</a></p> -<p id="n6" class="stm run hide_run"><a href="#n6">6</a></p> -<p id="n7" class="stm mis"><a href="#n7">7</a></p> -<p id="n8" class="stm mis"><a href="#n8">8</a></p> -<p id="n9" class="pln"><a href="#n9">9</a></p> +<p id="n4" class="pln"><a href="#n4">4</a></p> +<p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> +<p id="n6" class="pln"><a href="#n6">6</a></p> +<p id="n7" class="stm run hide_run"><a href="#n7">7</a></p> +<p id="n8" class="pln"><a href="#n8">8</a></p> +<p id="n9" class="stm run hide_run"><a href="#n9">9</a></p> <p id="n10" class="stm run hide_run"><a href="#n10">10</a></p> <p id="n11" class="stm run hide_run"><a href="#n11">11</a></p> - +<p id="n12" class="pln"><a href="#n12">12</a></p> +<p id="n13" class="stm mis"><a href="#n13">13</a></p> +<p id="n14" class="stm mis"><a href="#n14">14</a></p> </td> <td class="text"> -<p id="t1" class="pln"><span class="err">�</span><span class="err">�</span><span class="err">�</span><span class="com"># A python source file in utf-8, with BOM</span><span class="strut"> </span></p> -<p id="t2" class="stm run hide_run"><span class="nam">math</span> <span class="op">=</span> <span class="str">"3×4 = 12, ÷2 = 6±0"</span><span class="strut"> </span></p> +<p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> -<p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">sys</span><span class="strut"> </span></p> -<p id="t5" class="pln"><span class="strut"> </span></p> -<p id="t6" class="stm run hide_run"><span class="key">if</span> <span class="nam">sys</span><span class="op">.</span><span class="nam">version_info</span> <span class="op">>=</span> <span class="op">(</span><span class="num">3</span><span class="op">,</span> <span class="num">0</span><span class="op">)</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t7" class="stm mis"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">)</span> <span class="op">==</span> <span class="num">18</span><span class="strut"> </span></p> -<p id="t8" class="stm mis"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">.</span><span class="nam">encode</span><span class="op">(</span><span class="str">'utf-8'</span><span class="op">)</span><span class="op">)</span> <span class="op">==</span> <span class="num">21</span><span class="strut"> </span></p> -<p id="t9" class="pln"><span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t10" class="stm run hide_run"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">)</span> <span class="op">==</span> <span class="num">21</span><span class="strut"> </span></p> -<p id="t11" class="stm run hide_run"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">.</span><span class="nam">decode</span><span class="op">(</span><span class="str">'utf-8'</span><span class="op">)</span><span class="op">)</span> <span class="op">==</span> <span class="num">18</span><span class="strut"> </span></p> - +<p id="t4" class="pln"><span class="com"># A Python source file in utf-8, with BOM.</span><span class="strut"> </span></p> +<p id="t5" class="stm run hide_run"><span class="nam">math</span> <span class="op">=</span> <span class="str">"3×4 = 12, ÷2 = 6±0"</span><span class="strut"> </span></p> +<p id="t6" class="pln"><span class="strut"> </span></p> +<p id="t7" class="stm run hide_run"><span class="key">import</span> <span class="nam">sys</span><span class="strut"> </span></p> +<p id="t8" class="pln"><span class="strut"> </span></p> +<p id="t9" class="stm run hide_run"><span class="key">if</span> <span class="nam">sys</span><span class="op">.</span><span class="nam">version_info</span> <span class="op">>=</span> <span class="op">(</span><span class="num">3</span><span class="op">,</span> <span class="num">0</span><span class="op">)</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t10" class="stm run hide_run"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">)</span> <span class="op">==</span> <span class="num">18</span><span class="strut"> </span></p> +<p id="t11" class="stm run hide_run"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">.</span><span class="nam">encode</span><span class="op">(</span><span class="str">'utf-8'</span><span class="op">)</span><span class="op">)</span> <span class="op">==</span> <span class="num">21</span><span class="strut"> </span></p> +<p id="t12" class="pln"><span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t13" class="stm mis"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">)</span> <span class="op">==</span> <span class="num">21</span><span class="strut"> </span></p> +<p id="t14" class="stm mis"> <span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">.</span><span class="nam">decode</span><span class="op">(</span><span class="str">'utf-8'</span><span class="op">)</span><span class="op">)</span> <span class="op">==</span> <span class="num">18</span><span class="strut"> </span></p> </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="http://nedbatchelder.com/code/coverage/4.0a1">coverage.py v4.0a1</a> + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:44 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_bom/index.html b/tests/farm/html/gold_bom/index.html index 77696727..0341c0d0 100644 --- a/tests/farm/html/gold_bom/index.html +++ b/tests/farm/html/gold_bom/index.html @@ -4,9 +4,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -15,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">71%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -39,62 +34,51 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>7</td> <td>2</td> <td>0</td> - <td class="right" data-ratio="5 7">71%</td> </tr> </tfoot> <tbody> - <tr class="file"> - <td class="name left"><a href="bom.html">bom</a></td> + <td class="name left"><a href="bom_py.html">bom.py</a></td> <td>7</td> <td>2</td> <td>0</td> - <td class="right" data-ratio="5 7">71%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="http://nedbatchelder.com/code/coverage/4.0a1">coverage.py v4.0a1</a> + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:44 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_isolatin1/index.html b/tests/farm/html/gold_isolatin1/index.html index ee49cc5e..ec125364 100644 --- a/tests/farm/html/gold_isolatin1/index.html +++ b/tests/farm/html/gold_isolatin1/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,63 +34,51 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="isolatin1_py.html">isolatin1.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:40 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_isolatin1/isolatin1_py.html b/tests/farm/html/gold_isolatin1/isolatin1_py.html index bad0d78d..45d13f42 100644 --- a/tests/farm/html/gold_isolatin1/isolatin1_py.html +++ b/tests/farm/html/gold_isolatin1/isolatin1_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for isolatin1.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>isolatin1.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -75,31 +62,27 @@ <p id="n6" class="pln"><a href="#n6">6</a></p> <p id="n7" class="stm run hide_run"><a href="#n7">7</a></p> <p id="n8" class="stm run hide_run"><a href="#n8">8</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># -*- coding: iso8859-1 -*-</span><span class="strut"> </span></p> <p id="t2" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t3" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t3" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t4" class="pln"><span class="strut"> </span></p> <p id="t5" class="pln"><span class="com"># A Python source file in another encoding.</span><span class="strut"> </span></p> <p id="t6" class="pln"><span class="strut"> </span></p> -<p id="t7" class="stm run hide_run"><span class="nam">math</span> <span class="op">=</span> <span class="str">"3×4 = 12, ÷2 = 6±0"</span><span class="strut"> </span></p> +<p id="t7" class="stm run hide_run"><span class="nam">math</span> <span class="op">=</span> <span class="str">"3×4 = 12, ÷2 = 6±0"</span><span class="strut"> </span></p> <p id="t8" class="stm run hide_run"><span class="key">assert</span> <span class="nam">len</span><span class="op">(</span><span class="nam">math</span><span class="op">)</span> <span class="op">==</span> <span class="num">18</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:40 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_1/index.html b/tests/farm/html/gold_omit_1/index.html index 404d6b6a..9ea591a4 100644 --- a/tests/farm/html/gold_omit_1/index.html +++ b/tests/farm/html/gold_omit_1/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,90 +34,72 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>14</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="14 14">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="m1_py.html">m1.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="m2_py.html">m2.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="m3_py.html">m3.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="main_py.html">main.py</a></td> <td>8</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="8 8">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_1/m1_py.html b/tests/farm/html/gold_omit_1/m1_py.html index 44d73e49..1557156c 100644 --- a/tests/farm/html/gold_omit_1/m1_py.html +++ b/tests/farm/html/gold_omit_1/m1_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m1.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m1.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m1a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m1b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_1/m2_py.html b/tests/farm/html/gold_omit_1/m2_py.html index ff75cbe9..8f3102d1 100644 --- a/tests/farm/html/gold_omit_1/m2_py.html +++ b/tests/farm/html/gold_omit_1/m2_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m2.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m2.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m2a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m2b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_1/m3_py.html b/tests/farm/html/gold_omit_1/m3_py.html index 4cdcc088..2d1e1d4c 100644 --- a/tests/farm/html/gold_omit_1/m3_py.html +++ b/tests/farm/html/gold_omit_1/m3_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m3.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m3.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m3a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m3b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_1/main_py.html b/tests/farm/html/gold_omit_1/main_py.html index d33dfedc..bc93b1a0 100644 --- a/tests/farm/html/gold_omit_1/main_py.html +++ b/tests/farm/html/gold_omit_1/main_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for main.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>main.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 8 statements <span class="run hide_run shortkey_r button_toggle_run">8 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -80,11 +67,10 @@ <p id="n11" class="stm run hide_run"><a href="#n11">11</a></p> <p id="n12" class="stm run hide_run"><a href="#n12">12</a></p> <p id="n13" class="stm run hide_run"><a href="#n13">13</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">m1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="key">import</span> <span class="nam">m2</span><span class="strut"> </span></p> @@ -96,20 +82,17 @@ <p id="t11" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m1</span><span class="op">.</span><span class="nam">m1a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t12" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m2</span><span class="op">.</span><span class="nam">m2a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t13" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m3</span><span class="op">.</span><span class="nam">m3a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_2/index.html b/tests/farm/html/gold_omit_2/index.html index 01c13e31..8c2576f2 100644 --- a/tests/farm/html/gold_omit_2/index.html +++ b/tests/farm/html/gold_omit_2/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,81 +34,65 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>12</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="12 12">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="m2_py.html">m2.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="m3_py.html">m3.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="main_py.html">main.py</a></td> <td>8</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="8 8">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_2/m2_py.html b/tests/farm/html/gold_omit_2/m2_py.html index ff75cbe9..8f3102d1 100644 --- a/tests/farm/html/gold_omit_2/m2_py.html +++ b/tests/farm/html/gold_omit_2/m2_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m2.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m2.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m2a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m2b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_2/m3_py.html b/tests/farm/html/gold_omit_2/m3_py.html index 4cdcc088..2d1e1d4c 100644 --- a/tests/farm/html/gold_omit_2/m3_py.html +++ b/tests/farm/html/gold_omit_2/m3_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m3.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m3.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m3a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m3b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_2/main_py.html b/tests/farm/html/gold_omit_2/main_py.html index d33dfedc..bc93b1a0 100644 --- a/tests/farm/html/gold_omit_2/main_py.html +++ b/tests/farm/html/gold_omit_2/main_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for main.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>main.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 8 statements <span class="run hide_run shortkey_r button_toggle_run">8 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -80,11 +67,10 @@ <p id="n11" class="stm run hide_run"><a href="#n11">11</a></p> <p id="n12" class="stm run hide_run"><a href="#n12">12</a></p> <p id="n13" class="stm run hide_run"><a href="#n13">13</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">m1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="key">import</span> <span class="nam">m2</span><span class="strut"> </span></p> @@ -96,20 +82,17 @@ <p id="t11" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m1</span><span class="op">.</span><span class="nam">m1a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t12" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m2</span><span class="op">.</span><span class="nam">m2a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t13" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m3</span><span class="op">.</span><span class="nam">m3a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_3/index.html b/tests/farm/html/gold_omit_3/index.html index 79192911..f0b32cc4 100644 --- a/tests/farm/html/gold_omit_3/index.html +++ b/tests/farm/html/gold_omit_3/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,72 +34,58 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>10</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="10 10">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="m3_py.html">m3.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="main_py.html">main.py</a></td> <td>8</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="8 8">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_3/m3_py.html b/tests/farm/html/gold_omit_3/m3_py.html index 4cdcc088..2d1e1d4c 100644 --- a/tests/farm/html/gold_omit_3/m3_py.html +++ b/tests/farm/html/gold_omit_3/m3_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m3.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m3.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m3a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m3b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_3/main_py.html b/tests/farm/html/gold_omit_3/main_py.html index d33dfedc..bc93b1a0 100644 --- a/tests/farm/html/gold_omit_3/main_py.html +++ b/tests/farm/html/gold_omit_3/main_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for main.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>main.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 8 statements <span class="run hide_run shortkey_r button_toggle_run">8 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -80,11 +67,10 @@ <p id="n11" class="stm run hide_run"><a href="#n11">11</a></p> <p id="n12" class="stm run hide_run"><a href="#n12">12</a></p> <p id="n13" class="stm run hide_run"><a href="#n13">13</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">m1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="key">import</span> <span class="nam">m2</span><span class="strut"> </span></p> @@ -96,20 +82,17 @@ <p id="t11" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m1</span><span class="op">.</span><span class="nam">m1a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t12" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m2</span><span class="op">.</span><span class="nam">m2a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t13" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m3</span><span class="op">.</span><span class="nam">m3a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_4/index.html b/tests/farm/html/gold_omit_4/index.html index 0e52f497..7dadd229 100644 --- a/tests/farm/html/gold_omit_4/index.html +++ b/tests/farm/html/gold_omit_4/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,81 +34,65 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>12</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="12 12">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="m1_py.html">m1.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="m3_py.html">m3.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="main_py.html">main.py</a></td> <td>8</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="8 8">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_4/m1_py.html b/tests/farm/html/gold_omit_4/m1_py.html index 44d73e49..1557156c 100644 --- a/tests/farm/html/gold_omit_4/m1_py.html +++ b/tests/farm/html/gold_omit_4/m1_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m1.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m1.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m1a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m1b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_4/m3_py.html b/tests/farm/html/gold_omit_4/m3_py.html index 4cdcc088..2d1e1d4c 100644 --- a/tests/farm/html/gold_omit_4/m3_py.html +++ b/tests/farm/html/gold_omit_4/m3_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m3.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m3.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m3a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m3b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_4/main_py.html b/tests/farm/html/gold_omit_4/main_py.html index d33dfedc..bc93b1a0 100644 --- a/tests/farm/html/gold_omit_4/main_py.html +++ b/tests/farm/html/gold_omit_4/main_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for main.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>main.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 8 statements <span class="run hide_run shortkey_r button_toggle_run">8 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -80,11 +67,10 @@ <p id="n11" class="stm run hide_run"><a href="#n11">11</a></p> <p id="n12" class="stm run hide_run"><a href="#n12">12</a></p> <p id="n13" class="stm run hide_run"><a href="#n13">13</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">m1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="key">import</span> <span class="nam">m2</span><span class="strut"> </span></p> @@ -96,20 +82,17 @@ <p id="t11" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m1</span><span class="op">.</span><span class="nam">m1a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t12" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m2</span><span class="op">.</span><span class="nam">m2a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t13" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m3</span><span class="op">.</span><span class="nam">m3a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_5/index.html b/tests/farm/html/gold_omit_5/index.html index 509e7900..b9912d24 100644 --- a/tests/farm/html/gold_omit_5/index.html +++ b/tests/farm/html/gold_omit_5/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,72 +34,58 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>10</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="10 10">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="m1_py.html">m1.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="main_py.html">main.py</a></td> <td>8</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="8 8">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_5/m1_py.html b/tests/farm/html/gold_omit_5/m1_py.html index 44d73e49..1557156c 100644 --- a/tests/farm/html/gold_omit_5/m1_py.html +++ b/tests/farm/html/gold_omit_5/m1_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for m1.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>m1.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -72,28 +59,24 @@ <p id="n3" class="pln"><a href="#n3">3</a></p> <p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> <p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="nam">m1a</span> <span class="op">=</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="nam">m1b</span> <span class="op">=</span> <span class="num">2</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_omit_5/main_py.html b/tests/farm/html/gold_omit_5/main_py.html index d33dfedc..bc93b1a0 100644 --- a/tests/farm/html/gold_omit_5/main_py.html +++ b/tests/farm/html/gold_omit_5/main_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for main.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>main.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 8 statements <span class="run hide_run shortkey_r button_toggle_run">8 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -80,11 +67,10 @@ <p id="n11" class="stm run hide_run"><a href="#n11">11</a></p> <p id="n12" class="stm run hide_run"><a href="#n12">12</a></p> <p id="n13" class="stm run hide_run"><a href="#n13">13</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">m1</span><span class="strut"> </span></p> <p id="t5" class="stm run hide_run"><span class="key">import</span> <span class="nam">m2</span><span class="strut"> </span></p> @@ -96,20 +82,17 @@ <p id="t11" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m1</span><span class="op">.</span><span class="nam">m1a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t12" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m2</span><span class="op">.</span><span class="nam">m2a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> <p id="t13" class="stm run hide_run"><span class="key">assert</span> <span class="nam">m3</span><span class="op">.</span><span class="nam">m3a</span> <span class="op">==</span> <span class="num">1</span><span class="strut"> </span></p> - </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_other/blah_blah_other_py.html b/tests/farm/html/gold_other/blah_blah_other_py.html index 54861c23..4beb2a07 100644 --- a/tests/farm/html/gold_other/blah_blah_other_py.html +++ b/tests/farm/html/gold_other/blah_blah_other_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for /Users/ned/coverage/trunk/tests/farm/html/othersrc/other.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>/Users/ned/coverage/trunk/tests/farm/html/othersrc/other.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 1 statements <span class="run hide_run shortkey_r button_toggle_run">1 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -74,30 +61,26 @@ <p id="n5" class="pln"><a href="#n5">5</a></p> <p id="n6" class="pln"><a href="#n6">6</a></p> <p id="n7" class="stm run hide_run"><a href="#n7">7</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> -<p id="t4" class="pln"><span class="com"># A file in another directory. We're checking that it ends up in the</span><span class="strut"> </span></p> +<p id="t4" class="pln"><span class="com"># A file in another directory. We're checking that it ends up in the</span><span class="strut"> </span></p> <p id="t5" class="pln"><span class="com"># HTML report.</span><span class="strut"> </span></p> <p id="t6" class="pln"><span class="strut"> </span></p> -<p id="t7" class="stm run hide_run"><span class="key">print</span><span class="op">(</span><span class="str">"This is the other src!"</span><span class="op">)</span><span class="strut"> </span></p> - +<p id="t7" class="stm run hide_run"><span class="nam">print</span><span class="op">(</span><span class="str">"This is the other src!"</span><span class="op">)</span><span class="strut"> </span></p> </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_other/here_py.html b/tests/farm/html/gold_other/here_py.html index 82aa70a2..c692a1c4 100644 --- a/tests/farm/html/gold_other/here_py.html +++ b/tests/farm/html/gold_other/here_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for here.py: 75%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>here.py</b> : <span class="pc_cov">75%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 4 statements <span class="run hide_run shortkey_r button_toggle_run">3 run</span> <span class="mis shortkey_m button_toggle_mis">1 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -78,34 +65,30 @@ <p id="n9" class="stm run hide_run"><a href="#n9">9</a></p> <p id="n10" class="pln"><a href="#n10">10</a></p> <p id="n11" class="stm mis"><a href="#n11">11</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="pln"><span class="com"># A test file for HTML reporting by coverage.py.</span><span class="strut"> </span></p> <p id="t5" class="pln"><span class="strut"> </span></p> <p id="t6" class="stm run hide_run"><span class="key">import</span> <span class="nam">other</span><span class="strut"> </span></p> <p id="t7" class="pln"><span class="strut"> </span></p> <p id="t8" class="stm run hide_run"><span class="key">if</span> <span class="num">1</span> <span class="op"><</span> <span class="num">2</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t9" class="stm run hide_run"> <span class="nam">h</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> +<p id="t9" class="stm run hide_run"> <span class="nam">h</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> <p id="t10" class="pln"><span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t11" class="stm mis"> <span class="nam">h</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> - +<p id="t11" class="stm mis"> <span class="nam">h</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_other/index.html b/tests/farm/html/gold_other/index.html index 9a8d72de..27c194cf 100644 --- a/tests/farm/html/gold_other/index.html +++ b/tests/farm/html/gold_other/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">80%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,72 +34,58 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>5</td> <td>1</td> <td>0</td> - <td class="right" data-ratio="4 5">80%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="_Users_ned_coverage_trunk_tests_farm_html_othersrc_other_py.html">/Users/ned/coverage/trunk/tests/farm/html/othersrc/other.py</a></td> <td>1</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="1 1">100%</td> </tr> - <tr class="file"> <td class="name left"><a href="here_py.html">here.py</a></td> <td>4</td> <td>1</td> <td>0</td> - <td class="right" data-ratio="3 4">75%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_partial/index.html b/tests/farm/html/gold_partial/index.html index 40ffcc4c..ca8919d7 100644 --- a/tests/farm/html/gold_partial/index.html +++ b/tests/farm/html/gold_partial/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,75 +34,59 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">b</span> <span class="key">p</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="shortkey_b">branches</th> <th class="shortkey_p">partial</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> - <td>8</td> + <td>9</td> <td>0</td> + <td>1</td> + <td>2</td> <td>0</td> - - <td>4</td> - <td>0</td> - - <td class="right" data-ratio="12 12">100%</td> + <td class="right" data-ratio="11 11">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="partial_py.html">partial.py</a></td> - <td>8</td> - <td>0</td> + <td>9</td> <td>0</td> - - <td>4</td> + <td>1</td> + <td>2</td> <td>0</td> - - <td class="right" data-ratio="12 12">100%</td> + <td class="right" data-ratio="11 11">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_partial/partial_py.html b/tests/farm/html/gold_partial/partial_py.html index 796153f1..7f4ed31a 100644 --- a/tests/farm/html/gold_partial/partial_py.html +++ b/tests/farm/html/gold_partial/partial_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for partial.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,51 +14,43 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>partial.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> - 8 statements - <span class="run hide_run shortkey_r button_toggle_run">8 run</span> + 9 statements + <span class="run hide_run shortkey_r button_toggle_run">9 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> - <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - + <span class="exc shortkey_x button_toggle_exc">1 excluded</span> <span class="par run hide_run shortkey_p button_toggle_par">0 partial</span> - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -90,44 +76,46 @@ <p id="n19" class="pln"><a href="#n19">19</a></p> <p id="n20" class="pln"><a href="#n20">20</a></p> <p id="n21" class="stm run hide_run"><a href="#n21">21</a></p> - +<p id="n22" class="pln"><a href="#n22">22</a></p> +<p id="n23" class="stm run hide_run"><a href="#n23">23</a></p> +<p id="n24" class="exc"><a href="#n24">24</a></p> </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> -<p id="t4" class="pln"><span class="com"># partial branches</span><span class="strut"> </span></p> +<p id="t4" class="pln"><span class="com"># partial branches and excluded lines</span><span class="strut"> </span></p> <p id="t5" class="pln"><span class="strut"> </span></p> -<p id="t6" class="stm run hide_run"><span class="nam">a</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> +<p id="t6" class="stm run hide_run"><span class="nam">a</span> <span class="op">=</span> <span class="num">6</span><span class="strut"> </span></p> <p id="t7" class="pln"><span class="strut"> </span></p> -<p id="t8" class="stm run hide_run"><span class="key">while</span> <span class="nam">True</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t9" class="stm run hide_run"> <span class="key">break</span><span class="strut"> </span></p> +<p id="t8" class="stm run hide_run"><span class="key">while</span> <span class="key">True</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t9" class="stm run hide_run"> <span class="key">break</span><span class="strut"> </span></p> <p id="t10" class="pln"><span class="strut"> </span></p> <p id="t11" class="stm run hide_run"><span class="key">while</span> <span class="num">1</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t12" class="stm run hide_run"> <span class="key">break</span><span class="strut"> </span></p> +<p id="t12" class="stm run hide_run"> <span class="key">break</span><span class="strut"> </span></p> <p id="t13" class="pln"><span class="strut"> </span></p> -<p id="t14" class="stm run hide_run"><span class="key">while</span> <span class="nam">a</span><span class="op">:</span> <span class="com"># pragma: no branch</span><span class="strut"> </span></p> -<p id="t15" class="stm run hide_run"> <span class="key">break</span><span class="strut"> </span></p> +<p id="t14" class="stm run hide_run"><span class="key">while</span> <span class="nam">a</span><span class="op">:</span> <span class="com"># pragma: no branch</span><span class="strut"> </span></p> +<p id="t15" class="stm run hide_run"> <span class="key">break</span><span class="strut"> </span></p> <p id="t16" class="pln"><span class="strut"> </span></p> <p id="t17" class="pln"><span class="key">if</span> <span class="num">0</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t18" class="pln"> <span class="nam">never_happen</span><span class="op">(</span><span class="op">)</span><span class="strut"> </span></p> +<p id="t18" class="pln"> <span class="nam">never_happen</span><span class="op">(</span><span class="op">)</span><span class="strut"> </span></p> <p id="t19" class="pln"><span class="strut"> </span></p> <p id="t20" class="pln"><span class="key">if</span> <span class="num">1</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t21" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">13</span><span class="strut"> </span></p> - +<p id="t21" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">21</span><span class="strut"> </span></p> +<p id="t22" class="pln"><span class="strut"> </span></p> +<p id="t23" class="stm run hide_run"><span class="key">if</span> <span class="nam">a</span> <span class="op">==</span> <span class="num">23</span><span class="op">:</span><span class="strut"> </span></p> +<p id="t24" class="exc"> <span class="key">raise</span> <span class="nam">AssertionError</span><span class="op">(</span><span class="str">"Can't"</span><span class="op">)</span><span class="strut"> </span></p> </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:43 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_styled/a_py.html b/tests/farm/html/gold_styled/a_py.html index c8221753..6e6f317c 100644 --- a/tests/farm/html/gold_styled/a_py.html +++ b/tests/farm/html/gold_styled/a_py.html @@ -1,18 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for a.py: 67%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <link rel="stylesheet" href="extra.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -22,49 +15,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>a.py</b> : <span class="pc_cov">67%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 3 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">1 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -79,33 +65,29 @@ <p id="n8" class="stm run hide_run"><a href="#n8">8</a></p> <p id="n9" class="pln"><a href="#n9">9</a></p> <p id="n10" class="stm mis"><a href="#n10">10</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t2" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t2" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t3" class="pln"><span class="strut"> </span></p> <p id="t4" class="pln"><span class="com"># A test file for HTML reporting by coverage.py.</span><span class="strut"> </span></p> <p id="t5" class="pln"><span class="strut"> </span></p> <p id="t6" class="stm run hide_run"><span class="key">if</span> <span class="num">1</span> <span class="op"><</span> <span class="num">2</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t7" class="pln"> <span class="com"># Needed a < to look at HTML entities.</span><span class="strut"> </span></p> -<p id="t8" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> +<p id="t7" class="pln"> <span class="com"># Needed a < to look at HTML entities.</span><span class="strut"> </span></p> +<p id="t8" class="stm run hide_run"> <span class="nam">a</span> <span class="op">=</span> <span class="num">3</span><span class="strut"> </span></p> <p id="t9" class="pln"><span class="key">else</span><span class="op">:</span><span class="strut"> </span></p> -<p id="t10" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> - +<p id="t10" class="stm mis"> <span class="nam">a</span> <span class="op">=</span> <span class="num">4</span><span class="strut"> </span></p> </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:42 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_styled/index.html b/tests/farm/html/gold_styled/index.html index 05a8fe21..c0881592 100644 --- a/tests/farm/html/gold_styled/index.html +++ b/tests/farm/html/gold_styled/index.html @@ -1,17 +1,12 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <link rel="stylesheet" href="extra.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -20,21 +15,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">67%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -44,63 +35,51 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>3</td> <td>1</td> <td>0</td> - <td class="right" data-ratio="2 3">67%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="a_py.html">a.py</a></td> <td>3</td> <td>1</td> <td>0</td> - <td class="right" data-ratio="2 3">67%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:42 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_styled/style.css b/tests/farm/html/gold_styled/style.css index c3767eef..0cd0cce1 100644 --- a/tests/farm/html/gold_styled/style.css +++ b/tests/farm/html/gold_styled/style.css @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ /* CSS styles for coverage.py. */ /* Page-wide styles */ diff --git a/tests/farm/html/gold_unicode/index.html b/tests/farm/html/gold_unicode/index.html index 6d8268d8..c1f2fb67 100644 --- a/tests/farm/html/gold_unicode/index.html +++ b/tests/farm/html/gold_unicode/index.html @@ -1,15 +1,11 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Coverage report</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> - <script type="text/javascript" src="jquery.debounce.min.js"></script> + <script type="text/javascript" src="jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="jquery.tablesorter.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="coverage_html.js"></script> @@ -18,21 +14,17 @@ </script> </head> <body class="indexfile"> - <div id="header"> <div class="content"> <h1>Coverage report: <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <form id="filter_container"> <input id="filter" type="text" value="" placeholder="filter..." /> </form> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> <p class="legend">Hot-keys on this page</p> @@ -42,63 +34,51 @@ <span class="key">s</span> <span class="key">m</span> <span class="key">x</span> - <span class="key">c</span> change column sorting </p> </div> </div> - <div id="index"> <table class="index"> <thead> - <tr class="tablehead" title="Click to sort"> <th class="name left headerSortDown shortkey_n">Module</th> <th class="shortkey_s">statements</th> <th class="shortkey_m">missing</th> <th class="shortkey_x">excluded</th> - <th class="right shortkey_c">coverage</th> </tr> </thead> - <tfoot> <tr class="total"> <td class="name left">Total</td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> </tfoot> <tbody> - <tr class="file"> <td class="name left"><a href="unicode_py.html">unicode.py</a></td> <td>2</td> <td>0</td> <td>0</td> - <td class="right" data-ratio="2 2">100%</td> </tr> - </tbody> </table> - <p id="no_rows"> No items found using the specified filter. </p> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:31 + <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:42 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/gold_unicode/unicode_py.html b/tests/farm/html/gold_unicode/unicode_py.html index 83b0f382..7708f22e 100644 --- a/tests/farm/html/gold_unicode/unicode_py.html +++ b/tests/farm/html/gold_unicode/unicode_py.html @@ -1,16 +1,10 @@ - - - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> <title>Coverage for unicode.py: 100%</title> <link rel="stylesheet" href="style.css" type="text/css"> - <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.hotkeys.js"></script> <script type="text/javascript" src="jquery.isonscreen.js"></script> @@ -20,49 +14,42 @@ </script> </head> <body class="pyfile"> - <div id="header"> <div class="content"> <h1>Coverage for <b>unicode.py</b> : <span class="pc_cov">100%</span> </h1> - <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> - <h2 class="stats"> 2 statements <span class="run hide_run shortkey_r button_toggle_run">2 run</span> <span class="mis shortkey_m button_toggle_mis">0 missing</span> <span class="exc shortkey_x button_toggle_exc">0 excluded</span> - - </h2> </div> </div> - <div class="help_panel"> <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> -<p class="legend">Hot-keys on this page</p> + <p class="legend">Hot-keys on this page</p> <div> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">r</span> <span class="key">m</span> <span class="key">x</span> <span class="key">p</span> toggle line displays </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">j</span> <span class="key">k</span> next/prev highlighted chunk </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">0</span> (zero) top of page </p> -<p class="keyhelp"> + <p class="keyhelp"> <span class="key">1</span> (one) first highlighted chunk </p> </div> </div> - <div id="source"> <table> <tr> @@ -75,31 +62,27 @@ <p id="n6" class="pln"><a href="#n6">6</a></p> <p id="n7" class="stm run hide_run"><a href="#n7">7</a></p> <p id="n8" class="stm run hide_run"><a href="#n8">8</a></p> - </td> <td class="text"> <p id="t1" class="pln"><span class="com"># -*- coding: utf-8 -*-</span><span class="strut"> </span></p> <p id="t2" class="pln"><span class="com"># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0</span><span class="strut"> </span></p> -<p id="t3" class="pln"><span class="com"># For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt</span><span class="strut"> </span></p> +<p id="t3" class="pln"><span class="com"># For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt</span><span class="strut"> </span></p> <p id="t4" class="pln"><span class="strut"> </span></p> <p id="t5" class="pln"><span class="com"># A Python source file with exotic characters.</span><span class="strut"> </span></p> <p id="t6" class="pln"><span class="strut"> </span></p> -<p id="t7" class="stm run hide_run"><span class="nam">upside_down</span> <span class="op">=</span> <span class="str">"ʎd˙ǝbɐɹǝʌoɔ"</span><span class="strut"> </span></p> -<p id="t8" class="stm run hide_run"><span class="nam">surrogate</span> <span class="op">=</span> <span class="str">"db40,dd00: x󠄀"</span><span class="strut"> </span></p> - +<p id="t7" class="stm run hide_run"><span class="nam">upside_down</span> <span class="op">=</span> <span class="str">"ʎd˙ǝbɐɹǝʌoɔ"</span><span class="strut"> </span></p> +<p id="t8" class="stm run hide_run"><span class="nam">surrogate</span> <span class="op">=</span> <span class="str">"db40,dd00: x󠄀"</span><span class="strut"> </span></p> </td> </tr> </table> </div> - <div id="footer"> <div class="content"> <p> - <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-4.0a7">coverage.py v4.0a7</a>, - created at 2015-07-24 09:04 + <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a2">coverage.py v5.0a2</a>, + created at 2018-06-29 15:42 </p> </div> </div> - </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/farm/html/othersrc/other.py b/tests/farm/html/othersrc/other.py index bf0304d2..54b4fb7c 100644 --- a/tests/farm/html/othersrc/other.py +++ b/tests/farm/html/othersrc/other.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A file in another directory. We're checking that it ends up in the # HTML report. diff --git a/tests/farm/html/src/a.py b/tests/farm/html/src/a.py index 85764e21..f31bdedb 100644 --- a/tests/farm/html/src/a.py +++ b/tests/farm/html/src/a.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A test file for HTML reporting by coverage.py. diff --git a/tests/farm/html/src/b.py b/tests/farm/html/src/b.py index cb673c22..720cb5f1 100644 --- a/tests/farm/html/src/b.py +++ b/tests/farm/html/src/b.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A test file for HTML reporting by coverage.py. diff --git a/tests/farm/html/src/bom.py b/tests/farm/html/src/bom.py index 21d26ca2..098ad84f 100644 --- a/tests/farm/html/src/bom.py +++ b/tests/farm/html/src/bom.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A Python source file in utf-8, with BOM. math = "3×4 = 12, ÷2 = 6±0" diff --git a/tests/farm/html/src/here.py b/tests/farm/html/src/here.py index fee9960d..ca85c75d 100644 --- a/tests/farm/html/src/here.py +++ b/tests/farm/html/src/here.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A test file for HTML reporting by coverage.py. diff --git a/tests/farm/html/src/isolatin1.py b/tests/farm/html/src/isolatin1.py index 55a6f7de..69b4a529 100644 --- a/tests/farm/html/src/isolatin1.py +++ b/tests/farm/html/src/isolatin1.py @@ -1,6 +1,6 @@ # -*- coding: iso8859-1 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A Python source file in another encoding. diff --git a/tests/farm/html/src/m1.py b/tests/farm/html/src/m1.py index 524fb0aa..bef6c9ae 100644 --- a/tests/farm/html/src/m1.py +++ b/tests/farm/html/src/m1.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt m1a = 1 m1b = 2 diff --git a/tests/farm/html/src/m2.py b/tests/farm/html/src/m2.py index 2d13bfe2..ac75070a 100644 --- a/tests/farm/html/src/m2.py +++ b/tests/farm/html/src/m2.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt m2a = 1 m2b = 2 diff --git a/tests/farm/html/src/m3.py b/tests/farm/html/src/m3.py index 96e8b992..a6f871cd 100644 --- a/tests/farm/html/src/m3.py +++ b/tests/farm/html/src/m3.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt m3a = 1 m3b = 2 diff --git a/tests/farm/html/src/main.py b/tests/farm/html/src/main.py index 238d0b58..3d0eba65 100644 --- a/tests/farm/html/src/main.py +++ b/tests/farm/html/src/main.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt import m1 import m2 diff --git a/tests/farm/html/src/omit4.ini b/tests/farm/html/src/omit4.ini index b792e703..844d3fd0 100644 --- a/tests/farm/html/src/omit4.ini +++ b/tests/farm/html/src/omit4.ini @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt [report] omit = m2.py diff --git a/tests/farm/html/src/omit5.ini b/tests/farm/html/src/omit5.ini index 3b6add29..2615c056 100644 --- a/tests/farm/html/src/omit5.ini +++ b/tests/farm/html/src/omit5.ini @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt [report] omit = diff --git a/tests/farm/html/src/partial.ini b/tests/farm/html/src/partial.ini index cdb241b5..86a1b9bd 100644 --- a/tests/farm/html/src/partial.ini +++ b/tests/farm/html/src/partial.ini @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt [run] branch = True diff --git a/tests/farm/html/src/partial.py b/tests/farm/html/src/partial.py index 0f8fbe3c..ea97ec4f 100644 --- a/tests/farm/html/src/partial.py +++ b/tests/farm/html/src/partial.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # partial branches and excluded lines diff --git a/tests/farm/html/src/run_a_xml_2.ini b/tests/farm/html/src/run_a_xml_2.ini index f632bd09..85ba5e8b 100644 --- a/tests/farm/html/src/run_a_xml_2.ini +++ b/tests/farm/html/src/run_a_xml_2.ini @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Put all the XML output in xml_2 [xml] diff --git a/tests/farm/html/src/tabbed.py b/tests/farm/html/src/tabbed.py index e897e9fa..573ab126 100644 --- a/tests/farm/html/src/tabbed.py +++ b/tests/farm/html/src/tabbed.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # This file should have tabs. x = 1 diff --git a/tests/farm/html/src/unicode.py b/tests/farm/html/src/unicode.py index 37c5533a..c592935b 100644 --- a/tests/farm/html/src/unicode.py +++ b/tests/farm/html/src/unicode.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A Python source file with exotic characters. diff --git a/tests/farm/html/src/y.py b/tests/farm/html/src/y.py index a50bb629..3ed0ba49 100644 --- a/tests/farm/html/src/y.py +++ b/tests/farm/html/src/y.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # A test file for XML reporting by coverage.py. diff --git a/tests/farm/run/run_chdir.py b/tests/farm/run/run_chdir.py index 1da4e9a3..5ec0b4ea 100644 --- a/tests/farm/run/run_chdir.py +++ b/tests/farm/run/run_chdir.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt copy("src", "out_chdir") run(""" diff --git a/tests/farm/run/run_timid.py b/tests/farm/run/run_timid.py index 0370cf84..56456618 100644 --- a/tests/farm/run/run_timid.py +++ b/tests/farm/run/run_timid.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Test that the --timid command line argument properly swaps the tracer # function for a simpler one. diff --git a/tests/farm/run/run_xxx.py b/tests/farm/run/run_xxx.py index 1db5b0d0..3caba0ec 100644 --- a/tests/farm/run/run_xxx.py +++ b/tests/farm/run/run_xxx.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt copy("src", "out_xxx") run(""" diff --git a/tests/farm/run/src/chdir.py b/tests/farm/run/src/chdir.py index 35cfcc81..250f7132 100644 --- a/tests/farm/run/src/chdir.py +++ b/tests/farm/run/src/chdir.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt import os print("Line One") diff --git a/tests/farm/run/src/showtrace.py b/tests/farm/run/src/showtrace.py index 3a2750a6..a3692521 100644 --- a/tests/farm/run/src/showtrace.py +++ b/tests/farm/run/src/showtrace.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Show the current frame's trace function, so that we can test what the # command-line options do to the trace function used. diff --git a/tests/farm/run/src/xxx b/tests/farm/run/src/xxx index 864da457..818c7f93 100644 --- a/tests/farm/run/src/xxx +++ b/tests/farm/run/src/xxx @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # This is a python file though it doesn't look like it, like a main script. a = b = c = d = 0 diff --git a/tests/goldtest.py b/tests/goldtest.py index baaa8f01..8f24f239 100644 --- a/tests/goldtest.py +++ b/tests/goldtest.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """A test base class for tests based on gold file comparison.""" diff --git a/tests/helpers.py b/tests/helpers.py index f10169a9..bc9c3982 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Helpers for coverage.py tests.""" diff --git a/tests/js/tests.js b/tests/js/tests.js index bf2ca734..7bd3b9ca 100644 --- a/tests/js/tests.js +++ b/tests/js/tests.js @@ -1,5 +1,5 @@ /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ // Tests of coverage.py HTML report chunk navigation. /*global coverage, jQuery, $ */ diff --git a/tests/modules/covmod1.py b/tests/modules/covmod1.py index 0f9638b8..618f1d04 100644 --- a/tests/modules/covmod1.py +++ b/tests/modules/covmod1.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # covmod1.py: Simplest module for testing. i = 1 diff --git a/tests/modules/namespace_420/sub1/__init__.py b/tests/modules/namespace_420/sub1/__init__.py index 94bb2959..4a8721ab 100644 --- a/tests/modules/namespace_420/sub1/__init__.py +++ b/tests/modules/namespace_420/sub1/__init__.py @@ -1,4 +1,4 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt sub1 = "namespace_420 sub1" diff --git a/tests/modules/pkg1/p1a.py b/tests/modules/pkg1/p1a.py index 5d81b1fa..984bf748 100644 --- a/tests/modules/pkg1/p1a.py +++ b/tests/modules/pkg1/p1a.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt import os, sys diff --git a/tests/modules/pkg1/p1b.py b/tests/modules/pkg1/p1b.py index 53505cef..dc6d0b17 100644 --- a/tests/modules/pkg1/p1b.py +++ b/tests/modules/pkg1/p1b.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt x = 1 y = 2 diff --git a/tests/modules/pkg1/p1c.py b/tests/modules/pkg1/p1c.py index 98f319e8..24e2932c 100644 --- a/tests/modules/pkg1/p1c.py +++ b/tests/modules/pkg1/p1c.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt a = 1 b = 2 diff --git a/tests/modules/pkg1/runmod2.py b/tests/modules/pkg1/runmod2.py index 5911db7b..b0f43c2e 100644 --- a/tests/modules/pkg1/runmod2.py +++ b/tests/modules/pkg1/runmod2.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Used in the tests for run_python_module import sys diff --git a/tests/modules/pkg1/sub/ps1a.py b/tests/modules/pkg1/sub/ps1a.py index 44d3b274..b895fc60 100644 --- a/tests/modules/pkg1/sub/ps1a.py +++ b/tests/modules/pkg1/sub/ps1a.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt d = 1 e = 2 diff --git a/tests/modules/pkg1/sub/runmod3.py b/tests/modules/pkg1/sub/runmod3.py index 1f5ce27e..b3b40327 100644 --- a/tests/modules/pkg1/sub/runmod3.py +++ b/tests/modules/pkg1/sub/runmod3.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Used in the tests for run_python_module import sys diff --git a/tests/modules/pkg2/p2a.py b/tests/modules/pkg2/p2a.py index 62caae22..f3f86f99 100644 --- a/tests/modules/pkg2/p2a.py +++ b/tests/modules/pkg2/p2a.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt q = 1 r = 1 diff --git a/tests/modules/pkg2/p2b.py b/tests/modules/pkg2/p2b.py index 73716eb4..38d7a840 100644 --- a/tests/modules/pkg2/p2b.py +++ b/tests/modules/pkg2/p2b.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt t = 1 u = 1 diff --git a/tests/modules/plugins/another.py b/tests/modules/plugins/another.py index 80902d34..dfe03c97 100644 --- a/tests/modules/plugins/another.py +++ b/tests/modules/plugins/another.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """A plugin for tests to reference.""" diff --git a/tests/modules/process_test/try_execfile.py b/tests/modules/process_test/try_execfile.py index ec7dcbe5..706fe39f 100644 --- a/tests/modules/process_test/try_execfile.py +++ b/tests/modules/process_test/try_execfile.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Test file for run_python_file. @@ -68,10 +68,15 @@ FN_VAL = my_function("fooey") loader = globals().get('__loader__') fullname = getattr(loader, 'fullname', None) or getattr(loader, 'name', None) -# A more compact grouped-by-first-letter list of builtins. +# A more compact ad-hoc grouped-by-first-letter list of builtins. +CLUMPS = "ABC,DEF,GHI,JKLMN,OPQR,ST,U,VWXYZ_,ab,cd,efg,hij,lmno,pqr,stuvwxyz".split(",") + def word_group(w): - """Clump AB, CD, EF, etc.""" - return chr((ord(w[0]) + 1) & 0xFE) + """Figure out which CLUMP the first letter of w is in.""" + for i, clump in enumerate(CLUMPS): + if w[0] in clump: + return i + return 99 builtin_dir = [" ".join(s) for _, s in itertools.groupby(dir(__builtins__), key=word_group)] diff --git a/tests/modules/runmod1.py b/tests/modules/runmod1.py index b43b299a..cb1f7e99 100644 --- a/tests/modules/runmod1.py +++ b/tests/modules/runmod1.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Used in the tests for run_python_module import sys diff --git a/tests/modules/usepkgs.py b/tests/modules/usepkgs.py index 222e68ce..63ce7c18 100644 --- a/tests/modules/usepkgs.py +++ b/tests/modules/usepkgs.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt import pkg1.p1a, pkg1.p1b, pkg1.sub import pkg2.p2a, pkg2.p2b diff --git a/tests/moremodules/namespace_420/sub2/__init__.py b/tests/moremodules/namespace_420/sub2/__init__.py index 0839688c..b5e413cc 100644 --- a/tests/moremodules/namespace_420/sub2/__init__.py +++ b/tests/moremodules/namespace_420/sub2/__init__.py @@ -1,4 +1,4 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt sub2 = "namespace_420 sub2" diff --git a/tests/moremodules/othermods/othera.py b/tests/moremodules/othermods/othera.py index b3ee9c04..56cdfe80 100644 --- a/tests/moremodules/othermods/othera.py +++ b/tests/moremodules/othermods/othera.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt o = 1 p = 2 diff --git a/tests/moremodules/othermods/otherb.py b/tests/moremodules/othermods/otherb.py index 334fdc4a..50ba96a3 100644 --- a/tests/moremodules/othermods/otherb.py +++ b/tests/moremodules/othermods/otherb.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt q = 3 r = 4 diff --git a/tests/moremodules/othermods/sub/osa.py b/tests/moremodules/othermods/sub/osa.py index 4005640e..5e5a5ff5 100644 --- a/tests/moremodules/othermods/sub/osa.py +++ b/tests/moremodules/othermods/sub/osa.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt s = 5 t = 6 diff --git a/tests/moremodules/othermods/sub/osb.py b/tests/moremodules/othermods/sub/osb.py index 7d96fb79..c150087d 100644 --- a/tests/moremodules/othermods/sub/osb.py +++ b/tests/moremodules/othermods/sub/osb.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt u = 7 v = 8 diff --git a/tests/osinfo.py b/tests/osinfo.py index 094fb097..f9562deb 100644 --- a/tests/osinfo.py +++ b/tests/osinfo.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """OS information for testing.""" diff --git a/tests/plugin1.py b/tests/plugin1.py index e03dadf1..a070af36 100644 --- a/tests/plugin1.py +++ b/tests/plugin1.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """A file tracer plugin for test_plugins.py to import.""" diff --git a/tests/plugin2.py b/tests/plugin2.py index c1ab1c23..c334628a 100644 --- a/tests/plugin2.py +++ b/tests/plugin2.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """A file tracer plugin for test_plugins.py to import.""" diff --git a/tests/plugin_config.py b/tests/plugin_config.py index 67a790a2..c4d3cf65 100644 --- a/tests/plugin_config.py +++ b/tests/plugin_config.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """A configuring plugin for test_plugins.py to import.""" diff --git a/tests/stress_phystoken.tok b/tests/stress_phystoken.tok index eb2fb669..f2b190c3 100644 --- a/tests/stress_phystoken.tok +++ b/tests/stress_phystoken.tok @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # Here's some random Python so that test_tokenize_myself will have some # stressful stuff to try. This file is .tok instead of .py so pylint won't diff --git a/tests/stress_phystoken_dos.tok b/tests/stress_phystoken_dos.tok index 5b016a77..eb937d95 100644 --- a/tests/stress_phystoken_dos.tok +++ b/tests/stress_phystoken_dos.tok @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
-# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
# Here's some random Python so that test_tokenize_myself will have some
# stressful stuff to try. This file is .tok instead of .py so pylint won't
diff --git a/tests/test_api.py b/tests/test_api.py index b461c503..248784ff 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,10 +1,11 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py's API.""" import fnmatch import os +import os.path import sys import textwrap import warnings @@ -581,7 +582,7 @@ class SourceOmitIncludeTest(OmitIncludeTestsMixin, CoverageTest): cov = coverage.Coverage(source=["pkg1"], include=["pkg2"]) with self.assert_warnings(cov, ["--include is ignored because --source is set"]): cov.start() - cov.stop() + cov.stop() # pragma: nested def test_source_package_as_dir(self): # pkg1 is a directory, since we cd'd into tests/modules in setUp. diff --git a/tests/test_arcs.py b/tests/test_arcs.py index ef71ea16..c86147b7 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py's arc measurement.""" @@ -407,8 +407,6 @@ class LoopArcTest(CoverageTest): ) def test_other_comprehensions(self): - if env.PYVERSION < (2, 7): - self.skipTest("No set or dict comprehensions before 2.7") # Set comprehension: self.check_coverage("""\ o = ((1,2), (3,4)) @@ -431,8 +429,6 @@ class LoopArcTest(CoverageTest): ) def test_multiline_dict_comp(self): - if env.PYVERSION < (2, 7): - self.skipTest("No set or dict comprehensions before 2.7") if env.PYVERSION < (3, 5): arcz = "-42 2B B-4 2-4" else: diff --git a/tests/test_backward.py b/tests/test_backward.py index bbecb780..8acb8707 100644 --- a/tests/test_backward.py +++ b/tests/test_backward.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests that our version shims in backward.py are working.""" diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 1b7c6653..b6fad76d 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Test cmdline.py for coverage.py.""" @@ -33,7 +33,7 @@ class BaseCmdLineTest(CoverageTest): defaults.Coverage( cover_pylib=None, data_suffix=None, timid=None, branch=None, config_file=True, source=None, include=None, omit=None, debug=None, - concurrency=None, + concurrency=None, check_preimported=True, ) defaults.annotate( directory=None, ignore_errors=None, include=None, omit=None, morfs=[], diff --git a/tests/test_collector.py b/tests/test_collector.py index bd963415..9989b229 100644 --- a/tests/test_collector.py +++ b/tests/test_collector.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests of coverage/collector.py and other collectors.""" diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 71006042..58529ec5 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for concurrency libraries.""" @@ -335,7 +335,7 @@ MULTI_CODE = """ import sys def process_worker_main(args): - # Need to pause, or the tasks go too quick, and some processes + # Need to pause, or the tasks go too quickly, and some processes # in the pool don't get any work, and then don't record data. time.sleep(0.02) ret = work(*args) @@ -359,7 +359,7 @@ MULTI_CODE = """ """ -@flaky(max_runs=10) # Sometimes a test fails due to inherent randomness. Try one more time. +@flaky(max_runs=10) # Sometimes a test fails due to inherent randomness. Try more times. class MultiprocessingTest(CoverageTest): """Test support of the multiprocessing module.""" @@ -403,7 +403,7 @@ class MultiprocessingTest(CoverageTest): last_line = self.squeezed_lines(out)[-1] self.assertRegex(last_line, r"multi.py \d+ 0 100%") - def test_multiprocessing(self): + def test_multiprocessing_simple(self): nprocs = 3 upto = 30 code = (SQUARE_OR_CUBE_WORK + MULTI_CODE).format(NPROCS=nprocs, UPTO=upto) @@ -430,6 +430,7 @@ class MultiprocessingTest(CoverageTest): [run] concurrency = multiprocessing branch = True + omit = */site-packages/* """) if env.PYVERSION >= (3, 4): @@ -464,7 +465,7 @@ def test_coverage_stop_in_threads(): has_started_coverage = [] has_stopped_coverage = [] - def run_thread(): + def run_thread(): # pragma: nested """Check that coverage is stopping properly in threads.""" deadline = time.time() + 5 ident = threading.currentThread().ident @@ -480,11 +481,11 @@ def test_coverage_stop_in_threads(): cov = coverage.coverage() cov.start() - t = threading.Thread(target=run_thread) - t.start() + t = threading.Thread(target=run_thread) # pragma: nested + t.start() # pragma: nested - time.sleep(0.1) - cov.stop() + time.sleep(0.1) # pragma: nested + cov.stop() # pragma: nested time.sleep(0.1) assert has_started_coverage == [t.ident] @@ -513,7 +514,7 @@ def test_thread_safe_save_data(tmpdir): for module_name in module_names: import_local_file(module_name) - def random_load(): + def random_load(): # pragma: nested """Import modules randomly to stress coverage.""" while should_run[0]: module_name = random.choice(module_names) @@ -529,12 +530,12 @@ def test_thread_safe_save_data(tmpdir): cov = coverage.coverage() cov.start() - threads = [threading.Thread(target=random_load) for _ in range(10)] - should_run[0] = True - for t in threads: + threads = [threading.Thread(target=random_load) for _ in range(10)] # pragma: nested + should_run[0] = True # pragma: nested + for t in threads: # pragma: nested t.start() - time.sleep(duration) + time.sleep(duration) # pragma: nested cov.stop() @@ -546,7 +547,7 @@ def test_thread_safe_save_data(tmpdir): for t in threads: t.join() - if (not imported) and duration < 10: + if (not imported) and duration < 10: # pragma: only failure duration *= 2 finally: diff --git a/tests/test_config.py b/tests/test_config.py index 0b4d40b6..513522ee 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Test the config file handling for coverage.py""" @@ -103,6 +103,21 @@ class ConfigTest(CoverageTest): cov = coverage.Coverage() self.assertEqual(cov.config.debug, ["dataio", "pids", "callers", "fooey"]) + def test_rcfile_from_environment(self): + self.make_file("here.ini", """\ + [run] + data_file = overthere.dat + """) + self.set_environ("COVERAGE_RCFILE", "here.ini") + cov = coverage.Coverage() + self.assertEqual(cov.config.data_file, "overthere.dat") + + def test_missing_rcfile_from_environment(self): + self.set_environ("COVERAGE_RCFILE", "nowhere.ini") + msg = "Couldn't read 'nowhere.ini' as a config file" + with self.assertRaisesRegex(CoverageException, msg): + coverage.Coverage() + def test_parse_errors(self): # Im-parsable values raise CoverageException, with details. bad_configs_and_msgs = [ diff --git a/tests/test_coverage.py b/tests/test_coverage.py index 45abb2be..676fc831 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py.""" @@ -582,12 +582,7 @@ class SimpleStatementTest(CoverageTest): """, [2, 3] ) - if env.PYVERSION < (3, 7): - # Before 3.7, module docstrings were included in the lnotab table, - # unless they were the first line in the file? - lines = [2, 3, 4] - else: - lines = [3, 4] + lines = [2, 3, 4] self.check_coverage("""\ # Start with a comment, because it changes the behavior(!?) '''I am a module docstring.''' @@ -1147,11 +1142,7 @@ class CompoundStatementTest(CoverageTest): [1,10,12,13], "") def test_class_def(self): - if env.PYVERSION < (3, 7): - arcz="-22 2D DE E-2 23 36 6A A-2 -68 8-6 -AB B-A" - else: - # Python 3.7 no longer includes class docstrings in the lnotab table. - arcz="-22 2D DE E-2 26 6A A-2 -68 8-6 -AB B-A" + arcz="-22 2D DE E-2 23 36 6A A-2 -68 8-6 -AB B-A" self.check_coverage("""\ # A comment. class theClass: diff --git a/tests/test_data.py b/tests/test_data.py index 46999f63..0d3172d4 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.data""" diff --git a/tests/test_debug.py b/tests/test_debug.py index 38f31f58..2699ca61 100644 --- a/tests/test_debug.py +++ b/tests/test_debug.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests of coverage/debug.py""" @@ -145,7 +145,7 @@ class DebugTraceTest(CoverageTest): out_lines = self.f1_debug_output(["config"]) labels = """ - attempted_config_files branch config_files cover_pylib data_file + attempted_config_files branch config_files_read config_file cover_pylib data_file debug exclude_list extra_css html_dir html_title ignore_errors run_include run_omit parallel partial_always_list partial_list paths precision show_missing source timid xml_output @@ -162,7 +162,7 @@ class DebugTraceTest(CoverageTest): out_lines = self.f1_debug_output(["sys"]) labels = """ - version coverage cover_paths pylib_paths tracer config_files + version coverage cover_paths pylib_paths tracer configs_attempted config_file configs_read data_path python platform implementation executable cwd path environment command_line cover_match pylib_match """.split() diff --git a/tests/test_execfile.py b/tests/test_execfile.py index 693df71a..cb835c2a 100644 --- a/tests/test_execfile.py +++ b/tests/test_execfile.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.execfile""" diff --git a/tests/test_farm.py b/tests/test_farm.py index 1b52bc29..942bdd5c 100644 --- a/tests/test_farm.py +++ b/tests/test_farm.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Run tests in the farm sub-directory. Designed for pytest.""" @@ -36,7 +36,7 @@ def test_farm(filename): # "rU" was deprecated in 3.4 -READ_MODE = "rU" if sys.version_info < (3, 4) else "r" +READ_MODE = "rU" if env.PYVERSION < (3, 4) else "r" class FarmTestCase(ModuleAwareMixin, SysPathAwareMixin, unittest.TestCase): @@ -103,8 +103,8 @@ class FarmTestCase(ModuleAwareMixin, SysPathAwareMixin, unittest.TestCase): """Here to make unittest.TestCase happy, but will never be invoked.""" raise Exception("runTest isn't used in this class!") - def __call__(self): - """Execute the test from the run.py file.""" + def __call__(self): # pylint: disable=arguments-differ + """Execute the test from the runpy file.""" if _TEST_NAME_FILE: # pragma: debugging with open(_TEST_NAME_FILE, "w") as f: f.write(self.description.replace("/", "_")) @@ -147,6 +147,8 @@ def noop(*args_unused, **kwargs_unused): def copy(src, dst): """Copy a directory.""" + if os.path.exists(dst): + pytest.fail('%s already exists.' % os.path.join(os.getcwd(), dst)) # pragma: only failure shutil.copytree(src, dst) @@ -177,9 +179,37 @@ def run(cmds, rundir="src", outfile=None): fout.close() +def versioned_directory(d): + """Find a subdirectory of d specific to the Python version. + + For example, on Python 3.6.4 rc 1, it returns the first of these + directories that exists:: + + d/3.6.4.candidate.1 + d/3.6.4.candidate + d/3.6.4 + d/3.6 + d/3 + d + + Returns: a string, the path to an existing directory. + + """ + ver_parts = list(map(str, sys.version_info)) + for nparts in range(len(ver_parts), -1, -1): + version = ".".join(ver_parts[:nparts]) + subdir = os.path.join(d, version) + if os.path.exists(subdir): + return subdir + raise Exception("Directory missing: {}".format(d)) # pragma: only failure + + def compare(dir1, dir2, file_pattern=None, size_within=0, left_extra=False, scrubs=None): """Compare files matching `file_pattern` in `dir1` and `dir2`. + A version-specific subdirectory of `dir1` or `dir2` will be used if + it exists. + `size_within` is a percentage delta for the file sizes. If non-zero, then the file contents are not compared (since they are expected to often be different), but the file sizes must be within this amount. @@ -189,15 +219,15 @@ def compare(dir1, dir2, file_pattern=None, size_within=0, left_extra=False, scru `left_extra` true means the left directory can have extra files in it without triggering an assertion. - `scrubs` is a list of pairs, regexes to find and literal strings to - replace them with to scrub the files of unimportant differences. + `scrubs` is a list of pairs, regexes to find and replace to scrub the + files of unimportant differences. An assertion will be raised if the directories fail one of their matches. """ - assert os.path.exists(dir1), "Left directory missing: %s" % dir1 - assert os.path.exists(dir2), "Right directory missing: %s" % dir2 + dir1 = versioned_directory(dir1) + dir2 = versioned_directory(dir2) dc = filecmp.dircmp(dir1, dir2) diff_files = fnmatch_list(dc.diff_files, file_pattern) @@ -234,19 +264,23 @@ def compare(dir1, dir2, file_pattern=None, size_within=0, left_extra=False, scru # ourselves. text_diff = [] for f in diff_files: - with open(os.path.join(dir1, f), READ_MODE) as fobj: + left_file = os.path.join(dir1, f) + right_file = os.path.join(dir2, f) + with open(left_file, READ_MODE) as fobj: left = fobj.read() - with open(os.path.join(dir2, f), READ_MODE) as fobj: + with open(right_file, READ_MODE) as fobj: right = fobj.read() if scrubs: left = scrub(left, scrubs) right = scrub(right, scrubs) if left != right: # pragma: only failure - text_diff.append(f) + text_diff.append('%s != %s' % (left_file, right_file)) left = left.splitlines() right = right.splitlines() + print(":::: diff {!r} and {!r}".format(left_file, right_file)) print("\n".join(difflib.Differ().compare(left, right))) - assert not text_diff, "Files differ: %s" % text_diff + print(":::: end diff {!r} and {!r}".format(left_file, right_file)) + assert not text_diff, "Files differ: %s" % '\n'.join(text_diff) if not left_extra: assert not left_only, "Files in %s only: %s" % (dir1, left_only) @@ -344,7 +378,7 @@ def scrub(strdata, scrubs): """ for rgx_find, rgx_replace in scrubs: - strdata = re.sub(rgx_find, rgx_replace.replace("\\", "\\\\"), strdata) + strdata = re.sub(rgx_find, rgx_replace, strdata) return strdata diff --git a/tests/test_filereporter.py b/tests/test_filereporter.py index 91e47762..e50a7493 100644 --- a/tests/test_filereporter.py +++ b/tests/test_filereporter.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for FileReporters""" diff --git a/tests/test_files.py b/tests/test_files.py index dd88b6eb..2e705a1b 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for files.py""" diff --git a/tests/test_html.py b/tests/test_html.py index 9bb8f392..9706cd33 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests that HTML generation is awesome.""" @@ -13,11 +13,13 @@ import re import sys import coverage -import coverage.files +from coverage.backward import unicode_class +from coverage import env +from coverage.files import flat_rootname import coverage.html from coverage.misc import CoverageException, NotPython, NoSource -from tests.coveragetest import CoverageTest +from tests.coveragetest import CoverageTest, TESTS_DIR from tests.goldtest import CoverageGoldTest from tests.goldtest import change_dir, compare, contains, doesnt_contain, contains_any @@ -564,6 +566,26 @@ class HtmlStaticFileTest(CoverageTest): cov.html_report() +def compare_html(dir1, dir2): + """Specialized compare function for HTML files.""" + scrubs = [ + (r'/coverage.readthedocs.io/?[-.\w/]*', '/coverage.readthedocs.io/VER'), + (r'coverage.py v[\d.abc]+', 'coverage.py vVER'), + (r'created at \d\d\d\d-\d\d-\d\d \d\d:\d\d', 'created at DATE'), + # Some words are identifiers in one version, keywords in another. + (r'<span class="(nam|key)">(print|True|False)</span>', r'<span class="nam">\2</span>'), + # Occasionally an absolute path is in the HTML report. + (re.escape(TESTS_DIR), 'TESTS_DIR'), + (r'/Users/ned/coverage/trunk/tests', 'TESTS_DIR'), + (flat_rootname(unicode_class(TESTS_DIR)), '_TESTS_DIR'), + (flat_rootname(u'/Users/ned/coverage/trunk/tests'), '_TESTS_DIR'), + ] + if env.WINDOWS: + # For file paths... + scrubs += [(r"\\", "/")] + return compare(dir1, dir2, file_pattern="*.html", scrubs=scrubs) + + class HtmlGoldTests(CoverageGoldTest): """Tests of HTML reporting that use gold files.""" @@ -580,7 +602,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(a, directory='../out/a') - compare("gold_a", "out/a", size_within=10, file_pattern="*.html") + compare_html("gold_a", "out/a") contains( "out/a/a_py.html", ('<span class="key">if</span> <span class="num">1</span> ' @@ -607,7 +629,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(b, directory="../out/b_branch") - compare("gold_b_branch", "out/b_branch", size_within=10, file_pattern="*.html") + compare_html("gold_b_branch", "out/b_branch") contains( "out/b_branch/b_py.html", ('<span class="key">if</span> <span class="nam">x</span> ' @@ -640,6 +662,12 @@ class HtmlGoldTests(CoverageGoldTest): self.output_dir("out/bom") with change_dir("src"): + # It's important that the source file really have a BOM, which can + # get lost, so check that it's really there. + with open("bom.py", "rb") as f: + first_three = f.read(3) + assert first_three == b"\xef\xbb\xbf" + # pylint: disable=import-error cov = coverage.Coverage() cov.start() @@ -647,7 +675,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(bom, directory="../out/bom") - compare("gold_bom", "out/bom", size_within=10, file_pattern="*.html") + compare_html("gold_bom", "out/bom") contains( "out/bom/bom_py.html", '<span class="str">"3×4 = 12, ÷2 = 6±0"</span>', @@ -664,7 +692,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(isolatin1, directory="../out/isolatin1") - compare("gold_isolatin1", "out/isolatin1", size_within=10, file_pattern="*.html") + compare_html("gold_isolatin1", "out/isolatin1") contains( "out/isolatin1/isolatin1_py.html", '<span class="str">"3×4 = 12, ÷2 = 6±0"</span>', @@ -681,7 +709,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(directory="../out/omit_1") - compare("gold_omit_1", "out/omit_1", size_within=10, file_pattern="*.html") + compare_html("gold_omit_1", "out/omit_1") def test_omit_2(self): self.output_dir("out/omit_2") @@ -694,7 +722,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(directory="../out/omit_2", omit=["m1.py"]) - compare("gold_omit_2", "out/omit_2", size_within=10, file_pattern="*.html") + compare_html("gold_omit_2", "out/omit_2") def test_omit_3(self): self.output_dir("out/omit_3") @@ -707,7 +735,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(directory="../out/omit_3", omit=["m1.py", "m2.py"]) - compare("gold_omit_3", "out/omit_3", size_within=10, file_pattern="*.html") + compare_html("gold_omit_3", "out/omit_3") def test_omit_4(self): self.output_dir("out/omit_4") @@ -720,7 +748,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(directory="../out/omit_4") - compare("gold_omit_4", "out/omit_4", size_within=10, file_pattern="*.html") + compare_html("gold_omit_4", "out/omit_4") def test_omit_5(self): self.output_dir("out/omit_5") @@ -733,7 +761,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report() - compare("gold_omit_5", "out/omit_5", size_within=10, file_pattern="*.html") + compare_html("gold_omit_5", "out/omit_5") def test_other(self): self.output_dir("out/other") @@ -751,7 +779,7 @@ class HtmlGoldTests(CoverageGoldTest): for p in glob.glob("out/other/*_other_py.html"): os.rename(p, "out/other/blah_blah_other_py.html") - compare("gold_other", "out/other", size_within=10, file_pattern="*.html") + compare_html("gold_other", "out/other") contains( "out/other/index.html", '<a href="here_py.html">here.py</a>', @@ -769,7 +797,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(partial, directory="../out/partial") - compare("gold_partial", "out/partial", size_within=10, file_pattern="*.html") + compare_html("gold_partial", "out/partial") contains( "out/partial/partial_py.html", '<p id="t8" class="stm run hide_run">', @@ -800,7 +828,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(a, directory="../out/styled", extra_css="extra.css") - compare("gold_styled", "out/styled", size_within=10, file_pattern="*.html") + compare_html("gold_styled", "out/styled") compare("gold_styled", "out/styled", size_within=10, file_pattern="*.css") contains( "out/styled/a_py.html", @@ -853,7 +881,7 @@ class HtmlGoldTests(CoverageGoldTest): cov.stop() # pragma: nested cov.html_report(unicode, directory="../out/unicode") - compare("gold_unicode", "out/unicode", size_within=10, file_pattern="*.html") + compare_html("gold_unicode", "out/unicode") contains( "out/unicode/unicode_py.html", '<span class="str">"ʎd˙ǝbɐɹǝʌoɔ"</span>', diff --git a/tests/test_misc.py b/tests/test_misc.py index 939b1c98..f3d485cc 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests of miscellaneous stuff.""" diff --git a/tests/test_oddball.py b/tests/test_oddball.py index aa2f333c..5d615c35 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Oddball cases for testing coverage.py""" @@ -118,7 +118,7 @@ class RecursionTest(CoverageTest): cov = coverage.Coverage() self.start_import_stop(cov, "recur") - pytrace = (cov.collector.tracer_name() == "PyTracer") + pytrace = (cov._collector.tracer_name() == "PyTracer") expected_missing = [3] if pytrace: # pragma: no metacov expected_missing += [9, 10, 11] @@ -398,15 +398,6 @@ class ExceptionTest(CoverageTest): class DoctestTest(CoverageTest): """Tests invoked with doctest should measure properly.""" - def setUp(self): - super(DoctestTest, self).setUp() - - # This test case exists because Python 2.4's doctest module didn't play - # well with coverage. Nose fixes the problem by monkeypatching doctest. - # I want to be sure there's no monkeypatch and that I'm getting the - # doctest module that users of coverage will get. - assert 'doctest' not in sys.modules - def test_doctest(self): self.check_coverage('''\ def return_arg_or_void(arg): diff --git a/tests/test_parser.py b/tests/test_parser.py index afb87716..c2d70ee5 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py's code parsing.""" @@ -165,11 +165,7 @@ class PythonParserTest(CoverageTest): def func(x=25): return 26 """) - if env.PYVERSION < (3, 7): - raw_statements = set([3, 4, 5, 6, 8, 9, 10, 13, 15, 16, 17, 20, 22, 23, 25, 26]) - else: - # Python 3.7 no longer includes class docstrings in the lnotab table. - raw_statements = set([3, 4, 5, 6, 8, 10, 13, 15, 16, 17, 20, 22, 23, 25, 26]) + raw_statements = set([3, 4, 5, 6, 8, 9, 10, 13, 15, 16, 17, 20, 22, 23, 25, 26]) self.assertEqual(parser.raw_statements, raw_statements) self.assertEqual(parser.statements, set([8])) @@ -201,8 +197,14 @@ class PythonParserTest(CoverageTest): pass """) self.assertEqual(parser.statements, set([1, 2, 4, 8, 10])) - self.assertEqual(parser.arcs(), set(self.arcz_to_arcs(".1 14 48 8. .2 2. -8A A-8"))) - self.assertEqual(parser.exit_counts(), {1: 1, 2: 1, 4: 1, 8: 1, 10: 1}) + expected_arcs = set(self.arcz_to_arcs(".1 14 48 8. .2 2. -8A A-8")) + expected_exits = {1: 1, 2: 1, 4: 1, 8: 1, 10: 1} + if env.PYVERSION >= (3, 7, 0, 'beta', 5): + # 3.7 changed how functions with only docstrings are numbered. + expected_arcs.update(set(self.arcz_to_arcs("-46 6-4"))) + expected_exits.update({6: 1}) + self.assertEqual(parser.arcs(), expected_arcs) + self.assertEqual(parser.exit_counts(), expected_exits) class ParserMissingArcDescriptionTest(CoverageTest): @@ -260,10 +262,6 @@ class ParserMissingArcDescriptionTest(CoverageTest): ) def test_missing_arc_descriptions_for_small_callables(self): - # We use 2.7 features here, so just skip this test on 2.6 - if env.PYVERSION < (2, 7): - self.skipTest("No dict or set comps in 2.6") - parser = self.parse_text(u"""\ callables = [ lambda: 2, diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index 15bc6af0..1045225e 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py's improved tokenizer.""" diff --git a/tests/test_pickle2json.py b/tests/test_pickle2json.py deleted file mode 100644 index 433dade6..00000000 --- a/tests/test_pickle2json.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt - -"""Tests for coverage.pickle2json""" - -from coverage.backward import pickle, iitems -from coverage.data import CoverageData -from coverage.pickle2json import pickle2json - -from tests.coveragetest import CoverageTest -from tests.test_data import DataTestHelpers, LINES_1, ARCS_3 - - -class Pickle2JsonTestInTempDir(DataTestHelpers, CoverageTest): - """Tests pickle2json.py.""" - - no_files_in_temp_dir = True - - def write_pickled_file(self, covdata, filename): - """Write coverage data as pickled `filename`.""" - # Create the file data. - file_data = {} - - if covdata._arcs: - file_data['arcs'] = dict((f, list(amap)) for f, amap in iitems(covdata._arcs)) - else: - file_data['lines'] = dict((f, list(lmap)) for f, lmap in iitems(covdata._lines)) - - # Write the pickle to the file. - with open(filename, 'wb') as file_obj: - pickle.dump(file_data, file_obj, 2) - - def test_read_write_lines_pickle(self): - # Test the old pickle format. - covdata1 = CoverageData() - covdata1.add_lines(LINES_1) - self.write_pickled_file(covdata1, "lines.pkl") - - pickle2json("lines.pkl", "lines.json") - - covdata2 = CoverageData() - covdata2.read_file("lines.json") - self.assert_lines1_data(covdata2) - - def test_read_write_arcs_pickle(self): - # Test the old pickle format. - covdata1 = CoverageData() - covdata1.add_arcs(ARCS_3) - self.write_pickled_file(covdata1, "arcs.pkl") - - pickle2json("arcs.pkl", "arcs.json") - - covdata2 = CoverageData() - covdata2.read_file("arcs.json") - self.assert_arcs3_data(covdata2) diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 27227c33..0987e41a 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for plugins.""" @@ -369,19 +369,19 @@ class GoodFileTracerTest(FileTracerTest): _, statements, missing, _ = cov.analysis("foo_7.html") self.assertEqual(statements, [1, 2, 3, 4, 5, 6, 7]) self.assertEqual(missing, [1, 2, 3, 6, 7]) - self.assertIn("foo_7.html", cov.data.line_counts()) + self.assertIn("foo_7.html", cov.get_data().line_counts()) _, statements, missing, _ = cov.analysis("bar_4.html") self.assertEqual(statements, [1, 2, 3, 4]) self.assertEqual(missing, [1, 4]) - self.assertIn("bar_4.html", cov.data.line_counts()) + self.assertIn("bar_4.html", cov.get_data().line_counts()) - self.assertNotIn("quux_5.html", cov.data.line_counts()) + self.assertNotIn("quux_5.html", cov.get_data().line_counts()) _, statements, missing, _ = cov.analysis("uni_3.html") self.assertEqual(statements, [1, 2, 3]) self.assertEqual(missing, [1]) - self.assertIn("uni_3.html", cov.data.line_counts()) + self.assertIn("uni_3.html", cov.get_data().line_counts()) def test_plugin2_with_branch(self): self.make_render_and_caller() diff --git a/tests/test_process.py b/tests/test_process.py index 18564cb8..b4a88178 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for process behavior of coverage.py.""" @@ -585,8 +585,32 @@ class ProcessTest(CoverageTest): self.assertIn("Trace function changed", out) + def test_warn_preimported(self): + self.make_file("hello.py", """\ + import goodbye + import coverage + cov = coverage.Coverage(include=["good*"], check_preimported=True) + cov.start() + print(goodbye.f()) + cov.stop() + """) + self.make_file("goodbye.py", """\ + def f(): + return "Goodbye!" + """) + goodbye_path = os.path.abspath("goodbye.py") + + out = self.run_command("python hello.py") + self.assertIn("Goodbye!", out) + + msg = ( + "Coverage.py warning: " + "Already imported a file that will be measured: {0} " + "(already-imported)").format(goodbye_path) + self.assertIn(msg, out) + def test_note(self): - if env.PYPY and env.PY3 and env.PYPYVERSION[:3] == (5, 10, 0): + if env.PYPY and env.PY3 and env.PYPYVERSION[:3] == (5, 10, 0): # pragma: obscure # https://bitbucket.org/pypy/pypy/issues/2729/pypy3-510-incorrectly-decodes-astral-plane self.skipTest("Avoid incorrect decoding astral plane JSON chars") self.make_file(".coveragerc", """\ @@ -635,9 +659,6 @@ class ProcessTest(CoverageTest): self.assertGreater(data.line_counts()['os.py'], 50) def test_lang_c(self): - if env.PY3 and sys.version_info < (3, 4): - # Python 3.3 can't compile the non-ascii characters in the file name. - self.skipTest("3.3 can't handle this test") if env.JYTHON: # Jython as of 2.7.1rc3 won't compile a filename that isn't utf8. self.skipTest("Jython can't handle this test") @@ -666,6 +687,11 @@ class ProcessTest(CoverageTest): import coverage print("No warnings!") """) + + # Some of our testing infrastructure can issue warnings. + # Turn it all off for the sub-process. + self.del_environ("COVERAGE_TESTING") + out = self.run_command("python allok.py") self.assertEqual(out, "No warnings!\n") @@ -676,9 +702,11 @@ class ProcessTest(CoverageTest): pass """) self.make_file("run_twice.py", """\ + import sys import coverage - for _ in [1, 2]: + for i in [1, 2]: + sys.stderr.write("Run %s\\n" % i) inst = coverage.Coverage(source=['foo']) inst.load() inst.start() @@ -689,15 +717,13 @@ class ProcessTest(CoverageTest): out = self.run_command("python run_twice.py") self.assertEqual( out, + "Run 1\n" + "Run 2\n" "Coverage.py warning: Module foo was previously imported, but not measured " "(module-not-measured)\n" ) def test_module_name(self): - if sys.version_info < (2, 7): - # Python 2.6 thinks that coverage is a package that can't be - # executed - self.skipTest("-m doesn't work the same < Python 2.7") # https://bitbucket.org/ned/coveragepy/issues/478/help-shows-silly-program-name-when-running out = self.run_command("python -m coverage") self.assertIn("Use 'coverage help' for help", out) @@ -739,7 +765,7 @@ class EnvironmentTest(CoverageTest): self.assert_tryexecfile_output(out_cov, out_py) def test_coverage_run_dir_is_like_python_dir(self): - if sys.version_info == (3, 5, 4, 'final', 0): + if env.PYVERSION == (3, 5, 4, 'final', 0): # pragma: obscure self.skipTest("3.5.4 broke this: https://bugs.python.org/issue32551") with open(TRY_EXECFILE) as f: self.make_file("with_main/__main__.py", f.read()) @@ -819,10 +845,6 @@ class EnvironmentTest(CoverageTest): self.assert_tryexecfile_output(out_cov, out_py) def test_coverage_run_dashm_is_like_python_dashm_with__main__207(self): - if sys.version_info < (2, 7): - # Coverage.py isn't bug-for-bug compatible in the behavior - # of -m for Pythons < 2.7 - self.skipTest("-m doesn't work the same < Python 2.7") # https://bitbucket.org/ned/coveragepy/issue/207 self.make_file("package/__init__.py", "print('init')") self.make_file("package/__main__.py", "print('main')") diff --git a/tests/test_python.py b/tests/test_python.py index 9027aa6c..441ef499 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests of coverage/python.py""" diff --git a/tests/test_results.py b/tests/test_results.py index deaf8113..307ef762 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.py's results analysis.""" diff --git a/tests/test_setup.py b/tests/test_setup.py index 78fcefc9..d786ca05 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests of miscellaneous stuff.""" @@ -28,7 +28,7 @@ class SetupPyTest(CoverageTest): out = output.splitlines() self.assertIn("measurement", out[0]) self.assertEqual(coverage.__version__, out[1]) - self.assertIn("bitbucket.org/ned/coveragepy", out[2]) + self.assertIn("github.com/nedbat/coveragepy", out[2]) self.assertIn("Ned Batchelder", out[3]) def test_more_metadata(self): diff --git a/tests/test_summary.py b/tests/test_summary.py index 44defa5b..b2895370 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Test text-based summary reporting for coverage.py""" @@ -33,6 +33,14 @@ class SummaryTest(UsingModulesMixin, CoverageTest): a = 1 print('done') """) + self.omit_site_packages() + + def omit_site_packages(self): + """Write a .coveragerc file that will omit site-packages from reports.""" + self.make_file(".coveragerc", """\ + [report] + omit = */site-packages/* + """) def test_report(self): self.make_mycode() @@ -92,7 +100,8 @@ class SummaryTest(UsingModulesMixin, CoverageTest): # Try reporting while omitting some modules self.make_mycode() self.run_command("coverage run mycode.py") - report = self.report_from_command("coverage report --omit '%s/*'" % TESTS_DIR) + omit = '{}/*,*/site-packages/*'.format(TESTS_DIR) + report = self.report_from_command("coverage report --omit '{}'".format(omit)) # Name Stmts Miss Cover # ------------------------------- @@ -215,6 +224,7 @@ class SummaryTest(UsingModulesMixin, CoverageTest): print("y") branch(1, 1) """) + self.omit_site_packages() out = self.run_command("coverage run --branch mybranch.py") self.assertEqual(out, 'x\ny\n') report = self.report_from_command("coverage report --show-missing") @@ -243,6 +253,7 @@ class SummaryTest(UsingModulesMixin, CoverageTest): return x branch(1, 1, 0) """) + self.omit_site_packages() out = self.run_command("coverage run --branch main.py") self.assertEqual(out, 'x\ny\n') report = self.report_from_command("coverage report --show-missing") @@ -265,11 +276,12 @@ class SummaryTest(UsingModulesMixin, CoverageTest): def normal(): print("z") normal() - """) + """) self.make_file("not_covered.py", """ def not_covered(): print("n") - """) + """) + self.omit_site_packages() out = self.run_command("coverage run main.py") self.assertEqual(out, "z\n") report = self.report_from_command("coverage report --skip-covered --fail-under=70") @@ -298,18 +310,19 @@ class SummaryTest(UsingModulesMixin, CoverageTest): print("z") normal(True) normal(False) - """) + """) self.make_file("not_covered.py", """ def not_covered(n): if n: print("n") not_covered(True) - """) + """) self.make_file("covered.py", """ def foo(): pass foo() - """) + """) + self.omit_site_packages() out = self.run_command("coverage run --branch main.py") self.assertEqual(out, "n\nz\n") report = self.report_from_command("coverage report --skip-covered") @@ -338,17 +351,18 @@ class SummaryTest(UsingModulesMixin, CoverageTest): print("z") normal(True) normal(False) - """) + """) self.make_file("not_covered.py", """ def not_covered(n): if n: print("n") not_covered(True) - """) + """) self.make_file("also_not_run.py", """ def does_not_appear_in_this_film(ni): print("Ni!") """) + self.omit_site_packages() out = self.run_command("coverage run --branch main.py") self.assertEqual(out, "n\nz\n") report = self.report_from_command("coverage report --skip-covered") @@ -374,7 +388,7 @@ class SummaryTest(UsingModulesMixin, CoverageTest): def foo(): pass foo() - """) + """) out = self.run_command("coverage run --branch main.py") self.assertEqual(out, "") report = self.report_from_command("coverage report --skip-covered") @@ -393,7 +407,7 @@ class SummaryTest(UsingModulesMixin, CoverageTest): def foo(): pass foo() - """) + """) out = self.run_command("coverage run --branch long_______________filename.py") self.assertEqual(out, "") report = self.report_from_command("coverage report --skip-covered") @@ -424,6 +438,7 @@ class SummaryTest(UsingModulesMixin, CoverageTest): self.make_file(".coveragerc", """\ [report] precision = 3 + omit = */site-packages/* """) self.make_file("main.py", """ import not_covered, covered @@ -433,18 +448,18 @@ class SummaryTest(UsingModulesMixin, CoverageTest): print("z") normal(True) normal(False) - """) + """) self.make_file("not_covered.py", """ def not_covered(n): if n: print("n") not_covered(True) - """) + """) self.make_file("covered.py", """ def foo(): pass foo() - """) + """) out = self.run_command("coverage run --branch main.py") self.assertEqual(out, "n\nz\n") report = self.report_from_command("coverage report") @@ -756,7 +771,7 @@ class TestSummaryReporterConfiguration(CoverageTest): cov = Coverage() cov.start() cov.stop() # pragma: nested - cov.data = coverage_data + cov._data = coverage_data printer = SummaryReporter(cov, options) destination = StringIO() printer.report([], destination) diff --git a/tests/test_templite.py b/tests/test_templite.py index bcc65f94..16942db8 100644 --- a/tests/test_templite.py +++ b/tests/test_templite.py @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.templite.""" diff --git a/tests/test_testing.py b/tests/test_testing.py index 05bf0c92..d8cd0ef0 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests that our test infrastructure is really working!""" diff --git a/tests/test_version.py b/tests/test_version.py index eb8de875..11b180d5 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests of version.py.""" diff --git a/tests/test_xml.py b/tests/test_xml.py index b49debc9..acb82a48 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -1,6 +1,6 @@ # coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for XML reports from coverage.py.""" diff --git a/tox-new.ini b/tox-new.ini deleted file mode 100644 index bc5f041a..00000000 --- a/tox-new.ini +++ /dev/null @@ -1,53 +0,0 @@ -# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt - -# An experiment in using tox to install the sdist, and do the pytracer/ctracer -# split. Doesn't yet work because the working tree is in the import path, so -# "import coverage" finds the working tree instead of the sdist-installed code. -# This can be fixed one of two ways: -# -# 1. By changing to a "src" layout, so that "import coverage" won't work in the -# working tree, or -# -# 2. By removing the "__init__.py" from the tests directory, so that nose won't -# add the working tree to the path. This will also mean changing a number of -# import statements in the tests directory. - -[tox] -envlist = py{26,27,33,34,35}-{c,py}tracer, pypy{24,26,3_24}-pytracer -skip_missing_interpreters = True - -[testenv] -commands = - # Create tests/zipmods.zip, install the egg1 egg - python igor.py zip_mods install_egg - - # Remove the C extension so that we can test the PyTracer - pytracer: python igor.py remove_extension - pytracer: python igor.py test_with_tracer py {posargs} - - ctracer: python igor.py test_with_tracer c {posargs} - -deps = - # https://requires.io/github/nedbat/coveragepy/requirements/ - nose==1.3.7 - mock==1.3.0 - PyContracts==1.7.6 - py26: unittest2==1.1.0 - py{26,27}: gevent==1.0.2 - py{26,27}: eventlet==0.17.4 - py{26,27,33,34,35}: greenlet==0.4.9 - -passenv = COVERAGE_* - -[testenv:pypy] -basepython = pypy - -[testenv:pypy24] -basepython = pypy2.4 - -[testenv:pypy26] -basepython = pypy2.6 - -[testenv:pypy3_24] -basepython = pypy3-2.4 @@ -1,8 +1,8 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt [tox] -envlist = py{26,27,33,34,35,36,37}, pypy{2,3}, jython, doc, lint +envlist = py{27,34,35,36,37}, pypy{2,3}, doc, lint skip_missing_interpreters = {env:COVERAGE_SKIP_MISSING_INTERPRETERS:True} toxworkdir = {env:TOXWORKDIR:.tox} @@ -10,20 +10,19 @@ toxworkdir = {env:TOXWORKDIR:.tox} usedevelop = True deps = - # https://requires.io/github/nedbat/coveragepy/requirements/ + # Check here for what might be out of date: + # https://requires.io/github/nedbat/coveragepy/requirements/ -rrequirements/pytest.pip - pip==9.0.1 - # setuptools>=36 vendors packages which pollute the coverage output in tests - setuptools==35.0.2 + pip==10.0.1 + setuptools==39.2.0 mock==2.0.0 - PyContracts==1.8.0 + PyContracts==1.8.3 unittest-mixins==1.4 #-e/Users/ned/unittest_mixins - py26: unittest2==1.1.0 - py{27,33,34,35,36}: gevent==1.2.2 - py26: eventlet==0.21.0 - py{27,33,34,35,36,37}: eventlet==0.22.0 - py{26,27,33,34,35,36,37}: greenlet==0.4.13 + # gevent 1.3 causes a failure: https://bitbucket.org/ned/coveragepy/issues/663/gevent-132-on-windows-fails + py{27,34,35,36}: gevent==1.2.2 + py{27,34,35,36,37}: eventlet==0.23.0 + py{27,34,35,36,37}: greenlet==0.4.13 # Windows can't update the pip version with pip running, so use Python # to install things. @@ -43,13 +42,6 @@ commands = # Remove the C extension so that we can test the PyTracer python igor.py zip_mods install_egg remove_extension - # When running parallel tests, many processes might all try to import the - # same modules at once. This should be safe, but especially on Python 3.3, - # this caused a number of test failures trying to import usepkgs. To - # prevent the race condition, pre-compile the tests/modules directory. - py33: python -m compileall -q -f tests/modules - py33: python -c "import time; time.sleep(1.1)" - # Test with the PyTracer python igor.py test_with_tracer py {posargs} @@ -57,9 +49,6 @@ commands = python setup.py --quiet build_ext --inplace python igor.py test_with_tracer c {posargs} -[testenv:py26] -install_command = python -m pip.__main__ install -U {opts} {packages} - [testenv:pypy] # The "pypy" environment is for Travis. Probably can make Travis use one of # the other environments... @@ -93,6 +82,17 @@ setenv = LINTABLE = coverage tests igor.py setup.py __main__.py commands = - python -m pylint --notes= {env:LINTABLE} python -m tabnanny {env:LINTABLE} python igor.py check_eol + check-manifest --ignore 'lab*,perf*,doc/sample_html*,.treerc' + python setup.py check -r -s + python -m pylint --notes= {env:LINTABLE} + +[travis] +python = + 2.7: py27, lint + 3.4: py34 + 3.5: py35 + 3.6: py36 + pypy: pypy + pypy3.5: pypy3 diff --git a/tox_wheels.ini b/tox_wheels.ini index 12f4a129..7381cafb 100644 --- a/tox_wheels.ini +++ b/tox_wheels.ini @@ -1,15 +1,15 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt [tox] -envlist = py{26,27,33,34,35,36,37,sys} +envlist = py{27,34,35,36,37,sys} toxworkdir = {toxinidir}/.tox_kits [testenv] deps = -rrequirements/wheel.pip -commands = +commands = python -c "import sys; print(sys.real_prefix)" python setup.py bdist_wheel {posargs} |