@@ -63,7 +63,7 @@ def test_quickstart_main_choose_individual_pythons_and_pytest(
63
63
deps =
64
64
pytest
65
65
""" .lstrip ()
66
- result = open ( 'tox.ini' ). read ()
66
+ result = read_tox ()
67
67
assert (result == expected_tox_ini )
68
68
69
69
def test_quickstart_main_choose_individual_pythons_and_nose_adds_deps (
@@ -105,7 +105,7 @@ def test_quickstart_main_choose_individual_pythons_and_nose_adds_deps(
105
105
deps =
106
106
nose
107
107
""" .lstrip ()
108
- result = open ( 'tox.ini' ). read ()
108
+ result = read_tox ()
109
109
assert (result == expected_tox_ini )
110
110
111
111
def test_quickstart_main_choose_individual_pythons_and_trial_adds_deps (
@@ -147,7 +147,7 @@ def test_quickstart_main_choose_individual_pythons_and_trial_adds_deps(
147
147
deps =
148
148
twisted
149
149
""" .lstrip ()
150
- result = open ( 'tox.ini' ). read ()
150
+ result = read_tox ()
151
151
assert (result == expected_tox_ini )
152
152
153
153
def test_quickstart_main_choose_individual_pythons_and_pytest_adds_deps (
@@ -188,7 +188,7 @@ def test_quickstart_main_choose_individual_pythons_and_pytest_adds_deps(
188
188
deps =
189
189
pytest
190
190
""" .lstrip ()
191
- result = open ( 'tox.ini' ). read ()
191
+ result = read_tox ()
192
192
assert (result == expected_tox_ini )
193
193
194
194
def test_quickstart_main_choose_py27_and_pytest_adds_deps (
@@ -221,7 +221,7 @@ def test_quickstart_main_choose_py27_and_pytest_adds_deps(
221
221
deps =
222
222
pytest
223
223
""" .lstrip ()
224
- result = open ( 'tox.ini' ). read ()
224
+ result = read_tox ()
225
225
assert (result == expected_tox_ini )
226
226
227
227
def test_quickstart_main_choose_py27_and_py33_and_pytest_adds_deps (
@@ -254,7 +254,7 @@ def test_quickstart_main_choose_py27_and_py33_and_pytest_adds_deps(
254
254
deps =
255
255
pytest
256
256
""" .lstrip ()
257
- result = open ( 'tox.ini' ). read ()
257
+ result = read_tox ()
258
258
assert (result == expected_tox_ini )
259
259
260
260
def test_quickstart_main_choose_all_pythons_and_pytest_adds_deps (
@@ -287,7 +287,7 @@ def test_quickstart_main_choose_all_pythons_and_pytest_adds_deps(
287
287
deps =
288
288
pytest
289
289
""" .lstrip ()
290
- result = open ( 'tox.ini' ). read ()
290
+ result = read_tox ()
291
291
assert (result == expected_tox_ini )
292
292
293
293
def test_quickstart_main_choose_individual_pythons_and_defaults (
@@ -329,7 +329,7 @@ def test_quickstart_main_choose_individual_pythons_and_defaults(
329
329
deps =
330
330
331
331
""" .lstrip ()
332
- result = open ( 'tox.ini' ). read ()
332
+ result = read_tox ()
333
333
assert (result == expected_tox_ini )
334
334
335
335
def test_quickstart_main_existing_tox_ini (self , monkeypatch ):
@@ -376,7 +376,7 @@ def test_quickstart_main_existing_tox_ini(self, monkeypatch):
376
376
deps =
377
377
378
378
""" .lstrip ()
379
- result = open ('tox-generated.ini' ). read ( )
379
+ result = read_tox ('tox-generated.ini' )
380
380
assert (result == expected_tox_ini )
381
381
382
382
@@ -408,7 +408,7 @@ def test_pytest(self):
408
408
""" .lstrip ()
409
409
d = tox ._quickstart .process_input (d )
410
410
tox ._quickstart .generate (d )
411
- result = open ( 'tox.ini' ). read ()
411
+ result = read_tox ()
412
412
# print(result)
413
413
assert (result == expected_tox_ini )
414
414
@@ -435,7 +435,7 @@ def test_setup_py_test(self):
435
435
""" .lstrip ()
436
436
d = tox ._quickstart .process_input (d )
437
437
tox ._quickstart .generate (d )
438
- result = open ( 'tox.ini' ). read ()
438
+ result = read_tox ()
439
439
# print(result)
440
440
assert (result == expected_tox_ini )
441
441
@@ -461,7 +461,7 @@ def test_trial(self):
461
461
""" .lstrip ()
462
462
d = tox ._quickstart .process_input (d )
463
463
tox ._quickstart .generate (d )
464
- result = open ( 'tox.ini' ). read ()
464
+ result = read_tox ()
465
465
# print(result)
466
466
assert (result == expected_tox_ini )
467
467
@@ -492,6 +492,11 @@ def test_nosetests(self):
492
492
""" .lstrip ()
493
493
d = tox ._quickstart .process_input (d )
494
494
tox ._quickstart .generate (d )
495
- result = open ( 'tox.ini' ). read ()
495
+ result = read_tox ()
496
496
# print(result)
497
497
assert (result == expected_tox_ini )
498
+
499
+
500
+ def read_tox (fname = 'tox.ini' ):
501
+ with open (fname ) as f :
502
+ return f .read ()
0 commit comments