mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21449)
This commit is contained in:
parent
488512bf49
commit
a7f5d93bb6
20 changed files with 154 additions and 132 deletions
|
@ -8,6 +8,7 @@ import unittest
|
|||
import warnings
|
||||
|
||||
from test import support
|
||||
from test.support import os_helper
|
||||
|
||||
|
||||
class SortedDict(collections.UserDict):
|
||||
|
@ -1063,17 +1064,17 @@ class MultilineValuesTestCase(BasicTestCase, unittest.TestCase):
|
|||
cf.add_section(s)
|
||||
for j in range(10):
|
||||
cf.set(s, 'lovely_spam{}'.format(j), self.wonderful_spam)
|
||||
with open(support.TESTFN, 'w') as f:
|
||||
with open(os_helper.TESTFN, 'w') as f:
|
||||
cf.write(f)
|
||||
|
||||
def tearDown(self):
|
||||
os.unlink(support.TESTFN)
|
||||
os.unlink(os_helper.TESTFN)
|
||||
|
||||
def test_dominating_multiline_values(self):
|
||||
# We're reading from file because this is where the code changed
|
||||
# during performance updates in Python 3.2
|
||||
cf_from_file = self.newconfig()
|
||||
with open(support.TESTFN) as f:
|
||||
with open(os_helper.TESTFN) as f:
|
||||
cf_from_file.read_file(f)
|
||||
self.assertEqual(cf_from_file.get('section8', 'lovely_spam4'),
|
||||
self.wonderful_spam.replace('\t\n', '\n'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue