Merge ~jugmac00/launchpadlib:add-coverage into launchpadlib:main

Proposed by Jürgen Gmach
Status: Merged
Approved by: Jürgen Gmach
Approved revision: 1bab9c2aae5d7b2acea2b41ea97e1449e54f7ac5
Merged at revision: 1bab9c2aae5d7b2acea2b41ea97e1449e54f7ac5
Proposed branch: ~jugmac00/launchpadlib:add-coverage
Merge into: launchpadlib:main
Diff against target: 105 lines (+42/-6)
5 files modified
.gitignore (+1/-0)
NEWS.rst (+5/-0)
setup.py (+5/-1)
src/launchpadlib/tests/test_launchpad.py (+6/-1)
tox.ini (+25/-4)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+417127@code.launchpad.net

Commit message

Create coverage report

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.gitignore b/.gitignore
index 49b5f97..22976f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ TAGS
10tags10tags
11_trial_temp11_trial_temp
12__pycache__12__pycache__
13.coverage
diff --git a/NEWS.rst b/NEWS.rst
index c8ca0bd..ac72636 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,11 @@
2NEWS for launchpadlib2NEWS for launchpadlib
3=====================3=====================
44
51.10.17 (unreleased)
6====================
7- Generate coverage report.
8- Use ``pytest`` as test runner.
9
51.10.16 (2022-01-21)101.10.16 (2022-01-21)
6====================11====================
7- Add ``pre-commit`` configuration.12- Add ``pre-commit`` configuration.
diff --git a/setup.py b/setup.py
index a21d134..68542cf 100755
--- a/setup.py
+++ b/setup.py
@@ -96,7 +96,11 @@ setup(
96 "wadllib",96 "wadllib",
97 ],97 ],
98 # Dependencies only needed by launchpadlib's own tests.98 # Dependencies only needed by launchpadlib's own tests.
99 "test": ['mock; python_version < "3"'],99 "test": [
100 "coverage",
101 'mock; python_version < "3"',
102 "pytest",
103 ],
100 },104 },
101 test_suite="launchpadlib.tests",105 test_suite="launchpadlib.tests",
102)106)
diff --git a/src/launchpadlib/tests/test_launchpad.py b/src/launchpadlib/tests/test_launchpad.py
index 933f60f..f0d2bd5 100644
--- a/src/launchpadlib/tests/test_launchpad.py
+++ b/src/launchpadlib/tests/test_launchpad.py
@@ -741,7 +741,12 @@ class TestDeprecatedLoginMethods(KeyringTest):
741 "ignore", r".*next release of cryptography"741 "ignore", r".*next release of cryptography"
742 )742 )
743 NoNetworkLaunchpad.get_token_and_login("consumer")743 NoNetworkLaunchpad.get_token_and_login("consumer")
744 self.assertEqual(len(caught), 1)744 self.assertEqual(
745 str(caught[0].message),
746 "The Launchpad.get_token_and_login() method is deprecated. "
747 "You should use Launchpad.login_anonymous() for anonymous "
748 "access and Launchpad.login_with() for all other purposes.",
749 )
745 self.assertEqual(caught[0].category, DeprecationWarning)750 self.assertEqual(caught[0].category, DeprecationWarning)
746751
747752
diff --git a/tox.ini b/tox.ini
index 49f3c6e..779e1da 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,11 +3,10 @@ envlist =
3 py27,py35,py36,py37,py38,py39,py310,lint,docs3 py27,py35,py36,py37,py38,py39,py310,lint,docs
44
5[testenv]5[testenv]
6commands =
7 zope-testrunner --test-path src --tests-pattern ^tests {posargs}
8deps =6deps =
9 .[testing,test]7 .[test,testing]
10 zope.testrunner8commands =
9 coverage run -m pytest src/launchpadlib/tests {posargs}
1110
12[testenv:lint]11[testenv:lint]
13basepython =12basepython =
@@ -24,3 +23,25 @@ commands =
24 sphinx-build -b html -d src/launchpadlib/docs/_build/doctrees src/launchpadlib/docs src/launchpadlib/docs/_build/html23 sphinx-build -b html -d src/launchpadlib/docs/_build/doctrees src/launchpadlib/docs src/launchpadlib/docs/_build/html
25deps =24deps =
26 .[docs]25 .[docs]
26
27[testenv:coverage]
28description = usage: tox -e py27,py35,py310,coverage
29basepython =
30 python3
31deps =
32 .[testing,test]
33commands =
34 coverage combine
35 coverage html
36 coverage report -m --fail-under=89
37depends =
38 py27,py35,py310
39
40[coverage:run]
41parallel=True
42omit=.tox/*
43
44[coverage:paths]
45source =
46 src
47 .tox/*/site-packages

Subscribers

People subscribed via source and target branches