Skip to content

Commit ba79a8e

Browse files
committed
Recreate the examples to solve common user problems regarding cov data aggregation and layout.
1 parent 4971a3f commit ba79a8e

File tree

16 files changed

+134
-47
lines changed

16 files changed

+134
-47
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
graft docs
2-
graft example
2+
graft examples
33
graft src
44
graft ci
55
graft tests

example/.coveragerc

Lines changed: 0 additions & 2 deletions
This file was deleted.

example/setup.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

example/tests/test_mylib.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

example/tox.ini

Lines changed: 0 additions & 30 deletions
This file was deleted.

examples/README.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Simple examples with ``tox.ini``
2+
================================
3+
4+
These examples provide necessary configuration to:
5+
6+
* aggregate coverage from multiple interpreters
7+
* support tox parallel mode
8+
* run tests on installed code
9+
10+
The `adhoc` layout is the old and problematic layout where you can mix up the installed code
11+
with the source code. However, these examples will provide correct configuration even for
12+
the `adhoc` layout.
13+
14+
The `src` layout configuration is less complicated, have that in mind when picking a layout
15+
for your project.

examples/adhoc-layout/.coveragerc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[paths]
2+
source =
3+
../example
4+
*/site-packages/example
5+
6+
[run]
7+
branch = true
8+
parallel = true
9+
source =
10+
example
11+
.
12+
13+
[report]
14+
show_missing = true
15+
precision = 2
File renamed without changes.

examples/adhoc-layout/setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from setuptools import setup, find_packages
2+
3+
4+
setup(
5+
name='example',
6+
packages=find_packages(include=['example'])
7+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import example
2+
3+
4+
def test_add():
5+
assert example.add(1, 1) == 2
6+
assert not example.add(0, 1) == 2

0 commit comments

Comments
 (0)