7
7
>>> from pathlib import Path
8
8
>>> tmp_path = Path(tempfile.gettempdir()) / 'pytest-testname'
9
9
>>> os.mkdir(tmp_path)
10
+
10
11
"""
11
12
12
13
# #############################################################################
@@ -92,7 +93,7 @@ def setup_clean_mkdocs_folder(mkdocs_yml_path, output_path):
92
93
shutil .rmtree (str (testproject_path ))
93
94
94
95
# Copy correct mkdocs.yml file and our test 'docs/'
95
- shutil .copytree ("tests/basic_setup /docs" , str (testproject_path / "docs" ))
96
+ shutil .copytree ("tests/fixtures/basic_project /docs" , str (testproject_path / "docs" ))
96
97
shutil .copyfile (mkdocs_yml_path , str (testproject_path / "mkdocs.yml" ))
97
98
98
99
return testproject_path
@@ -252,7 +253,7 @@ def test_missing_git_repo(tmp_path):
252
253
When there is no GIT repo, this should fail
253
254
"""
254
255
testproject_path = setup_clean_mkdocs_folder (
255
- mkdocs_yml_path = "tests/basic_setup /mkdocs.yml" , output_path = tmp_path
256
+ mkdocs_yml_path = "tests/fixtures/basic_project /mkdocs.yml" , output_path = tmp_path
256
257
)
257
258
258
259
result = build_docs_setup (testproject_path )
@@ -263,17 +264,19 @@ def test_missing_git_repo(tmp_path):
263
264
264
265
def test_build_no_options (tmp_path ):
265
266
# Enable plugin with no extra options set
266
- validate_mkdocs_file (tmp_path , "tests/basic_setup /mkdocs.yml" )
267
+ validate_mkdocs_file (tmp_path , "tests/fixtures/basic_project /mkdocs.yml" )
267
268
268
269
269
270
def test_build_locale_plugin (tmp_path ):
270
271
# Enable plugin with plugin locale set to 'nl'
271
- validate_mkdocs_file (tmp_path , "tests/basic_setup/mkdocs_plugin_locale.yml" )
272
+ validate_mkdocs_file (
273
+ tmp_path , "tests/fixtures/basic_project/mkdocs_plugin_locale.yml"
274
+ )
272
275
273
276
274
277
def test_build_locale_mkdocs (tmp_path ):
275
278
# Enable plugin with mkdocs locale set to 'fr'
276
- validate_mkdocs_file (tmp_path , "tests/basic_setup /mkdocs_locale.yml" )
279
+ validate_mkdocs_file (tmp_path , "tests/fixtures/basic_project /mkdocs_locale.yml" )
277
280
278
281
279
282
def test_material_theme (tmp_path ):
@@ -282,7 +285,7 @@ def test_material_theme(tmp_path):
282
285
"""
283
286
# theme set to 'material' with 'language' set to 'de'
284
287
testproject_path = validate_mkdocs_file (
285
- tmp_path , "tests/basic_setup /mkdocs_theme_locale.yml"
288
+ tmp_path , "tests/fixtures/basic_project /mkdocs_theme_locale.yml"
286
289
)
287
290
288
291
# In mkdocs-material, a 'last update' should appear
@@ -298,7 +301,7 @@ def test_material_theme_no_locale(tmp_path):
298
301
"""
299
302
# theme set to 'material' with 'language' set to 'de'
300
303
testproject_path = validate_mkdocs_file (
301
- tmp_path , "tests/basic_setup /mkdocs_theme_no_locale.yml"
304
+ tmp_path , "tests/fixtures/basic_project /mkdocs_theme_no_locale.yml"
302
305
)
303
306
304
307
# In mkdocs-material, a 'last update' should appear
@@ -310,17 +313,19 @@ def test_material_theme_no_locale(tmp_path):
310
313
311
314
def test_type_timeago (tmp_path ):
312
315
# type: 'timeago'
313
- validate_mkdocs_file (tmp_path , "tests/basic_setup /mkdocs_timeago.yml" )
316
+ validate_mkdocs_file (tmp_path , "tests/fixtures/basic_project /mkdocs_timeago.yml" )
314
317
315
318
316
319
def test_type_datetime (tmp_path ):
317
320
# type: 'datetime'
318
- validate_mkdocs_file (tmp_path , "tests/basic_setup /mkdocs_datetime.yml" )
321
+ validate_mkdocs_file (tmp_path , "tests/fixtures/basic_project /mkdocs_datetime.yml" )
319
322
320
323
321
324
def test_type_unknown (tmp_path ):
322
325
with pytest .raises (AssertionError ):
323
- validate_mkdocs_file (tmp_path , "tests/basic_setup/mkdocs_unknown_type.yml" )
326
+ validate_mkdocs_file (
327
+ tmp_path , "tests/fixtures/basic_project/mkdocs_unknown_type.yml"
328
+ )
324
329
325
330
326
331
def test_git_in_docs_dir (tmp_path ):
@@ -330,7 +335,7 @@ def test_git_in_docs_dir(tmp_path):
330
335
"""
331
336
332
337
testproject_path = setup_clean_mkdocs_folder (
333
- "tests/basic_setup /mkdocs.yml" , tmp_path
338
+ "tests/fixtures/basic_project /mkdocs.yml" , tmp_path
334
339
)
335
340
336
341
# Setup git repo in the 'docs' dir
@@ -369,7 +374,7 @@ def test_low_fetch_depth(tmp_path, caplog):
369
374
"""
370
375
371
376
testproject_path = setup_clean_mkdocs_folder (
372
- "tests/basic_setup /mkdocs.yml" , tmp_path
377
+ "tests/fixtures/basic_project /mkdocs.yml" , tmp_path
373
378
)
374
379
repo = setup_commit_history (testproject_path )
375
380
0 commit comments