Skip to content

Commit 0667826

Browse files
committed
Try out several different truth values for the automark ini-option in
the tests
1 parent 4cf2e79 commit 0667826

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tests/test_04_automark.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ def test_b():
2929
""")
3030

3131

32-
def test_set_false(ctestdir):
32+
@pytest.mark.parametrize(
33+
"false_value", ["0", "no", "n", "False", "false", "f", "off"]
34+
)
35+
def test_set_false(ctestdir, false_value):
3336
"""A pytest.ini is present, automark_dependency is set to false.
3437
3538
Since automark_dependency is set to false and test_a is not
@@ -38,9 +41,9 @@ def test_set_false(ctestdir):
3841
"""
3942
ctestdir.makefile('.ini', pytest="""
4043
[pytest]
41-
automark_dependency = false
44+
automark_dependency = %s
4245
console_output_style = classic
43-
""")
46+
""" % false_value)
4447
ctestdir.makepyfile("""
4548
import pytest
4649
@@ -59,7 +62,10 @@ def test_b():
5962
""")
6063

6164

62-
def test_set_true(ctestdir):
65+
@pytest.mark.parametrize(
66+
"true_value", ["1", "yes", "y", "True", "true", "t", "on"]
67+
)
68+
def test_set_true(ctestdir, true_value):
6369
"""A pytest.ini is present, automark_dependency is set to false.
6470
6571
Since automark_dependency is set to true, the outcome of test_a
@@ -68,9 +74,9 @@ def test_set_true(ctestdir):
6874
"""
6975
ctestdir.makefile('.ini', pytest="""
7076
[pytest]
71-
automark_dependency = true
77+
automark_dependency = %s
7278
console_output_style = classic
73-
""")
79+
""" % true_value)
7480
ctestdir.makepyfile("""
7581
import pytest
7682

0 commit comments

Comments
 (0)