Skip to content

Commit 4e77d2a

Browse files
astrojuanluhumitos
authored andcommitted
Test that setuptools gets capped also with -I
1 parent bacd63b commit 4e77d2a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

readthedocs/rtd_tests/tests/test_doc_building.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,44 @@ def test_install_core_requirements_sphinx(self, checkout_path):
12431243
args = self.pip_install_args + requirements
12441244
self.assertArgsStartsWith(args, calls[1])
12451245

1246+
@mock.patch('readthedocs.doc_builder.config.load_config')
1247+
@patch('readthedocs.projects.models.Project.checkout_path')
1248+
def test_install_core_requirements_sphinx_system_packages_caps_setuptools(self, checkout_path, load_config):
1249+
config_data = {
1250+
'python': {
1251+
'use_system_site_packages': True,
1252+
},
1253+
}
1254+
load_config.side_effect = create_load(config_data)
1255+
config = load_yaml_config(self.version_sphinx)
1256+
1257+
tmpdir = tempfile.mkdtemp()
1258+
checkout_path.return_value = tmpdir
1259+
python_env = Virtualenv(
1260+
version=self.version_sphinx,
1261+
build_env=self.build_env_mock,
1262+
config=config,
1263+
)
1264+
python_env.install_core_requirements()
1265+
requirements_sphinx = [
1266+
'commonmark',
1267+
'recommonmark',
1268+
'sphinx',
1269+
'sphinx-rtd-theme',
1270+
'readthedocs-sphinx-ext',
1271+
'setuptools<58.3.0',
1272+
]
1273+
1274+
self.assertEqual(self.build_env_mock.run.call_count, 2)
1275+
calls = self.build_env_mock.run.call_args_list
1276+
1277+
core_args = self.pip_install_args + ['pip', 'setuptools<58.3.0']
1278+
self.assertArgsStartsWith(core_args, calls[0])
1279+
1280+
requirements = self.base_requirements + requirements_sphinx
1281+
args = self.pip_install_args + ['-I'] + requirements
1282+
self.assertArgsStartsWith(args, calls[1])
1283+
12461284
@patch('readthedocs.projects.models.Project.checkout_path')
12471285
def test_install_core_requirements_mkdocs(self, checkout_path):
12481286
tmpdir = tempfile.mkdtemp()

0 commit comments

Comments
 (0)