Skip to content

Commit

Permalink
Enable branch coverage, get it to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Feb 14, 2019
1 parent e9b2e2d commit 872adc1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[run]
source = check_python_versions
cover_pylib = False
branch = True

[report]
exclude_lines =
Expand Down
17 changes: 17 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,33 @@ def test_get_travis_yml_python_versions(tmp_path):
matrix:
include:
- python: 3.7
- name: something unrelated
jobs:
include:
- python: 3.4
- name: something unrelated
env:
- TOXENV=py35-docs
- UNRELATED=variable
"""))
assert cpv.get_travis_yml_python_versions(travis_yml) == [
'2.7', '3.4', '3.5', '3.6', '3.7',
]


@needs_pyyaml
def test_get_travis_yml_python_versions_no_python_only_matrix(tmp_path):
travis_yml = tmp_path / ".travis.yml"
travis_yml.write_text(textwrap.dedent("""\
matrix:
include:
- python: 3.7
"""))
assert cpv.get_travis_yml_python_versions(travis_yml) == [
'3.7',
]


@pytest.mark.parametrize('s, expected', [
(3.6, '3.6'),
('3.7', '3.7'),
Expand Down Expand Up @@ -390,6 +406,7 @@ def test_get_appveyor_yml_python_versions(tmp_path):
- PYTHON: c:\\python27-x64
- PYTHON: c:\\python36
- PYTHON: c:\\python36-x64
UNRELATED: variable
"""))
assert cpv.get_appveyor_yml_python_versions(appveyor_yml) == [
'2.7', '3.6',
Expand Down

0 comments on commit 872adc1

Please sign in to comment.