tmux-python/libtmux

pytest plugin examples

tony opened this issue · 0 comments

tony commented
"""
>>> source = ''.join([example.source for example in request._pyfuncitem.dtest.examples])

# >>> test_mod = pytester.makepyfile(whatever=inspect.getsource(test_func))
>>> pytester.makepyfile(**{'whatever.py': source})
PosixPath(...)

# PosixPath('...libtmux.pytest_plugin.py')

>>> result = pytester.runpytest('-p', 'pytester', '--disable-warnings', 'whatever.py')
===...

>>> result.assert_outcomes(errors=0)

"""