mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-18 02:40:40 +00:00
28 lines
636 B
Python
28 lines
636 B
Python
from sybil import Sybil
|
|
from sybil.parsers.doctest import DocTestParser
|
|
from sybil.parsers.codeblock import CodeBlockParser
|
|
from sybil.parsers.capture import parse_captures
|
|
|
|
from testfixtures import TempDirectory
|
|
from testfixtures.sybil import FileParser
|
|
|
|
|
|
def sybil_setup(namespace):
|
|
namespace['tempdir'] = TempDirectory()
|
|
|
|
|
|
def sybil_teardown(namespace):
|
|
namespace['tempdir'].cleanup()
|
|
|
|
|
|
pytest_collect_file = Sybil(
|
|
parsers=[
|
|
DocTestParser(),
|
|
CodeBlockParser(),
|
|
parse_captures,
|
|
FileParser('tempdir'),
|
|
],
|
|
pattern='*.txt',
|
|
setup=sybil_setup, teardown=sybil_teardown,
|
|
).pytest()
|