Are those examples part of docstrings? If yes then use the doctest_depends_on decorator (see PR 1901 for examples.)