Line
Link Here
|
0 |
-- a/conftest.py |
0 |
++ b/conftest.py |
Lines 11-17
Link Here
|
11 |
|
11 |
|
12 |
def pytest_collect_file(path, parent): |
12 |
def pytest_collect_file(path, parent): |
13 |
if path.ext == ".docopt" and path.basename.startswith("test"): |
13 |
if path.ext == ".docopt" and path.basename.startswith("test"): |
14 |
return DocoptTestFile(path, parent) |
14 |
if hasattr(DocoptTestFile, "from_parent"): |
|
|
15 |
return DocoptTestFile.from_parent(parent, fspath=path) |
16 |
else: |
17 |
return DocoptTestFile(path, parent) |
15 |
|
18 |
|
16 |
|
19 |
|
17 |
def parse_test(raw): |
20 |
def parse_test(raw): |
Lines 41-47
Link Here
|
41 |
for name, doc, cases in parse_test(raw): |
44 |
for name, doc, cases in parse_test(raw): |
42 |
name = self.fspath.purebasename |
45 |
name = self.fspath.purebasename |
43 |
for case in cases: |
46 |
for case in cases: |
44 |
yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case) |
47 |
if hasattr(DocoptTestItem, "from_parent"): |
|
|
48 |
yield DocoptTestItem.from_parent(self, name="%s(%d)" % (name, index), doc=doc, case=case) |
49 |
else: |
50 |
yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case) |
45 |
index += 1 |
51 |
index += 1 |
46 |
|
52 |
|
47 |
|
53 |
|