Skip to content

Commit 979f01b

Browse files
committed
Merge branch 'develop' into doc
2 parents e9b55fa + cab2f65 commit 979f01b

File tree

6 files changed

+40
-8
lines changed

6 files changed

+40
-8
lines changed

doc/src/scope.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ or `'class'`.
1616
versions, all dependencies were implicitly in module scope.
1717

1818

19-
Explicitely specifying the scope
20-
--------------------------------
19+
Explicitly specifying the scope
20+
-------------------------------
2121

2222
The default value for the `scope` argument is `'module'`. Thus, the
2323
very first example from Section :ref:`usage-basic` could also be

doc/src/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ see Section :ref:`names` for details. In some cases, it's not easy to
5050
predict the names of the node ids. For this reason, the name of the
5151
tests can be overridden by an explicit `name` argument to the marker.
5252
The names must be unique. The following example works exactly as the
53-
last one, only the test names are explicitely set:
53+
last one, only the test names are explicitly set:
5454

5555
.. literalinclude:: ../examples/named.py
5656

@@ -110,7 +110,7 @@ Marking dependencies at runtime
110110
-------------------------------
111111

112112
Sometimes, dependencies of test instances are too complicated to be
113-
formulated explicitely beforehand using the
113+
formulated explicitly beforehand using the
114114
:func:`pytest.mark.dependency` marker. It may be easier to compile
115115
the list of dependencies of a test at run time. In such cases, the
116116
function :func:`pytest_dependency.depends` comes handy. Consider the

tests/test_03_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_e(self):
4747

4848
def test_class_simple_named(ctestdir):
4949
"""Mostly the same as test_class_simple(), but name the test methods
50-
now explicitely.
50+
now explicitly.
5151
"""
5252
ctestdir.makepyfile("""
5353
import pytest

tests/test_03_param.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@
44
import pytest
55

66

7+
def test_simple_params(ctestdir):
8+
"""Simple test for a dependency on a parametrized test.
9+
10+
This example has been used in the discussion of PR #43.
11+
"""
12+
ctestdir.makepyfile("""
13+
import pytest
14+
15+
_md = pytest.mark.dependency
16+
17+
@pytest.mark.parametrize("x", [ 0, 1 ])
18+
@pytest.mark.dependency()
19+
def test_a(x):
20+
assert x == 0
21+
22+
@pytest.mark.parametrize("x", [
23+
pytest.param(0, marks=_md(depends=["test_a[0]"])),
24+
pytest.param(1, marks=_md(depends=["test_a[1]"])),
25+
])
26+
def test_b(x):
27+
pass
28+
""")
29+
result = ctestdir.runpytest("--verbose")
30+
result.assert_outcomes(passed=2, skipped=1, failed=1)
31+
result.stdout.re_match_lines(r"""
32+
.*::test_a\[0\] PASSED
33+
.*::test_a\[1\] FAILED
34+
.*::test_b\[0\] PASSED
35+
.*::test_b\[1\] SKIPPED(?:\s+\(.*\))?
36+
""")
37+
38+
739
def test_multiple(ctestdir):
840
ctestdir.makepyfile("""
941
import pytest

tests/test_03_scope.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def test_scope_module(ctestdir):
8-
"""One single module, module scope is explicitely set in the
8+
"""One single module, module scope is explicitly set in the
99
pytest.mark.dependency() marker.
1010
"""
1111
ctestdir.makepyfile("""
@@ -379,7 +379,7 @@ def test_o(self):
379379
""")
380380

381381
def test_scope_named(ctestdir):
382-
"""Explicitely named tests are always referenced by that name,
382+
"""Explicitly named tests are always referenced by that name,
383383
regardless of the scope.
384384
"""
385385
ctestdir.makepyfile("""

tests/test_09_examples_scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def test_scope_module(ctestdir):
10-
"""Explicitely specifying the scope
10+
"""Explicitly specifying the scope
1111
"""
1212
with get_example("scope_module.py").open("rt") as f:
1313
ctestdir.makepyfile(f.read())

0 commit comments

Comments
 (0)