2010-11-18 05:12:16 +08:00
|
|
|
import py, pytest
|
2010-11-13 18:10:45 +08:00
|
|
|
from _pytest.mark import MarkGenerator as Mark
|
2009-09-06 22:59:39 +08:00
|
|
|
|
2009-10-22 21:21:58 +08:00
|
|
|
class TestMark:
|
2011-06-01 14:03:06 +08:00
|
|
|
def test_markinfo_repr(self):
|
|
|
|
from _pytest.mark import MarkInfo
|
|
|
|
m = MarkInfo("hello", (1,2), {})
|
|
|
|
repr(m)
|
|
|
|
|
2010-11-18 21:56:16 +08:00
|
|
|
def test_pytest_exists_in_namespace_all(self):
|
|
|
|
assert 'mark' in py.test.__all__
|
|
|
|
assert 'mark' in pytest.__all__
|
|
|
|
|
2009-10-22 21:21:58 +08:00
|
|
|
def test_pytest_mark_notcallable(self):
|
|
|
|
mark = Mark()
|
2010-11-18 05:12:16 +08:00
|
|
|
pytest.raises((AttributeError, TypeError), "mark()")
|
2009-10-22 21:21:58 +08:00
|
|
|
|
|
|
|
def test_pytest_mark_bare(self):
|
|
|
|
mark = Mark()
|
2010-10-26 05:08:56 +08:00
|
|
|
def f():
|
|
|
|
pass
|
2009-10-22 21:21:58 +08:00
|
|
|
mark.hello(f)
|
|
|
|
assert f.hello
|
|
|
|
|
|
|
|
def test_pytest_mark_keywords(self):
|
|
|
|
mark = Mark()
|
2010-10-26 05:08:56 +08:00
|
|
|
def f():
|
|
|
|
pass
|
2009-10-22 21:21:58 +08:00
|
|
|
mark.world(x=3, y=4)(f)
|
2010-07-27 03:15:15 +08:00
|
|
|
assert f.world
|
2010-10-14 00:41:53 +08:00
|
|
|
assert f.world.kwargs['x'] == 3
|
|
|
|
assert f.world.kwargs['y'] == 4
|
2009-10-22 21:21:58 +08:00
|
|
|
|
|
|
|
def test_apply_multiple_and_merge(self):
|
|
|
|
mark = Mark()
|
2010-10-26 05:08:56 +08:00
|
|
|
def f():
|
|
|
|
pass
|
2009-10-22 21:21:58 +08:00
|
|
|
marker = mark.world
|
|
|
|
mark.world(x=3)(f)
|
2010-10-14 00:41:53 +08:00
|
|
|
assert f.world.kwargs['x'] == 3
|
2009-10-22 21:21:58 +08:00
|
|
|
mark.world(y=4)(f)
|
2010-10-14 00:41:53 +08:00
|
|
|
assert f.world.kwargs['x'] == 3
|
|
|
|
assert f.world.kwargs['y'] == 4
|
2009-10-22 21:21:58 +08:00
|
|
|
mark.world(y=1)(f)
|
2010-10-14 00:41:53 +08:00
|
|
|
assert f.world.kwargs['y'] == 1
|
2009-10-23 02:57:21 +08:00
|
|
|
assert len(f.world.args) == 0
|
2009-10-22 21:21:58 +08:00
|
|
|
|
|
|
|
def test_pytest_mark_positional(self):
|
|
|
|
mark = Mark()
|
2010-10-26 05:08:56 +08:00
|
|
|
def f():
|
|
|
|
pass
|
2009-10-22 21:21:58 +08:00
|
|
|
mark.world("hello")(f)
|
2009-10-23 02:57:21 +08:00
|
|
|
assert f.world.args[0] == "hello"
|
2009-10-22 21:21:58 +08:00
|
|
|
mark.world("world")(f)
|
|
|
|
|
2010-11-21 03:17:38 +08:00
|
|
|
def test_pytest_mark_reuse(self):
|
|
|
|
mark = Mark()
|
|
|
|
def f():
|
|
|
|
pass
|
|
|
|
w = mark.some
|
|
|
|
w("hello", reason="123")(f)
|
|
|
|
assert f.some.args[0] == "hello"
|
|
|
|
assert f.some.kwargs['reason'] == "123"
|
|
|
|
def g():
|
|
|
|
pass
|
|
|
|
w("world", reason2="456")(g)
|
|
|
|
assert g.some.args[0] == "world"
|
|
|
|
assert 'reason' not in g.some.kwargs
|
|
|
|
assert g.some.kwargs['reason2'] == "456"
|
|
|
|
|
2011-11-12 06:56:11 +08:00
|
|
|
|
|
|
|
def test_ini_markers(testdir):
|
|
|
|
testdir.makeini("""
|
|
|
|
[pytest]
|
|
|
|
markers =
|
|
|
|
a1: this is a webtest marker
|
|
|
|
a2: this is a smoke marker
|
|
|
|
""")
|
|
|
|
testdir.makepyfile("""
|
|
|
|
def test_markers(pytestconfig):
|
|
|
|
markers = pytestconfig.getini("markers")
|
|
|
|
print (markers)
|
|
|
|
assert len(markers) >= 2
|
|
|
|
assert markers[0].startswith("a1:")
|
|
|
|
assert markers[1].startswith("a2:")
|
|
|
|
""")
|
|
|
|
rec = testdir.inline_run()
|
|
|
|
rec.assertoutcome(passed=1)
|
|
|
|
|
|
|
|
def test_markers_option(testdir):
|
|
|
|
testdir.makeini("""
|
|
|
|
[pytest]
|
|
|
|
markers =
|
|
|
|
a1: this is a webtest marker
|
|
|
|
a1some: another marker
|
|
|
|
""")
|
|
|
|
result = testdir.runpytest("--markers", )
|
|
|
|
result.stdout.fnmatch_lines([
|
|
|
|
"*a1*this is a webtest*",
|
|
|
|
"*a1some*another marker",
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
def test_strict_prohibits_unregistered_markers(testdir):
|
|
|
|
testdir.makepyfile("""
|
|
|
|
import pytest
|
|
|
|
@pytest.mark.unregisteredmark
|
|
|
|
def test_hello():
|
|
|
|
pass
|
|
|
|
""")
|
|
|
|
result = testdir.runpytest("--strict")
|
|
|
|
assert result.ret != 0
|
|
|
|
result.stdout.fnmatch_lines([
|
|
|
|
"*unregisteredmark*not*registered*",
|
|
|
|
])
|
|
|
|
|
2011-11-12 07:02:06 +08:00
|
|
|
@pytest.mark.multi(spec=[
|
|
|
|
("xyz", ("test_one",)),
|
|
|
|
("xyz and xyz2", ()),
|
|
|
|
("xyz2", ("test_two",)),
|
|
|
|
("xyz or xyz2", ("test_one", "test_two"),)
|
|
|
|
])
|
|
|
|
def test_mark_option(spec, testdir):
|
|
|
|
testdir.makepyfile("""
|
|
|
|
import pytest
|
|
|
|
@pytest.mark.xyz
|
|
|
|
def test_one():
|
|
|
|
pass
|
|
|
|
@pytest.mark.xyz2
|
|
|
|
def test_two():
|
|
|
|
pass
|
|
|
|
""")
|
|
|
|
opt, passed_result = spec
|
|
|
|
rec = testdir.inline_run("-m", opt)
|
|
|
|
passed, skipped, fail = rec.listoutcomes()
|
|
|
|
passed = [x.nodeid.split("::")[-1] for x in passed]
|
|
|
|
assert len(passed) == len(passed_result)
|
|
|
|
assert list(passed) == list(passed_result)
|
|
|
|
|
2012-11-09 19:07:41 +08:00
|
|
|
@pytest.mark.multi(spec=[
|
|
|
|
("interface", ("test_interface",)),
|
|
|
|
("not interface", ("test_nointer",)),
|
|
|
|
])
|
|
|
|
def test_mark_option_custom(spec, testdir):
|
|
|
|
testdir.makeconftest("""
|
|
|
|
import pytest
|
|
|
|
def pytest_collection_modifyitems(items):
|
|
|
|
for item in items:
|
|
|
|
if "interface" in item.nodeid:
|
|
|
|
item.keywords["interface"] = pytest.mark.interface
|
|
|
|
""")
|
|
|
|
testdir.makepyfile("""
|
|
|
|
def test_interface():
|
|
|
|
pass
|
|
|
|
def test_nointer():
|
|
|
|
pass
|
|
|
|
""")
|
|
|
|
opt, passed_result = spec
|
|
|
|
rec = testdir.inline_run("-m", opt)
|
|
|
|
passed, skipped, fail = rec.listoutcomes()
|
|
|
|
passed = [x.nodeid.split("::")[-1] for x in passed]
|
|
|
|
assert len(passed) == len(passed_result)
|
|
|
|
assert list(passed) == list(passed_result)
|
2011-11-12 07:02:06 +08:00
|
|
|
|
2009-10-22 21:21:58 +08:00
|
|
|
class TestFunctional:
|
2011-11-12 06:56:11 +08:00
|
|
|
|
2009-10-22 21:21:58 +08:00
|
|
|
def test_mark_per_function(self, testdir):
|
|
|
|
p = testdir.makepyfile("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
|
|
|
@pytest.mark.hello
|
2009-10-22 21:21:58 +08:00
|
|
|
def test_hello():
|
|
|
|
assert hasattr(test_hello, 'hello')
|
|
|
|
""")
|
|
|
|
result = testdir.runpytest(p)
|
2011-11-09 01:53:46 +08:00
|
|
|
result.stdout.fnmatch_lines(["*1 passed*"])
|
2009-10-22 21:21:58 +08:00
|
|
|
|
|
|
|
def test_mark_per_module(self, testdir):
|
|
|
|
item = testdir.getitem("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
|
|
|
pytestmark = pytest.mark.hello
|
2009-10-22 21:21:58 +08:00
|
|
|
def test_func():
|
|
|
|
pass
|
|
|
|
""")
|
2010-06-08 08:34:51 +08:00
|
|
|
keywords = item.keywords
|
2009-10-22 21:21:58 +08:00
|
|
|
assert 'hello' in keywords
|
|
|
|
|
2010-05-22 00:11:47 +08:00
|
|
|
def test_marklist_per_class(self, testdir):
|
2010-10-26 05:08:56 +08:00
|
|
|
item = testdir.getitem("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
2009-10-22 21:21:58 +08:00
|
|
|
class TestClass:
|
2010-11-18 05:12:16 +08:00
|
|
|
pytestmark = [pytest.mark.hello, pytest.mark.world]
|
2009-10-22 21:21:58 +08:00
|
|
|
def test_func(self):
|
2010-07-27 03:15:15 +08:00
|
|
|
assert TestClass.test_func.hello
|
2010-05-22 00:11:47 +08:00
|
|
|
assert TestClass.test_func.world
|
2009-10-22 21:21:58 +08:00
|
|
|
""")
|
2010-06-08 08:34:51 +08:00
|
|
|
keywords = item.keywords
|
2009-10-22 21:21:58 +08:00
|
|
|
assert 'hello' in keywords
|
|
|
|
|
2010-05-22 00:11:47 +08:00
|
|
|
def test_marklist_per_module(self, testdir):
|
2010-10-26 05:08:56 +08:00
|
|
|
item = testdir.getitem("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
|
|
|
pytestmark = [pytest.mark.hello, pytest.mark.world]
|
2010-05-22 00:11:47 +08:00
|
|
|
class TestClass:
|
|
|
|
def test_func(self):
|
2010-07-27 03:15:15 +08:00
|
|
|
assert TestClass.test_func.hello
|
2010-05-22 00:11:47 +08:00
|
|
|
assert TestClass.test_func.world
|
|
|
|
""")
|
2010-06-08 08:34:51 +08:00
|
|
|
keywords = item.keywords
|
2010-05-22 00:11:47 +08:00
|
|
|
assert 'hello' in keywords
|
|
|
|
assert 'world' in keywords
|
|
|
|
|
2010-11-18 05:12:16 +08:00
|
|
|
@pytest.mark.skipif("sys.version_info < (2,6)")
|
2010-05-22 00:11:47 +08:00
|
|
|
def test_mark_per_class_decorator(self, testdir):
|
2010-10-26 05:08:56 +08:00
|
|
|
item = testdir.getitem("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
|
|
|
@pytest.mark.hello
|
2010-05-22 00:11:47 +08:00
|
|
|
class TestClass:
|
|
|
|
def test_func(self):
|
2010-07-27 03:15:15 +08:00
|
|
|
assert TestClass.test_func.hello
|
2010-05-22 00:11:47 +08:00
|
|
|
""")
|
2010-06-08 08:34:51 +08:00
|
|
|
keywords = item.keywords
|
2010-05-22 00:11:47 +08:00
|
|
|
assert 'hello' in keywords
|
|
|
|
|
2010-11-18 05:12:16 +08:00
|
|
|
@pytest.mark.skipif("sys.version_info < (2,6)")
|
2010-05-22 00:11:47 +08:00
|
|
|
def test_mark_per_class_decorator_plus_existing_dec(self, testdir):
|
2010-10-26 05:08:56 +08:00
|
|
|
item = testdir.getitem("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
|
|
|
@pytest.mark.hello
|
2010-05-22 00:11:47 +08:00
|
|
|
class TestClass:
|
2010-11-18 05:12:16 +08:00
|
|
|
pytestmark = pytest.mark.world
|
2010-05-22 00:11:47 +08:00
|
|
|
def test_func(self):
|
2010-07-27 03:15:15 +08:00
|
|
|
assert TestClass.test_func.hello
|
2010-05-22 00:11:47 +08:00
|
|
|
assert TestClass.test_func.world
|
|
|
|
""")
|
2010-06-08 08:34:51 +08:00
|
|
|
keywords = item.keywords
|
2010-05-22 00:11:47 +08:00
|
|
|
assert 'hello' in keywords
|
|
|
|
assert 'world' in keywords
|
|
|
|
|
2009-10-22 21:21:58 +08:00
|
|
|
def test_merging_markers(self, testdir):
|
|
|
|
p = testdir.makepyfile("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
|
|
|
pytestmark = pytest.mark.hello("pos1", x=1, y=2)
|
2009-10-22 21:21:58 +08:00
|
|
|
class TestClass:
|
|
|
|
# classlevel overrides module level
|
2010-11-18 05:12:16 +08:00
|
|
|
pytestmark = pytest.mark.hello(x=3)
|
|
|
|
@pytest.mark.hello("pos0", z=4)
|
2009-10-22 21:21:58 +08:00
|
|
|
def test_func(self):
|
|
|
|
pass
|
|
|
|
""")
|
|
|
|
items, rec = testdir.inline_genitems(p)
|
|
|
|
item, = items
|
2010-06-08 08:34:51 +08:00
|
|
|
keywords = item.keywords
|
2009-10-22 21:21:58 +08:00
|
|
|
marker = keywords['hello']
|
2010-11-21 03:17:38 +08:00
|
|
|
assert marker.args == ("pos0", "pos1")
|
2011-12-28 23:47:19 +08:00
|
|
|
assert marker.kwargs == {'x': 1, 'y': 2, 'z': 4}
|
2009-10-22 21:21:58 +08:00
|
|
|
|
2011-12-28 23:47:18 +08:00
|
|
|
# test the new __iter__ interface
|
|
|
|
l = list(marker)
|
|
|
|
assert len(l) == 3
|
|
|
|
assert l[0].args == ("pos0",)
|
|
|
|
assert l[1].args == ()
|
|
|
|
assert l[2].args == ("pos1", )
|
|
|
|
|
2012-11-06 04:52:12 +08:00
|
|
|
@pytest.mark.xfail(reason='unfixed')
|
|
|
|
def test_merging_markers_deep(self, testdir):
|
|
|
|
# issue 199 - propagate markers into nested classes
|
|
|
|
p = testdir.makepyfile("""
|
|
|
|
import pytest
|
|
|
|
class TestA:
|
|
|
|
pytestmark = pytest.mark.a
|
|
|
|
def test_b(self):
|
|
|
|
assert True
|
|
|
|
class TestC:
|
|
|
|
# this one didnt get marked
|
|
|
|
def test_d(self):
|
|
|
|
assert True
|
|
|
|
""")
|
|
|
|
items, rec = testdir.inline_genitems(p)
|
|
|
|
for item in items:
|
2012-11-06 18:04:11 +08:00
|
|
|
print (item, item.keywords)
|
2012-11-06 04:52:12 +08:00
|
|
|
assert 'a' in item.keywords
|
|
|
|
|
2011-12-28 23:47:19 +08:00
|
|
|
def test_mark_with_wrong_marker(self, testdir):
|
|
|
|
reprec = testdir.inline_runsource("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
2010-10-26 05:08:56 +08:00
|
|
|
class pytestmark:
|
|
|
|
pass
|
|
|
|
def test_func():
|
|
|
|
pass
|
2011-12-28 23:47:19 +08:00
|
|
|
""")
|
|
|
|
l = reprec.getfailedcollections()
|
|
|
|
assert len(l) == 1
|
|
|
|
assert "TypeError" in str(l[0].longrepr)
|
2010-06-08 08:34:51 +08:00
|
|
|
|
|
|
|
def test_mark_dynamically_in_funcarg(self, testdir):
|
|
|
|
testdir.makeconftest("""
|
2010-11-18 05:12:16 +08:00
|
|
|
import pytest
|
2010-06-08 08:34:51 +08:00
|
|
|
def pytest_funcarg__arg(request):
|
2010-11-18 05:12:16 +08:00
|
|
|
request.applymarker(pytest.mark.hello)
|
2010-06-08 08:34:51 +08:00
|
|
|
def pytest_terminal_summary(terminalreporter):
|
2010-07-27 03:15:15 +08:00
|
|
|
l = terminalreporter.stats['passed']
|
2010-06-08 08:34:51 +08:00
|
|
|
terminalreporter._tw.line("keyword: %s" % l[0].keywords)
|
|
|
|
""")
|
|
|
|
testdir.makepyfile("""
|
|
|
|
def test_func(arg):
|
|
|
|
pass
|
|
|
|
""")
|
|
|
|
result = testdir.runpytest()
|
|
|
|
result.stdout.fnmatch_lines([
|
|
|
|
"keyword: *hello*"
|
|
|
|
])
|
2010-10-12 19:05:29 +08:00
|
|
|
|
2011-12-28 23:47:18 +08:00
|
|
|
def test_merging_markers_two_functions(self, testdir):
|
|
|
|
p = testdir.makepyfile("""
|
|
|
|
import pytest
|
|
|
|
@pytest.mark.hello("pos1", z=4)
|
|
|
|
@pytest.mark.hello("pos0", z=3)
|
2012-07-19 15:20:14 +08:00
|
|
|
def test_func():
|
2011-12-28 23:47:18 +08:00
|
|
|
pass
|
|
|
|
""")
|
|
|
|
items, rec = testdir.inline_genitems(p)
|
|
|
|
item, = items
|
|
|
|
keywords = item.keywords
|
|
|
|
marker = keywords['hello']
|
|
|
|
l = list(marker)
|
|
|
|
assert len(l) == 2
|
|
|
|
assert l[0].args == ("pos0",)
|
|
|
|
assert l[1].args == ("pos1",)
|
|
|
|
|
2012-10-18 21:06:55 +08:00
|
|
|
def test_keywords_at_node_level(self, testdir):
|
|
|
|
p = testdir.makepyfile("""
|
|
|
|
import pytest
|
|
|
|
@pytest.fixture(scope="session", autouse=True)
|
|
|
|
def some(request):
|
|
|
|
request.keywords["hello"] = 42
|
|
|
|
assert "world" not in request.keywords
|
|
|
|
|
|
|
|
@pytest.fixture(scope="function", autouse=True)
|
|
|
|
def funcsetup(request):
|
|
|
|
assert "world" in request.keywords
|
|
|
|
assert "hello" in request.keywords
|
|
|
|
|
|
|
|
@pytest.mark.world
|
|
|
|
def test_function():
|
|
|
|
pass
|
|
|
|
""")
|
|
|
|
reprec = testdir.inline_run()
|
|
|
|
reprec.assertoutcome(passed=1)
|
2010-10-12 19:05:29 +08:00
|
|
|
|
|
|
|
class TestKeywordSelection:
|
|
|
|
def test_select_simple(self, testdir):
|
|
|
|
file_test = testdir.makepyfile("""
|
2010-10-26 05:08:56 +08:00
|
|
|
def test_one():
|
|
|
|
assert 0
|
2010-10-12 19:05:29 +08:00
|
|
|
class TestClass(object):
|
|
|
|
def test_method_one(self):
|
|
|
|
assert 42 == 43
|
|
|
|
""")
|
|
|
|
def check(keyword, name):
|
|
|
|
reprec = testdir.inline_run("-s", "-k", keyword, file_test)
|
|
|
|
passed, skipped, failed = reprec.listoutcomes()
|
|
|
|
assert len(failed) == 1
|
|
|
|
assert failed[0].nodeid.split("::")[-1] == name
|
|
|
|
assert len(reprec.getcalls('pytest_deselected')) == 1
|
|
|
|
|
|
|
|
for keyword in ['test_one', 'est_on']:
|
|
|
|
#yield check, keyword, 'test_one'
|
|
|
|
check(keyword, 'test_one')
|
|
|
|
check('TestClass.test', 'test_method_one')
|
|
|
|
|
2012-10-18 19:52:32 +08:00
|
|
|
@pytest.mark.parametrize("keyword", [
|
|
|
|
'xxx', 'xxx test_2', 'TestClass', 'xxx -test_1',
|
|
|
|
'TestClass test_2', 'xxx TestClass test_2'])
|
|
|
|
def test_select_extra_keywords(self, testdir, keyword):
|
2010-10-12 19:05:29 +08:00
|
|
|
p = testdir.makepyfile(test_select="""
|
|
|
|
def test_1():
|
|
|
|
pass
|
|
|
|
class TestClass:
|
|
|
|
def test_2(self):
|
|
|
|
pass
|
|
|
|
""")
|
|
|
|
testdir.makepyfile(conftest="""
|
2010-10-14 00:41:53 +08:00
|
|
|
def pytest_pycollect_makeitem(__multicall__, name):
|
|
|
|
if name == "TestClass":
|
|
|
|
item = __multicall__.execute()
|
2012-10-18 19:52:32 +08:00
|
|
|
item.keywords["xxx"] = True
|
2010-10-14 00:41:53 +08:00
|
|
|
return item
|
2010-10-12 19:05:29 +08:00
|
|
|
""")
|
2012-10-18 19:52:32 +08:00
|
|
|
reprec = testdir.inline_run(p.dirpath(), '-s', '-k', keyword)
|
|
|
|
py.builtin.print_("keyword", repr(keyword))
|
|
|
|
passed, skipped, failed = reprec.listoutcomes()
|
|
|
|
assert len(passed) == 1
|
|
|
|
assert passed[0].nodeid.endswith("test_2")
|
|
|
|
dlist = reprec.getcalls("pytest_deselected")
|
|
|
|
assert len(dlist) == 1
|
|
|
|
assert dlist[0].items[0].name == 'test_1'
|
2010-10-12 19:05:29 +08:00
|
|
|
|
|
|
|
def test_select_starton(self, testdir):
|
|
|
|
threepass = testdir.makepyfile(test_threepass="""
|
|
|
|
def test_one(): assert 1
|
|
|
|
def test_two(): assert 1
|
|
|
|
def test_three(): assert 1
|
|
|
|
""")
|
|
|
|
reprec = testdir.inline_run("-k", "test_two:", threepass)
|
|
|
|
passed, skipped, failed = reprec.listoutcomes()
|
|
|
|
assert len(passed) == 2
|
|
|
|
assert not failed
|
|
|
|
dlist = reprec.getcalls("pytest_deselected")
|
|
|
|
assert len(dlist) == 1
|
|
|
|
item = dlist[0].items[0]
|
|
|
|
assert item.name == "test_one"
|
|
|
|
|
|
|
|
def test_keyword_extra(self, testdir):
|
|
|
|
p = testdir.makepyfile("""
|
|
|
|
def test_one():
|
|
|
|
assert 0
|
|
|
|
test_one.mykeyword = True
|
|
|
|
""")
|
|
|
|
reprec = testdir.inline_run("-k", "-mykeyword", p)
|
|
|
|
passed, skipped, failed = reprec.countoutcomes()
|
|
|
|
assert passed + skipped + failed == 0
|
|
|
|
reprec = testdir.inline_run("-k", "mykeyword", p)
|
|
|
|
passed, skipped, failed = reprec.countoutcomes()
|
|
|
|
assert failed == 1
|