mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21451)
This commit is contained in:
parent
a7f5d93bb6
commit
bb0424b122
20 changed files with 324 additions and 278 deletions
|
@ -2,9 +2,11 @@ import contextlib
|
|||
import sys
|
||||
import unittest
|
||||
from test import support
|
||||
from test.support import import_helper
|
||||
from test.support import os_helper
|
||||
import time
|
||||
|
||||
resource = support.import_module('resource')
|
||||
resource = import_helper.import_module('resource')
|
||||
|
||||
# This test is checking a few specific problem spots with the resource module.
|
||||
|
||||
|
@ -51,7 +53,7 @@ class ResourceTest(unittest.TestCase):
|
|||
limit_set = True
|
||||
except ValueError:
|
||||
limit_set = False
|
||||
f = open(support.TESTFN, "wb")
|
||||
f = open(os_helper.TESTFN, "wb")
|
||||
try:
|
||||
f.write(b"X" * 1024)
|
||||
try:
|
||||
|
@ -77,7 +79,7 @@ class ResourceTest(unittest.TestCase):
|
|||
finally:
|
||||
if limit_set:
|
||||
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
|
||||
support.unlink(support.TESTFN)
|
||||
os_helper.unlink(os_helper.TESTFN)
|
||||
|
||||
def test_fsize_toobig(self):
|
||||
# Be sure that setrlimit is checking for really large values
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue