Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wemake-services/coverage-conditional-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.3.1
Choose a base ref
...
head repository: wemake-services/coverage-conditional-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 7, 2020

  1. Bump coverage from 5.1 to 5.2 (#22)

    Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.1 to 5.2.
    - [Release notes](https://github.com/nedbat/coveragepy/releases)
    - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
    - [Commits](nedbat/coveragepy@coverage-5.1...coverage-5.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jul 7, 2020
    Copy the full SHA
    7b064a0 View commit details

Commits on Jul 13, 2020

  1. Bump pytest-randomly from 3.4.0 to 3.4.1 (#23)

    Bumps [pytest-randomly](https://github.com/pytest-dev/pytest-randomly) from 3.4.0 to 3.4.1.
    - [Release notes](https://github.com/pytest-dev/pytest-randomly/releases)
    - [Changelog](https://github.com/pytest-dev/pytest-randomly/blob/master/HISTORY.rst)
    - [Commits](pytest-dev/pytest-randomly@3.4.0...3.4.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jul 13, 2020
    Copy the full SHA
    5d57642 View commit details

Commits on Jul 24, 2020

  1. Bump flake8-pytest-style from 1.2.1 to 1.2.2 (#24)

    Bumps [flake8-pytest-style](https://github.com/m-burst/flake8-pytest-style) from 1.2.1 to 1.2.2.
    - [Release notes](https://github.com/m-burst/flake8-pytest-style/releases)
    - [Commits](m-burst/flake8-pytest-style@v1.2.1...v1.2.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jul 24, 2020
    Copy the full SHA
    bc1c29b View commit details

Commits on Jul 30, 2020

  1. Bump wemake-python-styleguide from 0.14.0 to 0.14.1 (#25)

    Bumps [wemake-python-styleguide](https://github.com/wemake-services/wemake-python-styleguide) from 0.14.0 to 0.14.1.
    - [Release notes](https://github.com/wemake-services/wemake-python-styleguide/releases)
    - [Changelog](https://github.com/wemake-services/wemake-python-styleguide/blob/master/CHANGELOG.md)
    - [Commits](wemake-services/wemake-python-styleguide@0.14.0...0.14.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jul 30, 2020
    Copy the full SHA
    9586995 View commit details
  2. Bump pytest from 5.4.3 to 6.0.0 (#26)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.3 to 6.0.0.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@5.4.3...6.0.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jul 30, 2020
    Copy the full SHA
    55f56b2 View commit details
  3. Bump coverage from 5.2 to 5.2.1 (#27)

    Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2 to 5.2.1.
    - [Release notes](https://github.com/nedbat/coveragepy/releases)
    - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
    - [Commits](nedbat/coveragepy@coverage-5.2...coverage-5.2.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jul 30, 2020
    Copy the full SHA
    55d6007 View commit details

Commits on Jul 31, 2020

  1. Bump pytest from 6.0.0 to 6.0.1 (#28)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.0 to 6.0.1.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.0.0...6.0.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jul 31, 2020
    Copy the full SHA
    40c42a9 View commit details

Commits on Aug 7, 2020

  1. Bump flake8-pytest-style from 1.2.2 to 1.2.3 (#29)

    Bumps [flake8-pytest-style](https://github.com/m-burst/flake8-pytest-style) from 1.2.2 to 1.2.3.
    - [Release notes](https://github.com/m-burst/flake8-pytest-style/releases)
    - [Commits](m-burst/flake8-pytest-style@v1.2.2...v1.2.3)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Aug 7, 2020
    Copy the full SHA
    117f265 View commit details

Commits on Aug 17, 2020

  1. Bump pytest-cov from 2.10.0 to 2.10.1 (#30)

    Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.10.0 to 2.10.1.
    - [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
    - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest-cov@v2.10.0...v2.10.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Aug 17, 2020
    Copy the full SHA
    9c4df13 View commit details

Commits on Aug 31, 2020

  1. Bump flake8-pytest-style from 1.2.3 to 1.3.0 (#31)

    Bumps [flake8-pytest-style](https://github.com/m-burst/flake8-pytest-style) from 1.2.3 to 1.3.0.
    - [Release notes](https://github.com/m-burst/flake8-pytest-style/releases)
    - [Commits](m-burst/flake8-pytest-style@v1.2.3...v1.3.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Aug 31, 2020
    Copy the full SHA
    b9cf1b5 View commit details

Commits on Sep 14, 2020

  1. Bump coverage from 5.2.1 to 5.3 (#33)

    Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2.1 to 5.3.
    - [Release notes](https://github.com/nedbat/coveragepy/releases)
    - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
    - [Commits](nedbat/coveragepy@coverage-5.2.1...coverage-5.3)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Sep 14, 2020
    Copy the full SHA
    9ccba8f View commit details
  2. Bump pytest from 6.0.1 to 6.0.2 (#32)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.1 to 6.0.2.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.0.1...6.0.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Sep 14, 2020
    Copy the full SHA
    711a8ed View commit details

Commits on Sep 19, 2020

  1. Bump nitpick from 0.22.2 to 0.23.0 (#34)

    Bumps [nitpick](https://github.com/andreoliwa/nitpick) from 0.22.2 to 0.23.0.
    - [Release notes](https://github.com/andreoliwa/nitpick/releases)
    - [Changelog](https://github.com/andreoliwa/nitpick/blob/develop/CHANGELOG.md)
    - [Commits](andreoliwa/nitpick@v0.22.2...v0.23.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Sep 19, 2020
    Copy the full SHA
    46ddc0b View commit details

Commits on Sep 28, 2020

  1. Bump pytest from 6.0.2 to 6.1.0 (#36)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.2 to 6.1.0.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.0.2...6.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Sep 28, 2020
    Copy the full SHA
    3feac8b View commit details

Commits on Oct 5, 2020

  1. Bump pytest from 6.1.0 to 6.1.1 (#37)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.0 to 6.1.1.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.1.0...6.1.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Oct 5, 2020
    Copy the full SHA
    95ed11f View commit details

Commits on Oct 10, 2020

  1. Bump mypy from 0.782 to 0.790 (#38)

    Bumps [mypy](https://github.com/python/mypy) from 0.782 to 0.790.
    - [Release notes](https://github.com/python/mypy/releases)
    - [Commits](python/mypy@v0.782...v0.790)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Oct 10, 2020
    Copy the full SHA
    28e351d View commit details

Commits on Oct 29, 2020

  1. Bump pytest from 6.1.1 to 6.1.2 (#41)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.1 to 6.1.2.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.1.1...6.1.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Oct 29, 2020
    Copy the full SHA
    bb26ba3 View commit details

Commits on Nov 3, 2020

  1. Bump nitpick from 0.23.0 to 0.23.1 (#42)

    Bumps [nitpick](https://github.com/andreoliwa/nitpick) from 0.23.0 to 0.23.1.
    - [Release notes](https://github.com/andreoliwa/nitpick/releases)
    - [Changelog](https://github.com/andreoliwa/nitpick/blob/develop/CHANGELOG.md)
    - [Commits](andreoliwa/nitpick@v0.23.0...v0.23.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Nov 3, 2020
    Copy the full SHA
    a73b717 View commit details

Commits on Nov 17, 2020

  1. Bump pytest-randomly from 3.4.1 to 3.5.0 (#43)

    Bumps [pytest-randomly](https://github.com/pytest-dev/pytest-randomly) from 3.4.1 to 3.5.0.
    - [Release notes](https://github.com/pytest-dev/pytest-randomly/releases)
    - [Changelog](https://github.com/pytest-dev/pytest-randomly/blob/master/HISTORY.rst)
    - [Commits](pytest-dev/pytest-randomly@3.4.1...3.5.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Nov 17, 2020
    Copy the full SHA
    9f9b682 View commit details
  2. Update misspell.yml

    sobolevn authored Nov 17, 2020
    Copy the full SHA
    125b00a View commit details

Commits on Nov 30, 2020

  1. Bump packaging from 20.4 to 20.7 (#44)

    Bumps [packaging](https://github.com/pypa/packaging) from 20.4 to 20.7.
    - [Release notes](https://github.com/pypa/packaging/releases)
    - [Changelog](https://github.com/pypa/packaging/blob/master/CHANGELOG.rst)
    - [Commits](pypa/packaging@20.4...20.7)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Nov 30, 2020
    Copy the full SHA
    a8be40a View commit details

Commits on Dec 14, 2020

  1. Bump packaging from 20.7 to 20.8 (#47)

    Bumps [packaging](https://github.com/pypa/packaging) from 20.7 to 20.8.
    - [Release notes](https://github.com/pypa/packaging/releases)
    - [Changelog](https://github.com/pypa/packaging/blob/master/CHANGELOG.rst)
    - [Commits](pypa/packaging@20.7...20.8)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Dec 14, 2020
    Copy the full SHA
    e9bad71 View commit details
  2. Bump pytest from 6.1.2 to 6.2.0 (#46)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.2 to 6.2.0.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.1.2...6.2.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Dec 14, 2020
    Copy the full SHA
    20c3010 View commit details

Commits on Dec 16, 2020

  1. Bump pytest from 6.2.0 to 6.2.1 (#48)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.0 to 6.2.1.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.2.0...6.2.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Dec 16, 2020
    Copy the full SHA
    7083ceb View commit details

Commits on Dec 21, 2020

  1. Bump coverage from 5.3 to 5.3.1 (#50)

    Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3 to 5.3.1.
    - [Release notes](https://github.com/nedbat/coveragepy/releases)
    - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
    - [Commits](nedbat/coveragepy@coverage-5.3...coverage-5.3.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Dec 21, 2020
    Copy the full SHA
    1462207 View commit details
  2. Bump safety from 1.9.0 to 1.10.0 (#49)

    Bumps [safety](https://github.com/pyupio/safety) from 1.9.0 to 1.10.0.
    - [Release notes](https://github.com/pyupio/safety/releases)
    - [Changelog](https://github.com/pyupio/safety/blob/master/HISTORY.rst)
    - [Commits](pyupio/safety@1.9.0...1.10.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Dec 21, 2020
    Copy the full SHA
    b5993ef View commit details

Commits on Jan 5, 2021

  1. Updates deps

    sobolevn committed Jan 5, 2021
    Copy the full SHA
    a510b8a View commit details

Commits on Jan 12, 2021

  1. Bump safety from 1.10.1 to 1.10.2 (#52)

    Bumps [safety](https://github.com/pyupio/safety) from 1.10.1 to 1.10.2.
    - [Release notes](https://github.com/pyupio/safety/releases)
    - [Changelog](https://github.com/pyupio/safety/blob/master/HISTORY.rst)
    - [Commits](pyupio/safety@1.10.1...1.10.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jan 12, 2021
    Copy the full SHA
    ed583b8 View commit details

Commits on Jan 18, 2021

  1. Bump safety from 1.10.2 to 1.10.3 (#54)

    Bumps [safety](https://github.com/pyupio/safety) from 1.10.2 to 1.10.3.
    - [Release notes](https://github.com/pyupio/safety/releases)
    - [Changelog](https://github.com/pyupio/safety/blob/master/HISTORY.rst)
    - [Commits](pyupio/safety@1.10.2...1.10.3)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jan 18, 2021
    Copy the full SHA
    d84269f View commit details

Commits on Jan 19, 2021

  1. Bump pytest-cov from 2.10.1 to 2.11.0 (#55)

    Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.10.1 to 2.11.0.
    - [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
    - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest-cov@v2.10.1...v2.11.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jan 19, 2021
    Copy the full SHA
    ab1de09 View commit details

Commits on Jan 21, 2021

  1. Bump pytest-cov from 2.11.0 to 2.11.1

    Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.11.0 to 2.11.1.
    - [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
    - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest-cov@v2.11.0...v2.11.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Jan 21, 2021
    Copy the full SHA
    6870513 View commit details
  2. Copy the full SHA
    fe3b8d5 View commit details

Commits on Jan 25, 2021

  1. Bump mypy from 0.790 to 0.800

    Bumps [mypy](https://github.com/python/mypy) from 0.790 to 0.800.
    - [Release notes](https://github.com/python/mypy/releases)
    - [Commits](python/mypy@v0.790...v0.800)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Jan 25, 2021
    Copy the full SHA
    4a7f808 View commit details
  2. Copy the full SHA
    0a607d9 View commit details

Commits on Jan 26, 2021

  1. Bump pytest from 6.2.1 to 6.2.2

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.1 to 6.2.2.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@6.2.1...6.2.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Jan 26, 2021
    Copy the full SHA
    0c56b23 View commit details
  2. Copy the full SHA
    0eda640 View commit details

Commits on Jan 27, 2021

  1. Bump coverage from 5.3.1 to 5.4

    Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3.1 to 5.4.
    - [Release notes](https://github.com/nedbat/coveragepy/releases)
    - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
    - [Commits](nedbat/coveragepy@coverage-5.3.1...coverage-5.4)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Jan 27, 2021
    Copy the full SHA
    5336853 View commit details
  2. Copy the full SHA
    bacedf0 View commit details

Commits on Feb 1, 2021

  1. Bump packaging from 20.8 to 20.9

    Bumps [packaging](https://github.com/pypa/packaging) from 20.8 to 20.9.
    - [Release notes](https://github.com/pypa/packaging/releases)
    - [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
    - [Commits](pypa/packaging@20.8...20.9)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Feb 1, 2021
    Copy the full SHA
    8f6e826 View commit details
  2. Copy the full SHA
    e70b437 View commit details

Commits on Feb 13, 2021

  1. wps@0.15.1

    sobolevn committed Feb 13, 2021
    Copy the full SHA
    34183ec View commit details
  2. wps@0.15.1

    sobolevn committed Feb 13, 2021
    Copy the full SHA
    734e671 View commit details
  3. wps@0.15.1

    sobolevn committed Feb 13, 2021
    Copy the full SHA
    48371b9 View commit details

Commits on Feb 14, 2021

  1. wps@0.15.1

    sobolevn committed Feb 14, 2021
    Copy the full SHA
    1f8049b View commit details
  2. wps@0.15.1

    sobolevn committed Feb 14, 2021
    Copy the full SHA
    0c53d6e View commit details

Commits on Feb 22, 2021

  1. Bump mypy from 0.800 to 0.812

    Bumps [mypy](https://github.com/python/mypy) from 0.800 to 0.812.
    - [Release notes](https://github.com/python/mypy/releases)
    - [Commits](python/mypy@v0.800...v0.812)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Feb 22, 2021
    Copy the full SHA
    81fda01 View commit details
  2. Copy the full SHA
    b715d93 View commit details

Commits on Feb 24, 2021

  1. Bump nitpick from 0.23.1 to 0.24.0

    Bumps [nitpick](https://github.com/andreoliwa/nitpick) from 0.23.1 to 0.24.0.
    - [Release notes](https://github.com/andreoliwa/nitpick/releases)
    - [Changelog](https://github.com/andreoliwa/nitpick/blob/develop/CHANGELOG.md)
    - [Commits](andreoliwa/nitpick@v0.23.1...v0.24.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Feb 24, 2021
    Copy the full SHA
    7fb50f4 View commit details
  2. Copy the full SHA
    6086e06 View commit details

Commits on Mar 1, 2021

  1. Bump coverage from 5.4 to 5.5

    Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.4 to 5.5.
    - [Release notes](https://github.com/nedbat/coveragepy/releases)
    - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
    - [Commits](nedbat/coveragepy@coverage-5.4...coverage-5.5)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Mar 1, 2021
    Copy the full SHA
    1ac01fc View commit details
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
time: "02:00"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "02:00"
open-pull-requests-limit: 10
19 changes: 0 additions & 19 deletions .github/workflows/misspell.yml

This file was deleted.

34 changes: 19 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
name: test

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: |
curl -sSL \
"https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python
- name: Set up cache
uses: actions/cache@v1
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
"https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py" | python
# Adding `poetry` to `$PATH`:
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
source "$HOME/.poetry/env"
poetry config virtualenvs.in-project true
poetry run pip install -U pip
poetry install
- name: Run checks
run: |
source "$HOME/.poetry/env"
make test
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,62 @@
We follow [Semantic Versions](https://semver.org/).


## Version 0.9.0

### Features

- Adds `python@3.11` support
- Now, only `coverage@7` is officially supported
- We can now omit whole modules,
using `[tool.coverage.coverage_conditional_plugin.omit]` feature
in TOML configuration files


## Version 0.8.0

### Features

- Bump `coverage` to `7.0`


## Version 0.7.0

### Features

- Use `importlib` instead of `pkg_resources` to get package version


## Version 0.6.0

### Features

- Drop `python3.6` support
- Adds `tests/` and `test_project/` to `sdist` distributions

### Misc

- Upgrades `poetry` to `1.2`


## Version 0.5.0

### Features

- `python3.10` support
- `coverage@6` support


## Version 0.4.0

### Features

- `python3.9` support

### Bugfixes

- Fixes that `packaging` restriction was too tight


## Version 0.3.1

### Bugfixes
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ unit:
package:
poetry check
poetry run pip check
poetry run safety check --bare --full-report
poetry run safety check --full-report

.PHONY: test
test: lint unit package
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -38,6 +38,11 @@ plugins =
coverage_conditional_plugin

[coverage:coverage_conditional_plugin]
# Here we specify files to conditionally omit:
omit =
"sys_platform == 'win32'":
"my_project/omit*.py"
"my_project/win.py"
# Here we specify our pragma rules:
rules =
"sys_version_info >= (3, 8)": py-gte-38
@@ -46,11 +51,16 @@ rules =
```

Or to your `pyproject.toml`:

```toml
[tool.coverage.run]
# Here we specify plugins for coverage to be used:
plugins = ["coverage_conditional_plugin"]

[tool.coverage.coverage_conditional_plugin.omit]
# Here we specify files to conditionally omit:
"sys_platform == 'win32'" = "my_project/omit*.py"

[tool.coverage.coverage_conditional_plugin.rules]
# Here we specify our pragma rules:
py-gte-38 = "sys_version_info >= (3, 8)"
@@ -128,11 +138,27 @@ get_env_info()
```


## License
## Writing omits

[MIT](https://github.com/wemake.services/coverage-conditional-plugin/blob/master/LICENSE)
Omits allow entire files to be conditionally omitted from coverage measurement.

The TOML format for omits is:

```toml
[tool.coverage.coverage_conditional_plugin.omit]
"pragma-condition" = ["project/prefix*.py", "project/filename.py"]
# or
"pragma-condition" = "project/filename.py"
```

**Note**: `ini` format is not supported for `omit` configuration option,
because there's no easy way to parse `ini` complex configuration.
PRs with the fix are welcome!

File name patterns should follow coverage.py's `[run] omit` syntax.
See [coverage.py](https://coverage.readthedocs.io/en/stable/source.html).

## Credits

This project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package). Current template version is: [a61725009d8399ae77376b5ad9de354214bc1159](https://github.com/wemake-services/wemake-python-package/tree/a61725009d8399ae77376b5ad9de354214bc1159). See what is [updated](https://github.com/wemake-services/wemake-python-package/compare/a61725009d8399ae77376b5ad9de354214bc1159...master) since then.
## License

[MIT](https://github.com/wemake.services/coverage-conditional-plugin/blob/master/LICENSE)
158 changes: 97 additions & 61 deletions coverage_conditional_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -2,14 +2,23 @@
import sys
import traceback
from importlib import import_module
from typing import ClassVar, Dict, Optional, Tuple, Union
from typing import Any, ClassVar, Dict, List, Tuple, Union

import pkg_resources
from coverage import CoveragePlugin
from coverage.config import CoverageConfig
from packaging import version
from packaging.markers import default_environment

from coverage_conditional_plugin.version import package_version

#: Used for `omit` specification.
_OmitConfigSpec = Dict[str, Union[str, List[str]]]

_INI_OMIT_ERROR = (
'Improperly configured: `ini` does not ' +
'support `omit` specification, ' +
'current setting is: {0}'
)


def get_env_info() -> Dict[str, object]:
"""Public helper to get the same env we pass to the plugin."""
@@ -20,33 +29,58 @@ def get_env_info() -> Dict[str, object]:
'sys_version_info': sys.version_info,
'os_environ': os.environ,
'is_installed': _is_installed,
'package_version': _package_version,
'package_version': package_version,
# We need this, otherwise `_should_be_applied` can generate a warning:
'sys': sys,
})
return env_info


class _ConditionalCovPlugin(CoveragePlugin):
_rules_opt_name: ClassVar[str] = 'coverage_conditional_plugin:rules'
# We use `exlude_line` and not `exclude_also`,
# because settings are already post-processed, which means that
# `exlude_line` and `exclude_also` are already joined:
_ignore_opt_name: ClassVar[str] = 'report:exclude_lines'
_omit_opt_name_plugin: ClassVar[str] = 'coverage_conditional_plugin:omit'
_omit_opt_name_coverage: ClassVar[str] = 'run:omit'

def configure(self, config: CoverageConfig) -> None:
def configure( # type: ignore[override]
self, config: CoverageConfig,
) -> None:
"""
Main hook for adding extra configuration.
Part of the ``coverage`` public API.
Called right after ``coverage_init`` function.
"""
self._configure_omits(config)
self._configure_rules(config)

def _configure_omits(self, config: CoverageConfig) -> None:
omits: Union[str, _OmitConfigSpec, None] = _get_option(
config,
self._omit_opt_name_plugin,
)
if omits is None:
return # No setting, ignoring
elif not isinstance(omits, dict):
raise RuntimeError(_INI_OMIT_ERROR.format(omits))

for code, patterns in omits.items():
if isinstance(patterns, str):
patterns = [patterns]
if _should_be_applied(code):
self._omit_pattern(config, patterns)

def _configure_rules(self, config: CoverageConfig) -> None:
try: # ini format
rules = filter(
bool,
config.get_option(self._rules_opt_name).splitlines(),
_get_option(config, self._rules_opt_name).splitlines(),
)

except AttributeError: # toml format
rules = (
rule for rule in
config.get_option(self._rules_opt_name).items()
)
rules = _get_option(config, self._rules_opt_name).items()

for rule in rules:
self._process_rule(config, rule)
@@ -62,52 +96,25 @@ def _process_rule(
code = rule[1]
else:
raise ValueError("Invalid type for 'rule'.")
if self._should_be_applied(code):
if _should_be_applied(code):
self._ignore_marker(config, marker)

def _should_be_applied(self, code: str) -> bool:
"""
Determines whether some specific marker should be applied or not.
Uses ``exec`` on the code you pass with the marker.
Be sure, that this code is safe.
We also try to provide useful global functions
to cover the most popular cases, like:
- python version
- OS name, platform, and version
- helpers to work with installed packages
Some examples:
.. code:: ini
[coverage:coverage_conditional_plugin]
rules =
"sys_version_info >= (3, 8)": py-gte-38
"is_installed('mypy')": has-mypy
So, code marked with `# pragma: py-gte-38` will be ignored
for all version of Python prior to 3.8 release.
And at the same time,
this code will be included to the coverage on 3.8+ releases.
"""
env_info = get_env_info()
try:
return eval(code, env_info) # noqa: WPS421, S307
except Exception:
msg = 'Exception during conditional coverage evaluation:'
print(msg, traceback.format_exc()) # noqa: WPS421
return False

def _ignore_marker(self, config: CoverageConfig, marker: str) -> None:
def _ignore_marker(
self, config: CoverageConfig, marker: str,
) -> None:
"""Adds a marker to the ignore list."""
exclude_lines = config.get_option(self._ignore_opt_name)
exclude_lines = _get_option(config, self._ignore_opt_name)
exclude_lines.append(marker)
config.set_option(self._ignore_opt_name, exclude_lines)

def _omit_pattern(
self, config: CoverageConfig, patterns: List[str],
) -> None:
"""Adds a file name pattern to the omit list."""
omit_patterns = _get_option(config, self._omit_opt_name_coverage)
omit_patterns.extend(patterns)
config.set_option(self._omit_opt_name_coverage, omit_patterns)


def _is_installed(package: str) -> bool:
"""Helper function to detect if some package is installed."""
@@ -118,20 +125,49 @@ def _is_installed(package: str) -> bool:
return True


def _package_version(
package: str,
) -> Optional[Tuple[int, ...]]:
def _should_be_applied(code: str) -> bool:
"""
Helper function that fetches distribution version.
Determines whether some specific marker should be applied or not.
Can throw multiple exceptions.
Be careful, use ``is_installed`` before using this one.
Uses ``exec`` on the code you pass with the marker.
Be sure, that this code is safe.
We also try to provide useful global functions
to cover the most popular cases, like:
- python version
- OS name, platform, and version
- helpers to work with installed packages
Some examples:
.. code:: ini
[coverage:coverage_conditional_plugin]
rules =
"sys_version_info >= (3, 8)": py-gte-38
"is_installed('mypy')": has-mypy
So, code marked with `# pragma: py-gte-38` will be ignored
for all version of Python prior to 3.8 release.
And at the same time,
this code will be included to the coverage on 3.8+ releases.
Returns parsed varsion to be easily worked with.
"""
return version.parse(
pkg_resources.get_distribution(package).version,
).release
env_info = get_env_info()
try:
return eval(code, env_info) # noqa: WPS421, S307
except Exception:
msg = 'Exception during conditional coverage evaluation:'
print(msg, traceback.format_exc()) # noqa: WPS421
return False


def _get_option( # type: ignore[misc]
config: CoverageConfig, option: str,
) -> Any:
# Hack to silence all new typing issues.
return config.get_option(option)


def coverage_init(reg, options) -> None:
22 changes: 22 additions & 0 deletions coverage_conditional_plugin/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Optional, Tuple

try: # pragma: no cover
from importlib.metadata import version as metadata_version
except ImportError: # pragma: no cover
from importlib_metadata import version as metadata_version # type: ignore

from packaging import version


def package_version(
package: str,
) -> Optional[Tuple[int, ...]]:
"""
Helper function that fetches distribution version.
Can throw multiple exceptions.
Be careful, use ``is_installed`` before using this one.
Returns parsed varsion to be easily worked with.
"""
return version.parse(metadata_version(package)).release
2,157 changes: 1,303 additions & 854 deletions poetry.lock

Large diffs are not rendered by default.

68 changes: 42 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,50 +1,66 @@
[build-system]
requires = ["poetry>=1.0"]
build-backend = "poetry.masonry.api"


[tool.nitpick]
style = "https://raw.githubusercontent.com/wemake-services/wemake-python-styleguide/master/styles/nitpick-style-wemake.toml"


[tool.poetry]
name = "coverage-conditional-plugin"
version = "0.3.1"
version = "0.9.0"
description = "Conditional coverage based on any rules you define!"
license = "MIT"

authors = []
authors = [
"sobolevn <mail@sobolevn.me>"
]

# This is required for source distributions, like the one
# used for Alpine linux. See #157
include = [
{path = 'tests/*', format = 'sdist'},
{path = 'test_project/*', format = 'sdist'},
]
readme = "README.md"

repository = "https://github.com/wemake-services/coverage-conditional-plugin"

keywords = []
keywords = [
"coverage",
"coverage.py",
"pytest-cov",
"testing",
]

classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
]

[tool.poetry.urls]
"Funding" = "https://github.com/sponsors/wemake-services"

[tool.poetry.dependencies]
python = "^3.6"
python = "^3.7"

coverage = ">=7,<8"
packaging = ">=20.4"
importlib_metadata = { version = "*", python = "<3.10" }

[tool.poetry.group.test.dependencies]
mypy = "^1.3"
types-setuptools = "^65.3"

coverage = "^5.0"
packaging = "^20.4"
wemake-python-styleguide = "^0.17"
flake8-pytest-style = "^1.5"
nitpick = "^0.33"

safety = "^2.3"

[tool.poetry.dev-dependencies]
mypy = "^0.782"
pytest = "^7.3"
pytest-cov = "^3.0"
pytest-randomly = "^3.12"

wemake-python-styleguide = "^0.14"
flake8-pytest-style = "^1.2"
nitpick = "^0.22"

safety = "^1.8"
[build-system]
requires = ["poetry_core>=1.6.0"]
build-backend = "poetry.core.masonry.api"


pytest = "^5.4"
pytest-cov = "^2.10"
pytest-randomly = "^3.4"
pytest-pythonpath = "^0.7"
[tool.nitpick]
style = "https://raw.githubusercontent.com/wemake-services/wemake-python-styleguide/master/styles/nitpick-style-wemake.toml"
80 changes: 43 additions & 37 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -6,16 +6,21 @@
# Base flake8 configuration:
# https://flake8.pycqa.org/en/latest/user/configuration.html
format = wemake
show-source = True
statistics = False
doctests = True
show-source = true
statistics = false
doctests = true

# darglint configuration:
# https://github.com/terrencepreilly/darglint
strictness = long
docstring-style = numpy

# Plugins:
max-complexity = 6
max-line-length = 80

# wemake-python-styleguide settings:
i-control-code = False
i-control-code = false

# Custom ignore options:
ignore = D100, D104, D106, D401, W504, X100, RST303, RST304, DAR103, DAR203
@@ -26,25 +31,19 @@ extend-exclude =

# Ignoring some errors in some files:
per-file-ignores =
# we need nested import and block variable overlap for conditional
# importlib_metadata import
coverage_conditional_plugin/version.py: WPS433, WPS440
# Disable `test_project` complexity checks:
test_project/example.py: WPS202
# Enable `assert` keyword and magic numbers for tests:
tests/*.py: S101, WPS226, WPS432, WPS450


[isort]
# isort configuration:
# https://github.com/timothycrosley/isort/wiki/isort-Settings
include_trailing_comma = true
use_parentheses = true
default_section = FIRSTPARTY
# See https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output = 3
line_length = 80


[darglint]
# darglint configuration:
# https://github.com/terrencepreilly/darglint
strictness = long
profile = wemake


[tool:pytest]
@@ -53,15 +52,19 @@ norecursedirs = *.egg .eggs dist build docs .tox .git __pycache__

# PYTHONPATH configuration:
# https://github.com/bigsassy/pytest-pythonpath
python_paths = ./test_project
pythonpath = ./test_project

# Strict `@xfail` by default:
xfail_strict = true

# Extra options:
addopts =
--strict
--strict-markers
--strict-config
--tb=short
--doctest-modules
--cov=test_project
--cov-fail-under=80
--cov-fail-under=63
--cov-report=term:skip-covered
--cov-report=html
--cov-report=xml
@@ -70,21 +73,24 @@ addopts =

[mypy]
# mypy configurations: http://bit.ly/2zEl9WI
allow_redefinition = False
check_untyped_defs = True
disallow_any_explicit = True
disallow_any_generics = True
disallow_untyped_calls = True
ignore_errors = False
ignore_missing_imports = True
implicit_reexport = False
local_partial_types = True
strict_optional = True
strict_equality = True
no_implicit_optional = True
warn_no_return = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unreachable = True

allow_redefinition = false
check_untyped_defs = true
disallow_any_explicit = true
disallow_any_generics = true
disallow_untyped_calls = true
ignore_errors = false
ignore_missing_imports = true
implicit_reexport = false
local_partial_types = true
strict_optional = true
strict_equality = true
no_implicit_optional = true
warn_no_return = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true

[mypy-coverage_conditional_plugin.version]
# We allow unused `ignore` comments, because we cannot sync it between versions:
warn_unused_ignores = false
14 changes: 14 additions & 0 deletions test_project/.coveragerc
Original file line number Diff line number Diff line change
@@ -3,8 +3,22 @@ branch = true
plugins =
coverage_conditional_plugin

[report]
exclude_also =
raise NotImplementedError

[coverage_conditional_plugin]
# TODO: not supported, you can write parser similar to
# https://github.com/PyCQA/flake8/blob/c8d75d9966c074770695cd44e2c2e9d8488761e7/src/flake8/utils.py#L61
# But, I don't have time for it now.
# omit =
# "os_environ.get('OMIT_FILES')":
# "test_project/omit*.py",
# "test_project/compat.py"
rules =
"sys_version_info >= (3, 6)": py-gte-36
"sys_version_info >= (3, 7)": py-gte-37
"sys_version_info >= (3, 8)": py-gte-38
"sys_version_info >= (3, 9)": py-gte-39
"sys.version_info >= (3, 10)": py-gte-310
"sys.version_info >= (3, 11)": py-gte-311
3 changes: 3 additions & 0 deletions test_project/compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def uncovered() -> str:
"""Test function that is uncovered."""
return 'uncovered'
17 changes: 15 additions & 2 deletions test_project/example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# -*- coding: utf-8 -*-

from typing import Tuple


def if_gte_python311() -> Tuple[int, int]: # pragma: py-gte-311
"""Test function for pragma ``py-gte-311``."""
return (3, 11)


def if_gte_python310() -> Tuple[int, int]: # pragma: py-gte-310
"""Test function for pragma ``py-gte-310``."""
return (3, 10)


def if_gte_python39() -> Tuple[int, int]: # pragma: py-gte-39
"""Test function for pragma ``py-gte-39``."""
return (3, 9)


def if_gte_python38() -> Tuple[int, int]: # pragma: py-gte-38
"""Test function for pragma ``py-gte-38``."""
return (3, 8)
3 changes: 3 additions & 0 deletions test_project/omit1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def uncovered() -> str:
"""Test function that is uncovered."""
return 'uncovered'
3 changes: 3 additions & 0 deletions test_project/omit2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def uncovered() -> str:
"""Test function that is uncovered."""
return 'uncovered'
14 changes: 14 additions & 0 deletions test_project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
[tool.coverage.run]
plugins = ["coverage_conditional_plugin"]
omit = ["test_project/missing.py"]

[tool.coverage.report]
exclude_also = ['raise NotImplementedError']

[tool.coverage.coverage_conditional_plugin.omit]
"os_environ.get('OMIT1')" = [
"test_project/omit*.py",
"test_project/compat.py",
]
"os_environ.get('OMIT2')" = "test_project/compat.py"

[tool.coverage.coverage_conditional_plugin.rules]
py-gte-36 = "sys_version_info >= (3, 6)"
py-gte-37 = "sys_version_info >= (3, 7)"
py-gte-38 = "sys_version_info >= (3, 8)"
py-gte-39 = "sys_version_info >= (3, 9)"
py-gte-310 = "sys_version_info >= (3, 10)"
py-gte-311 = "sys_version_info >= (3, 11)"
9 changes: 4 additions & 5 deletions tests/test_implementation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

from coverage_conditional_plugin import _is_installed, _package_version
from coverage_conditional_plugin import _is_installed
from coverage_conditional_plugin.version import package_version


def test_is_installed():
@@ -12,8 +11,8 @@ def test_is_installed():

def test_package_version():
"""Ensures that ``_package_version`` is correct."""
coverage_version = _package_version('coverage')
pytest_version = _package_version('pytest')
coverage_version = package_version('coverage')
pytest_version = package_version('pytest')

assert coverage_version is not None
assert coverage_version < (1000, 0, 0)
31 changes: 25 additions & 6 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import json
import sys
from pathlib import Path
@@ -12,19 +10,38 @@
if_gte_python36,
if_gte_python37,
if_gte_python38,
if_gte_python39,
if_gte_python310,
if_gte_python311,
)

#: This is just our specific example.
_EXCUDED_LINES = (sys.version_info[1] - 6) * 3 + 6
# 3.11 = 21
# 3.10 = 18
# 3.9 = 15
# 3.8 = 12
# 3.7 = 9
# 3.6 = 6

#: This is just a result of the coverage run.
#: It might change if you add new files / change something in `test_project/`.
_COVERAGE_PERCENT = 63

#: Lines that are not convered due to `omit` setting:
_MISSING_LINES = 4 # 1 uncovered + 3 in omits


def test_integration(cov, capsys):
"""Ensures that coverage is executed correctly."""
assert if_gte_python36() != if_gte_python37() != if_gte_python38()
assert always() == 'always'
# We call all functions without any actual version checks.
if_gte_python36()
if_gte_python37()
if_gte_python38()
if_gte_python39()
if_gte_python310()
if_gte_python311()
always()

cov.json_report(outfile='-')
captured = capsys.readouterr()
@@ -33,8 +50,8 @@ def test_integration(cov, capsys):
assert len(
coverage['files']['test_project/example.py']['excluded_lines'],
) == _EXCUDED_LINES
assert int(coverage['totals']['percent_covered']) >= 80
assert coverage['totals']['missing_lines'] == 1
assert int(coverage['totals']['percent_covered']) >= _COVERAGE_PERCENT
assert coverage['totals']['missing_lines'] == _MISSING_LINES


@pytest.mark.parametrize('configfile', ['.coveragerc', 'pyproject.toml'])
@@ -53,3 +70,5 @@ def test_config_file_parsing(configfile):
'py-gte-3{minor_ver}'.format(minor_ver=sys.version_info[1])
in cov.config.exclude_list
)
# Default exclude must not be lost:
assert 'raise NotImplementedError' in cov.config.exclude_list
27 changes: 27 additions & 0 deletions tests/test_omits.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from pathlib import Path

import pytest
from coverage import Coverage

_OMIT_DEFAULT = 'test_project/missing.py'
_OMIT_GLOB = 'test_project/omit*.py'
_OMIT_FILE = 'test_project/compat.py'


@pytest.mark.parametrize(('env_key', 'omits'), [
('OMIT1', [_OMIT_DEFAULT, _OMIT_GLOB, _OMIT_FILE]),
('OMIT2', [_OMIT_DEFAULT, _OMIT_FILE]),
])
def test_omit1(monkeypatch, env_key, omits):
"""Ensures that coverage is executed correctly."""
monkeypatch.setenv(env_key, '1')
config_file_path = (
Path(__file__).parents[1] / 'test_project' / 'pyproject.toml'
)

cov = Coverage(config_file=str(config_file_path))

cov.start()
cov.stop()

assert cov.config.run_omit == omits
7 changes: 2 additions & 5 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-

import pytest

from coverage_conditional_plugin import _ConditionalCovPlugin
from coverage_conditional_plugin import _should_be_applied


@pytest.mark.parametrize('code', [
@@ -19,5 +17,4 @@
])
def test_plugin_should_be_applied(code):
"""Ensures code is evaluated correctly."""
plugin = _ConditionalCovPlugin()
assert plugin._should_be_applied(code) is True # noqa: WPS437
assert _should_be_applied(code) is True