@@ -23,7 +23,7 @@ def test_db_can_be_accessed():
23
23
assert Item.objects.count() == 0
24
24
''' )
25
25
26
- result = django_testdir .runpytest ('-v' , '--reuse-db' )
26
+ result = django_testdir .runpytest_subprocess ('-v' , '--reuse-db' )
27
27
assert result .ret == 0
28
28
result .stdout .fnmatch_lines ([
29
29
"*test_db_can_be_accessed PASSED*" ,
@@ -55,7 +55,7 @@ def test_db_can_be_accessed():
55
55
56
56
# Do not pass in --create-db to make sure it is created when it
57
57
# does not exist
58
- result_first = django_testdir .runpytest ('-v' , '--reuse-db' )
58
+ result_first = django_testdir .runpytest_subprocess ('-v' , '--reuse-db' )
59
59
assert result_first .ret == 0
60
60
61
61
result_first .stdout .fnmatch_lines ([
@@ -66,7 +66,7 @@ def test_db_can_be_accessed():
66
66
mark_database ()
67
67
assert mark_exists ()
68
68
69
- result_second = django_testdir .runpytest ('-v' , '--reuse-db' )
69
+ result_second = django_testdir .runpytest_subprocess ('-v' , '--reuse-db' )
70
70
assert result_second .ret == 0
71
71
result_second .stdout .fnmatch_lines ([
72
72
"*test_db_can_be_accessed PASSED*" ,
@@ -75,7 +75,7 @@ def test_db_can_be_accessed():
75
75
# Make sure the database has not been re-created
76
76
assert mark_exists ()
77
77
78
- result_third = django_testdir .runpytest ('-v' , '--reuse-db' , '--create-db' )
78
+ result_third = django_testdir .runpytest_subprocess ('-v' , '--reuse-db' , '--create-db' )
79
79
assert result_third .ret == 0
80
80
result_third .stdout .fnmatch_lines ([
81
81
"*test_db_can_be_accessed PASSED*" ,
@@ -119,7 +119,7 @@ def test_a():
119
119
assert conn.settings_dict['NAME'] == '%s'
120
120
''' % (self .db_name_17 , self .db_name_before_17 ))
121
121
122
- result = django_testdir .runpytest ('--tb=short' , '-v' )
122
+ result = django_testdir .runpytest_subprocess ('--tb=short' , '-v' )
123
123
assert result .ret == 0
124
124
result .stdout .fnmatch_lines (['*test_a*PASSED*' ])
125
125
@@ -164,7 +164,7 @@ def test_d(settings):
164
164
_check(settings)
165
165
''' )
166
166
167
- result = django_testdir .runpytest ('-vv' , '-n2' , '-s' , '--reuse-db' )
167
+ result = django_testdir .runpytest_subprocess ('-vv' , '-n2' , '-s' , '--reuse-db' )
168
168
assert result .ret == 0
169
169
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
170
170
result .stdout .fnmatch_lines (['*PASSED*test_b*' ])
@@ -174,14 +174,14 @@ def test_d(settings):
174
174
assert db_exists ('gw0' )
175
175
assert db_exists ('gw1' )
176
176
177
- result = django_testdir .runpytest ('-vv' , '-n2' , '-s' , '--reuse-db' )
177
+ result = django_testdir .runpytest_subprocess ('-vv' , '-n2' , '-s' , '--reuse-db' )
178
178
assert result .ret == 0
179
179
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
180
180
result .stdout .fnmatch_lines (['*PASSED*test_b*' ])
181
181
result .stdout .fnmatch_lines (['*PASSED*test_c*' ])
182
182
result .stdout .fnmatch_lines (['*PASSED*test_d*' ])
183
183
184
- result = django_testdir .runpytest ('-vv' , '-n2' , '-s' , '--reuse-db' ,
184
+ result = django_testdir .runpytest_subprocess ('-vv' , '-n2' , '-s' , '--reuse-db' ,
185
185
'--create-db' )
186
186
assert result .ret == 0
187
187
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
@@ -213,7 +213,7 @@ def test_a():
213
213
assert conn.creation._get_test_db_name() == ':memory:'
214
214
''' )
215
215
216
- result = django_testdir .runpytest ('--tb=short' , '-vv' , '-n1' )
216
+ result = django_testdir .runpytest_subprocess ('--tb=short' , '-vv' , '-n1' )
217
217
assert result .ret == 0
218
218
result .stdout .fnmatch_lines (['*PASSED*test_a*' ])
219
219
@@ -234,7 +234,7 @@ def test_inner_south():
234
234
== ["mark_initial_data"]
235
235
''' )
236
236
237
- result = django_testdir_initial .runpytest ('--tb=short' , '-v' )
237
+ result = django_testdir_initial .runpytest_subprocess ('--tb=short' , '-v' )
238
238
assert result .ret == 0
239
239
result .stdout .fnmatch_lines (['*test_inner_south*PASSED*' ])
240
240
@@ -267,7 +267,7 @@ def test_inner_south():
267
267
== ["mark_initial_data"]
268
268
''' )
269
269
270
- result = django_testdir_initial .runpytest ('--tb=short' , '-v' , '-s' )
270
+ result = django_testdir_initial .runpytest_subprocess ('--tb=short' , '-v' , '-s' )
271
271
result .stdout .fnmatch_lines_random ([
272
272
"tpkg/test_the_test.py::test_inner_south*" ,
273
273
"*PASSED*" ,
@@ -297,7 +297,7 @@ def test_inner_south():
297
297
''' )
298
298
django_testdir_initial .mkpydir ('tpkg/app/south_migrations' )
299
299
300
- result = django_testdir_initial .runpytest ('--tb=short' , '-v' , '-s' )
300
+ result = django_testdir_initial .runpytest_subprocess ('--tb=short' , '-v' , '-s' )
301
301
assert result .ret != 0
302
302
# Can be OperationalError or DatabaseError (Django 1.4).
303
303
result .stdout .fnmatch_lines ([
@@ -324,7 +324,7 @@ def test_inner_south():
324
324
325
325
testdir .create_initial_south_migration ()
326
326
327
- result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
327
+ result = testdir .runpytest_subprocess ('--tb=short' , '-v' , '-s' )
328
328
assert result .ret == 0
329
329
result .stdout .fnmatch_lines (['*mark_south_migration_forwards*' ])
330
330
@@ -346,7 +346,7 @@ def test_inner_south():
346
346
pass
347
347
''' )
348
348
349
- result = django_testdir_initial .runpytest ('--tb=short' , '-v' , '-s' )
349
+ result = django_testdir_initial .runpytest_subprocess ('--tb=short' , '-v' , '-s' )
350
350
assert result .ret == 0
351
351
result .stdout .fnmatch_lines (['*PASSED*' ])
352
352
assert 'mark_south_migration_forwards' not in result .stdout .str ()
@@ -377,7 +377,7 @@ class Migration(SchemaMigration):
377
377
def forwards(self, orm):
378
378
print("mark_south_migration_forwards")
379
379
""" , 'south_migrations/0001_initial.py' )
380
- result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
380
+ result = testdir .runpytest_subprocess ('--tb=short' , '-v' , '-s' )
381
381
assert result .ret == 0
382
382
result .stdout .fnmatch_lines (['*mark_south_migration_forwards*' ])
383
383
@@ -404,7 +404,7 @@ def test_inner_south():
404
404
p .write ('raise Exception("This should not get imported.")' ,
405
405
ensure = True )
406
406
407
- result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
407
+ result = testdir .runpytest_subprocess ('--tb=short' , '-v' , '-s' )
408
408
assert result .ret == 0
409
409
result .stdout .fnmatch_lines_random ([
410
410
"tpkg/test_the_test.py::test_inner_south*" ,
@@ -440,7 +440,7 @@ def test_inner_south():
440
440
[pytest]
441
441
python_files=*.py""" , 'pytest.ini' )
442
442
443
- result = testdir .runpytest ('--tb=short' , '-v' , '-s' , '-c' , pytest_ini )
443
+ result = testdir .runpytest_subprocess ('--tb=short' , '-v' , '-s' , '-c' , pytest_ini )
444
444
assert result .ret == 0
445
445
result .stdout .fnmatch_lines_random ([
446
446
"tpkg/test.py::test_inner_south*" ,
@@ -469,7 +469,7 @@ def test_inner_migrations():
469
469
p .write ('raise Exception("This should not get imported.")' ,
470
470
ensure = True )
471
471
472
- result = testdir .runpytest ('--nomigrations' , '--tb=short' , '-v' )
472
+ result = testdir .runpytest_subprocess ('--nomigrations' , '--tb=short' , '-v' )
473
473
assert result .ret == 0
474
474
result .stdout .fnmatch_lines (['*test_inner_migrations*PASSED*' ])
475
475
@@ -515,6 +515,6 @@ class Migration(migrations.Migration):
515
515
),
516
516
]
517
517
""" , 'migrations/0001_initial.py' )
518
- result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
518
+ result = testdir .runpytest_subprocess ('--tb=short' , '-v' , '-s' )
519
519
assert result .ret == 0
520
520
result .stdout .fnmatch_lines (['*mark_migrations_run*' ])
0 commit comments