The doctest plugin in sphinx support specifying a code block in conf.py that is called at setup time
doctest_global_setup = '''
try:
import pandas as pd
except ImportError:
pd = None
'''
Support for specifying this code block somewhere should be added.
It can't be added to pytest.ini, because AFAIK it (or ini files in general) doesn't have support for multiline values. So probably it needs to be set in conftest.py. If anyone know how this can be done - please comment.
The doctest plugin in sphinx support specifying a code block in
conf.pythat is called at setup timeSupport for specifying this code block somewhere should be added.
It can't be added to pytest.ini, because AFAIK it (or ini files in general) doesn't have support for multiline values. So probably it needs to be set in conftest.py. If anyone know how this can be done - please comment.