modal-labs / pytest-markdown-docs

Run pytest on markdown code fence blocks
MIT License
57 stars 7 forks source link

Show useful error if there is an error when looking up a fixture #14

Closed freider closed 1 year ago

freider commented 1 year ago

Previously a missing fixture would output a cryptic pytest-internal error:

INTERNALERROR>     stack = [self.request._pyfuncitem.obj]
INTERNALERROR> AttributeError: 'MarkdownInlinePythonItem' object has no attribute 'obj'

After this fix it will instead be:

=================================================== ERRORS ====================================================
____ ERROR at setup of docstring for ... _____
file , line 0: source code not available
E       fixture 'foo' not found