Mocking ansible module in the documentation config

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ic9b938bb971dead227faa33f37e9f71c5aac9b54
(cherry picked from commit cec39d40a1)
(cherry picked from commit 70675b9c4c)
This commit is contained in:
Jiri Podivin 2023-02-22 10:15:50 +01:00
parent 9edbff37b7
commit 4eb3dc526e
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@
import os
import sys
from unittest import mock
# Add the project
sys.path.insert(0, os.path.abspath('../..'))
@ -36,6 +37,10 @@ extensions = [
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable
# Mocking imports that could cause build failure
autodoc_mock_imports = ['ansible']
sys.modules['ansible.module_utils.basic'] = mock.Mock()
# The suffix of source filenames.
source_suffix = '.rst'