@@ -21,14 +21,16 @@ def test_rmdir_docs(tmp_pathplus, capsys):
21
21
"deps = sphinx" ,
22
22
"skip_install = True" ,
23
23
"commands = sphinx-build --version" ,
24
- 'recreate_hook = builtin.rmdir("{toxinidir}/doc-source/build")' ,
24
+ 'recreate_hook = builtin.rmdir(r "{toxinidir}/doc-source/build")' ,
25
25
])
26
26
27
- with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
28
- tox .cmdline (["-e" , "docs" , "-r" ])
27
+ try :
28
+ with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
29
+ tox .cmdline (["-e" , "docs" , "-r" ])
29
30
30
- stdout = capsys .readouterr ().out
31
- print (stdout )
31
+ finally :
32
+ stdout = capsys .readouterr ().out
33
+ print (stdout )
32
34
33
35
assert (tmp_pathplus / "doc-source" ).is_dir ()
34
36
assert not build_dir .is_dir ()
@@ -49,11 +51,16 @@ def test_rmdir_mypy(tmp_pathplus, capsys):
49
51
"deps = mypy" ,
50
52
"skip_install = True" ,
51
53
"commands = mypy --version" ,
52
- 'recreate_hook = builtin.rmdir("{toxinidir}/.mypy_cache")' ,
54
+ 'recreate_hook = builtin.rmdir(r "{toxinidir}/.mypy_cache")' ,
53
55
])
54
56
55
- with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
56
- tox .cmdline (["-e" , "mypy" , "-r" ])
57
+ try :
58
+ with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
59
+ tox .cmdline (["-e" , "mypy" , "-r" ])
60
+
61
+ finally :
62
+ stdout = capsys .readouterr ().out
63
+ print (stdout )
57
64
58
65
stdout = capsys .readouterr ().out
59
66
print (stdout )
@@ -74,8 +81,13 @@ def test_simple_custom_hook(tmp_pathplus, capsys):
74
81
'recreate_hook = "hello world"' ,
75
82
])
76
83
77
- with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
78
- tox .cmdline (["-e" , "docs" , "-r" ])
84
+ try :
85
+ with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
86
+ tox .cmdline (["-e" , "docs" , "-r" ])
87
+
88
+ finally :
89
+ stdout = capsys .readouterr ().out
90
+ print (stdout )
79
91
80
92
stdout = capsys .readouterr ().out
81
93
print (stdout )
@@ -99,8 +111,13 @@ def test_custom_hook(tmp_pathplus, capsys):
99
111
'\t return "this is a custom hook"' ,
100
112
])
101
113
102
- with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
103
- tox .cmdline (["-e" , "docs" , "-r" ])
114
+ try :
115
+ with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
116
+ tox .cmdline (["-e" , "docs" , "-r" ])
117
+
118
+ finally :
119
+ stdout = capsys .readouterr ().out
120
+ print (stdout )
104
121
105
122
stdout = capsys .readouterr ().out
106
123
print (stdout )
@@ -118,8 +135,13 @@ def test_no_hook(tmp_pathplus, capsys):
118
135
"commands = sphinx-build --version" ,
119
136
])
120
137
121
- with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
122
- tox .cmdline (["-e" , "docs" , "-r" ])
138
+ try :
139
+ with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
140
+ tox .cmdline (["-e" , "docs" , "-r" ])
141
+
142
+ finally :
143
+ stdout = capsys .readouterr ().out
144
+ print (stdout )
123
145
124
146
stdout = capsys .readouterr ().out
125
147
print (stdout )
@@ -139,11 +161,16 @@ def test_not_recreate(tmp_pathplus, capsys):
139
161
"deps = sphinx" ,
140
162
"skip_install = True" ,
141
163
"commands = sphinx-build --version" ,
142
- 'recreate_hook = builtin.rmdir("{toxinidir}/doc-source/build")' ,
164
+ 'recreate_hook = builtin.rmdir(r "{toxinidir}/doc-source/build")' ,
143
165
])
144
166
145
- with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
146
- tox .cmdline (["-e" , "docs" ])
167
+ try :
168
+ with pytest .raises (SystemExit ), in_directory (tmp_pathplus ):
169
+ tox .cmdline (["-e" , "docs" ])
170
+
171
+ finally :
172
+ stdout = capsys .readouterr ().out
173
+ print (stdout )
147
174
148
175
stdout = capsys .readouterr ().out
149
176
print (stdout )
0 commit comments