Skip to content

Commit 295b107

Browse files
committed
Tweak tox.ini and .coveragerc in hopes of getting pytest-cov and pytest-xdist to play nicely together
1 parent 7dd5db1 commit 295b107

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# .coveragerc to control coverage.py
22
[run]
3+
# Source
4+
source = cmd.py,tests
35
# (boolean, default False): whether to measure branch coverage in addition to statement coverage.
46
branch = False
57

tox.ini

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[tox]
22
envlist = py27,py33,py34,py35,py36,py36-winpy37,pypy
33

4+
[pytest]
5+
testpaths = tests
6+
47
[testenv]
58
passenv = CI TRAVIS TRAVIS_* APPVEYOR*
69

@@ -12,9 +15,10 @@ deps =
1215
pyperclip
1316
pytest
1417
pytest-cov
18+
pytest-xdist
1519
six
1620
commands =
17-
py.test -v --cov=cmd2 --basetemp={envtmpdir} {posargs}
21+
py.test -v --cov=cmd2 -nauto --cov-report=term-missing tests
1822
codecov
1923

2024
[testenv:py33]
@@ -25,7 +29,7 @@ deps =
2529
pytest
2630
pytest-xdist
2731
six
28-
commands = py.test -v -n2
32+
commands = py.test -v -nauto
2933

3034
[testenv:py34]
3135
deps =
@@ -35,7 +39,7 @@ deps =
3539
pytest
3640
pytest-xdist
3741
six
38-
commands = py.test -v -n2
42+
commands = py.test -v -nauto
3943

4044
[testenv:py35]
4145
deps =
@@ -45,7 +49,7 @@ deps =
4549
pytest
4650
pytest-xdist
4751
six
48-
commands = py.test -v -n2
52+
commands = py.test -v -nauto
4953

5054
[testenv:py36]
5155
deps =
@@ -55,9 +59,10 @@ deps =
5559
pyperclip
5660
pytest
5761
pytest-cov
62+
pytest-xdist
5863
six
5964
commands =
60-
py.test -v --cov=cmd2 --basetemp={envtmpdir} {posargs}
65+
py.test -v --cov=cmd2 -nauto --cov-report=term-missing tests
6166
codecov
6267

6368
[testenv:py36-win]
@@ -68,7 +73,7 @@ deps =
6873
pytest
6974
pytest-xdist
7075
six
71-
commands = py.test -v -n2
76+
commands = py.test -v -nauto
7277

7378
[testenv:py37]
7479
deps =
@@ -78,5 +83,5 @@ deps =
7883
pytest
7984
pytest-xdist
8085
six
81-
commands = py.test -v -n2
86+
commands = py.test -v -nauto
8287

0 commit comments

Comments
 (0)