Skip to content

Commit

Permalink
Merge pull request #4250 from stsewd/update-sphinx-version-1.7.5
Browse files Browse the repository at this point in the history
Update default sphinx version
  • Loading branch information
ericholscher authored Jun 19, 2018
2 parents 5ea9c44 + f9afaf0 commit af22d27
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def install_core_requirements(self):
self.project.get_feature_value(
Feature.USE_SPHINX_LATEST,
positive='sphinx<2',
negative='sphinx==1.7.4',
negative='sphinx<1.8',
),
'sphinx-rtd-theme<0.5',
'readthedocs-sphinx-ext<0.6'
Expand Down
48 changes: 28 additions & 20 deletions readthedocs/rtd_tests/tests/test_doc_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,12 @@ def setUp(self):
self.build_env_mock = Mock()

self.base_requirements = [
'Pygments==2.2.0',
'setuptools<40',
'docutils==0.13.1',
'mock==1.0.1',
'pillow==2.6.1',
'alabaster>=0.7,<0.8,!=0.7.5',
'Pygments',
'setuptools',
'docutils',
'mock',
'pillow',
'alabaster',
]
self.base_conda_requirements = [
'mock',
Expand All @@ -1143,24 +1143,33 @@ def setUp(self):
mock.ANY, # cache path
]

def assertArgsStartsWith(self, args, function_mock):
"""
Assert that each element of args of the mock start
with each element of args.
"""
args_mock, _ = function_mock.call_args
for arg, arg_mock in zip(args, args_mock):
if arg is not mock.ANY:
self.assertTrue(arg_mock.startswith(arg))

def test_install_core_requirements_sphinx(self):
python_env = Virtualenv(
version=self.version_sphinx,
build_env=self.build_env_mock,
)
python_env.install_core_requirements()
requirements_sphinx = [
'commonmark==0.5.4',
'recommonmark==0.4.0',
'sphinx==1.7.4',
'sphinx-rtd-theme<0.5',
'readthedocs-sphinx-ext<0.6',
'commonmark',
'recommonmark',
'sphinx',
'sphinx-rtd-theme',
'readthedocs-sphinx-ext',
]
requirements = self.base_requirements + requirements_sphinx
args = self.pip_install_args + requirements
self.build_env_mock.run.assert_called_once_with(
*args, bin_path=mock.ANY
)
self.build_env_mock.run.assert_called_once()
self.assertArgsStartsWith(args, self.build_env_mock.run)

def test_install_core_requirements_mkdocs(self):
python_env = Virtualenv(
Expand All @@ -1169,15 +1178,14 @@ def test_install_core_requirements_mkdocs(self):
)
python_env.install_core_requirements()
requirements_mkdocs = [
'commonmark==0.5.4',
'recommonmark==0.4.0',
'mkdocs==0.17.3',
'commonmark',
'recommonmark',
'mkdocs',
]
requirements = self.base_requirements + requirements_mkdocs
args = self.pip_install_args + requirements
self.build_env_mock.run.assert_called_once_with(
*args, bin_path=mock.ANY
)
self.build_env_mock.run.assert_called_once()
self.assertArgsStartsWith(args, self.build_env_mock.run)

def test_install_user_requirements(self):
"""
Expand Down

0 comments on commit af22d27

Please sign in to comment.