Merge ~ballot/charm-mongodb/+git/charm-mongodb:pytest into charm-mongodb:master

Proposed by Benjamin Allot
Status: Merged
Merged at revision: c7ffb22bef99854788f315a61dd424a2f29fc6dc
Proposed branch: ~ballot/charm-mongodb/+git/charm-mongodb:pytest
Merge into: charm-mongodb:master
Diff against target: 30 lines (+6/-3)
2 files modified
tests/unit/requirements.txt (+2/-0)
tox.ini (+4/-3)
Reviewer Review Type Date Requested Status
BootStack Reviewers Pending
BootStack Reviewers Pending
Review via email: mp+414674@code.launchpad.net

Commit message

Use pytest instead of unittests

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unit/requirements.txt b/tests/unit/requirements.txt
2index 55e3ba6..9fab1de 100644
3--- a/tests/unit/requirements.txt
4+++ b/tests/unit/requirements.txt
5@@ -6,4 +6,6 @@ charm-tools
6 packaging
7 appdirs
8 pymongo
9+pytest
10+pytest-cov
11 PyYAML
12diff --git a/tox.ini b/tox.ini
13index 6a2caf4..089508c 100644
14--- a/tox.ini
15+++ b/tox.ini
16@@ -67,10 +67,11 @@ deps =
17 black
18
19 [testenv:unit]
20+setenv =
21+ PYTHONPATH = {toxinidir}/tests/unit:{toxinidir}/files/nrpe-external-master
22 commands =
23- coverage run -m unittest discover -s {toxinidir}/tests/unit -v
24- coverage report --omit tests/*,mod/*,.tox/*,charmhelpers/*
25- coverage html --omit tests/*,mod/*,.tox/*,charmhelpers/*
26+ pytest \
27+ {posargs:-v --cov=hooks --cov-report=term-missing --cov-branch} {toxinidir}/tests/unit
28 deps = -r{toxinidir}/tests/unit/requirements.txt
29
30 [testenv:func]

Subscribers

People subscribed via source and target branches

to all changes: