@@ -1153,7 +1153,10 @@ def assertArgsStartsWith(self, args, function_mock):
1153
1153
if arg is not mock .ANY :
1154
1154
self .assertTrue (arg_mock .startswith (arg ))
1155
1155
1156
- def test_install_core_requirements_sphinx (self ):
1156
+ @patch ('readthedocs.projects.models.Project.checkout_path' )
1157
+ def test_install_core_requirements_sphinx (self , checkout_path ):
1158
+ tmpdir = tempfile .mkdtemp ()
1159
+ checkout_path .return_value = tmpdir
1157
1160
python_env = Virtualenv (
1158
1161
version = self .version_sphinx ,
1159
1162
build_env = self .build_env_mock ,
@@ -1171,7 +1174,10 @@ def test_install_core_requirements_sphinx(self):
1171
1174
self .build_env_mock .run .assert_called_once ()
1172
1175
self .assertArgsStartsWith (args , self .build_env_mock .run )
1173
1176
1174
- def test_install_core_requirements_mkdocs (self ):
1177
+ @patch ('readthedocs.projects.models.Project.checkout_path' )
1178
+ def test_install_core_requirements_mkdocs (self , checkout_path ):
1179
+ tmpdir = tempfile .mkdtemp ()
1180
+ checkout_path .return_value = tmpdir
1175
1181
python_env = Virtualenv (
1176
1182
version = self .version_mkdocs ,
1177
1183
build_env = self .build_env_mock
@@ -1187,7 +1193,8 @@ def test_install_core_requirements_mkdocs(self):
1187
1193
self .build_env_mock .run .assert_called_once ()
1188
1194
self .assertArgsStartsWith (args , self .build_env_mock .run )
1189
1195
1190
- def test_install_user_requirements (self ):
1196
+ @patch ('readthedocs.projects.models.Project.checkout_path' )
1197
+ def test_install_user_requirements (self , checkout_path ):
1191
1198
"""
1192
1199
If a projects does not specify a requirements file,
1193
1200
RTD will choose one automatically.
@@ -1198,6 +1205,8 @@ def test_install_user_requirements(self):
1198
1205
- ``pip_requirements.txt``
1199
1206
- ``requirements.txt``
1200
1207
"""
1208
+ tmpdir = tempfile .mkdtemp ()
1209
+ checkout_path .return_value = tmpdir
1201
1210
self .build_env_mock .project = self .project_sphinx
1202
1211
self .build_env_mock .version = self .version_sphinx
1203
1212
python_env = Virtualenv (
@@ -1267,7 +1276,10 @@ def test_install_user_requirements(self):
1267
1276
python_env .install_user_requirements ()
1268
1277
self .build_env_mock .run .assert_not_called ()
1269
1278
1270
- def test_install_core_requirements_sphinx_conda (self ):
1279
+ @patch ('readthedocs.projects.models.Project.checkout_path' )
1280
+ def test_install_core_requirements_sphinx_conda (self , checkout_path ):
1281
+ tmpdir = tempfile .mkdtemp ()
1282
+ checkout_path .return_value = tmpdir
1271
1283
python_env = Conda (
1272
1284
version = self .version_sphinx ,
1273
1285
build_env = self .build_env_mock ,
@@ -1307,7 +1319,10 @@ def test_install_core_requirements_sphinx_conda(self):
1307
1319
mock .call (* args_pip , bin_path = mock .ANY )
1308
1320
])
1309
1321
1310
- def test_install_core_requirements_mkdocs_conda (self ):
1322
+ @patch ('readthedocs.projects.models.Project.checkout_path' )
1323
+ def test_install_core_requirements_mkdocs_conda (self , checkout_path ):
1324
+ tmpdir = tempfile .mkdtemp ()
1325
+ checkout_path .return_value = tmpdir
1311
1326
python_env = Conda (
1312
1327
version = self .version_mkdocs ,
1313
1328
build_env = self .build_env_mock ,
@@ -1343,7 +1358,10 @@ def test_install_core_requirements_mkdocs_conda(self):
1343
1358
mock .call (* args_pip , bin_path = mock .ANY )
1344
1359
])
1345
1360
1346
- def test_install_user_requirements_conda (self ):
1361
+ @patch ('readthedocs.projects.models.Project.checkout_path' )
1362
+ def test_install_user_requirements_conda (self , checkout_path ):
1363
+ tmpdir = tempfile .mkdtemp ()
1364
+ checkout_path .return_value = tmpdir
1347
1365
python_env = Conda (
1348
1366
version = self .version_sphinx ,
1349
1367
build_env = self .build_env_mock ,
0 commit comments