@@ -202,27 +202,47 @@ def test_verbose_with_v(self, testdir):
202
202
"""Verbose output with '-v'."""
203
203
result = testdir .runpytest_subprocess ('-s' , '-v' )
204
204
result .stdout .fnmatch_lines_random ([
205
- "tpkg/test_the_test.py:*" ,
206
- "*PASSED*" ,
207
- "*Destroying test database for alias 'default'...*" ])
205
+ 'tpkg/test_the_test.py:*' ,
206
+ '*PASSED*' ,
207
+ ])
208
+ if get_django_version () >= (2 , 2 ):
209
+ result .stderr .fnmatch_lines ([
210
+ "*Destroying test database for alias 'default'*" ])
211
+ else :
212
+ result .stdout .fnmatch_lines ([
213
+ "*Destroying test database for alias 'default'...*" ])
208
214
209
215
def test_more_verbose_with_vv (self , testdir ):
210
216
"""More verbose output with '-v -v'."""
211
217
result = testdir .runpytest_subprocess ('-s' , '-v' , '-v' )
212
- result .stdout .fnmatch_lines ([
213
- " tpkg/test_the_test.py:*Creating test database for alias*" ,
218
+ result .stdout .fnmatch_lines_random ([
219
+ ' tpkg/test_the_test.py:*' ,
214
220
'*Operations to perform:*' ,
215
- "*Apply all migrations:*" ,
216
- "*PASSED*Destroying test database for alias 'default' ('*')...*" ])
221
+ '*Apply all migrations:*' ,
222
+ '*PASSED*' ])
223
+ if get_django_version () >= (2 , 2 ):
224
+ result .stderr .fnmatch_lines ([
225
+ '*Creating test database for alias*' ,
226
+ "*Destroying test database for alias 'default'*" ])
227
+ else :
228
+ result .stdout .fnmatch_lines ([
229
+ '*Creating test database for alias*' ,
230
+ "*Destroying test database for alias 'default'*" ])
217
231
218
232
def test_more_verbose_with_vv_and_reusedb (self , testdir ):
219
233
"""More verbose output with '-v -v', and --create-db."""
220
234
result = testdir .runpytest_subprocess ('-s' , '-v' , '-v' , '--create-db' )
221
235
result .stdout .fnmatch_lines ([
222
- "tpkg/test_the_test.py:*Creating test database for alias*" ,
223
- "*PASSED*" ])
224
- assert ("*Destroying test database for alias 'default' ('*')...*"
225
- not in result .stdout .str ())
236
+ 'tpkg/test_the_test.py:*' ,
237
+ '*PASSED*' ])
238
+ if get_django_version () >= (2 , 2 ):
239
+ result .stderr .fnmatch_lines (['*Creating test database for alias*' ])
240
+ assert ("*Destroying test database for alias 'default' ('*')...*"
241
+ not in result .stderr .str ())
242
+ else :
243
+ result .stdout .fnmatch_lines (['*Creating test database for alias*' ])
244
+ assert ("*Destroying test database for alias 'default' ('*')...*"
245
+ not in result .stdout .str ())
226
246
227
247
228
248
@pytest .mark .django_db
0 commit comments