Add example script and failure for #3742
This commit is contained in:
parent
253419316c
commit
e1ad1a14af
|
@ -0,0 +1,10 @@
|
|||
import pytest
|
||||
|
||||
|
||||
class CustomItem(pytest.Item, pytest.File):
|
||||
def runtest(self):
|
||||
pass
|
||||
|
||||
|
||||
def pytest_collect_file(path, parent):
|
||||
return CustomItem(path, parent)
|
|
@ -0,0 +1,2 @@
|
|||
def test():
|
||||
pass
|
|
@ -1619,6 +1619,11 @@ class TestFixtureManagerParseFactories(object):
|
|||
reprec = testdir.inline_run()
|
||||
reprec.assertoutcome(passed=2)
|
||||
|
||||
def test_collect_custom_items(self, testdir):
|
||||
testdir.copy_example("fixtures/custom_item")
|
||||
result = testdir.runpytest("foo")
|
||||
result.stdout.fnmatch_lines("*passed*")
|
||||
|
||||
|
||||
class TestAutouseDiscovery(object):
|
||||
@pytest.fixture
|
||||
|
|
Loading…
Reference in New Issue