@@ -151,6 +151,7 @@ def test_extract_summary(capsys):
151
151
'dummy' ,
152
152
testroot = 'ext-autosummary-ext' ,
153
153
confoverrides = defaults .copy (),
154
+ copy_test_root = True ,
154
155
)
155
156
def test_get_items_summary (make_app , app_params ):
156
157
import sphinx .ext .autosummary
@@ -227,6 +228,7 @@ def str_content(elem: Element) -> str:
227
228
'xml' ,
228
229
testroot = 'ext-autosummary-ext' ,
229
230
confoverrides = defaults .copy (),
231
+ copy_test_root = True ,
230
232
)
231
233
def test_escaping (app ):
232
234
app .build (force_all = True )
@@ -238,7 +240,7 @@ def test_escaping(app):
238
240
assert str_content (title ) == 'underscore_module_'
239
241
240
242
241
- @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' )
243
+ @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' , copy_test_root = True )
242
244
def test_autosummary_generate_content_for_module (app ):
243
245
import autosummary_dummy_module # type: ignore[import-not-found]
244
246
@@ -298,7 +300,7 @@ def test_autosummary_generate_content_for_module(app):
298
300
assert context ['objtype' ] == 'module'
299
301
300
302
301
- @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' )
303
+ @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' , copy_test_root = True )
302
304
def test_autosummary_generate_content_for_module___all__ (app ):
303
305
import autosummary_dummy_module
304
306
@@ -343,7 +345,7 @@ def test_autosummary_generate_content_for_module___all__(app):
343
345
assert context ['objtype' ] == 'module'
344
346
345
347
346
- @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' )
348
+ @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' , copy_test_root = True )
347
349
def test_autosummary_generate_content_for_module_skipped (app ):
348
350
import autosummary_dummy_module
349
351
@@ -389,7 +391,7 @@ def skip_member(app, what, name, obj, skip, options):
389
391
assert context ['exceptions' ] == []
390
392
391
393
392
- @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' )
394
+ @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' , copy_test_root = True )
393
395
def test_autosummary_generate_content_for_module_imported_members (app ):
394
396
import autosummary_dummy_module
395
397
@@ -455,7 +457,7 @@ def test_autosummary_generate_content_for_module_imported_members(app):
455
457
assert context ['objtype' ] == 'module'
456
458
457
459
458
- @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' )
460
+ @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary' , copy_test_root = True )
459
461
def test_autosummary_generate_content_for_module_imported_members_inherited_module (app ):
460
462
import autosummary_dummy_inherited_module # type: ignore[import-not-found]
461
463
@@ -501,7 +503,7 @@ def test_autosummary_generate_content_for_module_imported_members_inherited_modu
501
503
assert context ['objtype' ] == 'module'
502
504
503
505
504
- @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary' )
506
+ @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary' , copy_test_root = True )
505
507
def test_autosummary_generate (app ):
506
508
app .build (force_all = True )
507
509
@@ -650,6 +652,7 @@ def test_autosummary_generate(app):
650
652
'dummy' ,
651
653
testroot = 'ext-autosummary' ,
652
654
confoverrides = {'autosummary_generate_overwrite' : False },
655
+ copy_test_root = True ,
653
656
)
654
657
def test_autosummary_generate_overwrite1 (app_params , make_app ):
655
658
args , kwargs = app_params
@@ -669,6 +672,7 @@ def test_autosummary_generate_overwrite1(app_params, make_app):
669
672
'dummy' ,
670
673
testroot = 'ext-autosummary' ,
671
674
confoverrides = {'autosummary_generate_overwrite' : True },
675
+ copy_test_root = True ,
672
676
)
673
677
def test_autosummary_generate_overwrite2 (app_params , make_app ):
674
678
args , kwargs = app_params
@@ -684,7 +688,7 @@ def test_autosummary_generate_overwrite2(app_params, make_app):
684
688
assert 'autosummary_dummy_module.rst' not in app ._warning .getvalue ()
685
689
686
690
687
- @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary-recursive' )
691
+ @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary-recursive' , copy_test_root = True )
688
692
@pytest .mark .usefixtures ('rollback_sysmodules' )
689
693
def test_autosummary_recursive (app ):
690
694
sys .modules .pop ('package' , None ) # unload target module to clear the module cache
@@ -738,7 +742,11 @@ def test_autosummary_recursive_skips_mocked_modules(app):
738
742
assert not (app .srcdir / 'generated' / 'package.package.module.rst' ).exists ()
739
743
740
744
741
- @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary-filename-map' )
745
+ @pytest .mark .sphinx (
746
+ 'dummy' ,
747
+ testroot = 'ext-autosummary-filename-map' ,
748
+ copy_test_root = True ,
749
+ )
742
750
def test_autosummary_filename_map (app ):
743
751
app .build ()
744
752
@@ -756,6 +764,7 @@ def test_autosummary_filename_map(app):
756
764
'latex' ,
757
765
testroot = 'ext-autosummary-ext' ,
758
766
confoverrides = defaults .copy (),
767
+ copy_test_root = True ,
759
768
)
760
769
def test_autosummary_latex_table_colspec (app ):
761
770
app .build (force_all = True )
@@ -793,7 +802,11 @@ def test_import_by_name():
793
802
assert modname == 'sphinx.ext.autosummary'
794
803
795
804
796
- @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary-mock_imports' )
805
+ @pytest .mark .sphinx (
806
+ 'dummy' ,
807
+ testroot = 'ext-autosummary-mock_imports' ,
808
+ copy_test_root = True ,
809
+ )
797
810
def test_autosummary_mock_imports (app ):
798
811
try :
799
812
app .build ()
@@ -805,7 +818,11 @@ def test_autosummary_mock_imports(app):
805
818
sys .modules .pop ('foo' , None ) # unload foo module
806
819
807
820
808
- @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary-imported_members' )
821
+ @pytest .mark .sphinx (
822
+ 'dummy' ,
823
+ testroot = 'ext-autosummary-imported_members' ,
824
+ copy_test_root = True ,
825
+ )
809
826
def test_autosummary_imported_members (app ):
810
827
try :
811
828
app .build ()
@@ -820,7 +837,11 @@ def test_autosummary_imported_members(app):
820
837
sys .modules .pop ('autosummary_dummy_package' , None )
821
838
822
839
823
- @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary-module_all' )
840
+ @pytest .mark .sphinx (
841
+ 'dummy' ,
842
+ testroot = 'ext-autosummary-module_all' ,
843
+ copy_test_root = True ,
844
+ )
824
845
def test_autosummary_module_all (app ):
825
846
try :
826
847
app .build ()
@@ -839,7 +860,11 @@ def test_autosummary_module_all(app):
839
860
sys .modules .pop ('autosummary_dummy_package_all' , None )
840
861
841
862
842
- @pytest .mark .sphinx ('dummy' , testroot = 'ext-autosummary-module_empty_all' )
863
+ @pytest .mark .sphinx (
864
+ 'dummy' ,
865
+ testroot = 'ext-autosummary-module_empty_all' ,
866
+ copy_test_root = True ,
867
+ )
843
868
def test_autosummary_module_empty_all (app ):
844
869
try :
845
870
app .build ()
@@ -867,6 +892,7 @@ def test_autosummary_module_empty_all(app):
867
892
'html' ,
868
893
testroot = 'ext-autodoc' ,
869
894
confoverrides = {'extensions' : ['sphinx.ext.autosummary' ]},
895
+ copy_test_root = True ,
870
896
)
871
897
def test_generate_autosummary_docs_property (app ):
872
898
with patch ('sphinx.ext.autosummary.generate.find_autosummary_in_files' ) as mock :
@@ -886,7 +912,11 @@ def test_generate_autosummary_docs_property(app):
886
912
)
887
913
888
914
889
- @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary-skip-member' )
915
+ @pytest .mark .sphinx (
916
+ 'html' ,
917
+ testroot = 'ext-autosummary-skip-member' ,
918
+ copy_test_root = True ,
919
+ )
890
920
def test_autosummary_skip_member (app ):
891
921
app .build ()
892
922
@@ -895,7 +925,7 @@ def test_autosummary_skip_member(app):
895
925
assert 'Foo._privatemeth' in content
896
926
897
927
898
- @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary-template' )
928
+ @pytest .mark .sphinx ('html' , testroot = 'ext-autosummary-template' , copy_test_root = True )
899
929
def test_autosummary_template (app ):
900
930
app .build ()
901
931
0 commit comments