@@ -24,6 +24,7 @@ def test_db_can_be_accessed():
24
24
''' )
25
25
26
26
result = django_testdir .runpytest ('-v' , '--reuse-db' )
27
+ assert result .ret == 0
27
28
result .stdout .fnmatch_lines ([
28
29
"*test_db_can_be_accessed PASSED*" ,
29
30
])
@@ -55,6 +56,7 @@ def test_db_can_be_accessed():
55
56
# Do not pass in --create-db to make sure it is created when it
56
57
# does not exist
57
58
result_first = django_testdir .runpytest ('-v' , '--reuse-db' )
59
+ assert result_first .ret == 0
58
60
59
61
result_first .stdout .fnmatch_lines ([
60
62
"*test_db_can_be_accessed PASSED*" ,
@@ -65,6 +67,7 @@ def test_db_can_be_accessed():
65
67
assert mark_exists ()
66
68
67
69
result_second = django_testdir .runpytest ('-v' , '--reuse-db' )
70
+ assert result_second .ret == 0
68
71
result_second .stdout .fnmatch_lines ([
69
72
"*test_db_can_be_accessed PASSED*" ,
70
73
])
@@ -73,6 +76,7 @@ def test_db_can_be_accessed():
73
76
assert mark_exists ()
74
77
75
78
result_third = django_testdir .runpytest ('-v' , '--reuse-db' , '--create-db' )
79
+ assert result_third .ret == 0
76
80
result_third .stdout .fnmatch_lines ([
77
81
"*test_db_can_be_accessed PASSED*" ,
78
82
])
@@ -116,6 +120,7 @@ def test_a():
116
120
''' % (self .db_name_17 , self .db_name_before_17 ))
117
121
118
122
result = django_testdir .runpytest ('--tb=short' , '-v' )
123
+ assert result .ret == 0
119
124
result .stdout .fnmatch_lines (['*test_a*PASSED*' ])
120
125
121
126
@@ -160,6 +165,7 @@ def test_d(settings):
160
165
''' )
161
166
162
167
result = django_testdir .runpytest ('-vv' , '-n2' , '-s' , '--reuse-db' )
168
+ assert result .ret == 0
163
169
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
164
170
result .stdout .fnmatch_lines (['*PASSED*test_b*' ])
165
171
result .stdout .fnmatch_lines (['*PASSED*test_c*' ])
@@ -169,13 +175,15 @@ def test_d(settings):
169
175
assert db_exists ('gw1' )
170
176
171
177
result = django_testdir .runpytest ('-vv' , '-n2' , '-s' , '--reuse-db' )
178
+ assert result .ret == 0
172
179
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
173
180
result .stdout .fnmatch_lines (['*PASSED*test_b*' ])
174
181
result .stdout .fnmatch_lines (['*PASSED*test_c*' ])
175
182
result .stdout .fnmatch_lines (['*PASSED*test_d*' ])
176
183
177
184
result = django_testdir .runpytest ('-vv' , '-n2' , '-s' , '--reuse-db' ,
178
185
'--create-db' )
186
+ assert result .ret == 0
179
187
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
180
188
result .stdout .fnmatch_lines (['*PASSED*test_b*' ])
181
189
result .stdout .fnmatch_lines (['*PASSED*test_c*' ])
@@ -206,6 +214,7 @@ def test_a():
206
214
''' )
207
215
208
216
result = django_testdir .runpytest ('--tb=short' , '-vv' , '-n1' )
217
+ assert result .ret == 0
209
218
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
210
219
211
220
@@ -226,6 +235,7 @@ def test_inner_south():
226
235
''' )
227
236
228
237
result = django_testdir_initial .runpytest ('--tb=short' , '-v' )
238
+ assert result .ret == 0
229
239
result .stdout .fnmatch_lines (['*test_inner_south*PASSED*' ])
230
240
231
241
@@ -288,6 +298,7 @@ def test_inner_south():
288
298
django_testdir_initial .mkpydir ('tpkg/app/south_migrations' )
289
299
290
300
result = django_testdir_initial .runpytest ('--tb=short' , '-v' , '-s' )
301
+ assert result .ret != 0
291
302
# Can be OperationalError or DatabaseError (Django 1.4).
292
303
result .stdout .fnmatch_lines ([
293
304
'*Error:* no such table: app_item*' ])
@@ -315,6 +326,7 @@ def test_inner_south():
315
326
testdir .create_initial_south_migration ()
316
327
317
328
result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
329
+ assert result .ret == 0
318
330
result .stdout .fnmatch_lines_random ([
319
331
"tpkg/test_the_test.py::test_inner_south*" ,
320
332
"*mark_south_migration_forwards*" ,
@@ -345,6 +357,7 @@ def test_inner_south():
345
357
ensure = True )
346
358
347
359
result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
360
+ assert result .ret == 0
348
361
result .stdout .fnmatch_lines_random ([
349
362
"tpkg/test_the_test.py::test_inner_south*" ,
350
363
"*PASSED*" ,
@@ -380,6 +393,7 @@ def test_inner_south():
380
393
python_files=*.py""" , 'pytest.ini' )
381
394
382
395
result = testdir .runpytest ('--tb=short' , '-v' , '-s' , '-c' , pytest_ini )
396
+ assert result .ret == 0
383
397
result .stdout .fnmatch_lines_random ([
384
398
"tpkg/test.py::test_inner_south*" ,
385
399
"*mark_south_migration_forwards*" ,
@@ -408,6 +422,7 @@ def test_inner_migrations():
408
422
ensure = True )
409
423
410
424
result = testdir .runpytest ('--nomigrations' , '--tb=short' , '-v' )
425
+ assert result .ret == 0
411
426
result .stdout .fnmatch_lines (['*test_inner_migrations*PASSED*' ])
412
427
413
428
@pytest .mark .skipif (get_django_version () < (1 , 7 ),
@@ -453,4 +468,5 @@ class Migration(migrations.Migration):
453
468
]
454
469
""" , 'migrations/0001_initial.py' )
455
470
result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
471
+ assert result .ret == 0
456
472
result .stdout .fnmatch_lines (['*mark_migrations_run*' ])
0 commit comments