5

I'm trying to document a module with Sphinx and auto-document extension. I have some libraries that cannot be imported with standard python (they came from a very complicated in-house framework for Maya). I have mock-ed out this modules, and everything work as expected except for any class that inherits from a Mock-ed class. This classes didn't appear in the resulting documentation.

This is the way I have mock-ed my modules (this code lies inside conf.py):

for mod in MODULE_LIST:
    sys.modules[mod] = mock.MagicMock()

I have already read this question Sphinx-doc :automodule: with Mock imports, but I can't implement the accepted solution because we have a huge number of modules.

Is there any way to make Sphinx ignore inheritance of the mock-ed modules?

Community
  • 1
  • 1
Blodwen
  • 145
  • 1
  • 7
  • 1
    Possible duplicate of [autodoc a class that extends a mocked class](http://stackoverflow.com/questions/25893614/autodoc-a-class-that-extends-a-mocked-class) – Wrzlprmft Jun 20 '16 at 14:53

0 Answers0