Skip to content

Commit b4fb84f

Browse files
committed
Oops, there's no test.support.os_helper on 3.9
1 parent 8b8e68d commit b4fb84f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Lib/test/test_genericpath.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
import unittest
99
import warnings
1010
from test import support
11-
from test.support import os_helper
1211
from test.support.script_helper import assert_python_ok
13-
from test.support import FakePath
12+
from test.support import FakePath, EnvironmentVarGuard
1413

1514

1615
def create_file(filename, data=b'foo'):
@@ -375,7 +374,7 @@ def test_splitdrive(self):
375374

376375
def test_expandvars(self):
377376
expandvars = self.pathmodule.expandvars
378-
with support.EnvironmentVarGuard() as env:
377+
with EnvironmentVarGuard() as env:
379378
env.clear()
380379
env["foo"] = "bar"
381380
env["{foo"] = "baz1"
@@ -409,7 +408,7 @@ def test_expandvars_nonascii(self):
409408
expandvars = self.pathmodule.expandvars
410409
def check(value, expected):
411410
self.assertEqual(expandvars(value), expected)
412-
with support.EnvironmentVarGuard() as env:
411+
with EnvironmentVarGuard() as env:
413412
env.clear()
414413
nonascii = support.FS_NONASCII
415414
env['spam'] = nonascii
@@ -433,7 +432,7 @@ def check(value, expected):
433432
@support.requires_resource('cpu')
434433
def test_expandvars_large(self):
435434
expandvars = self.pathmodule.expandvars
436-
with os_helper.EnvironmentVarGuard() as env:
435+
with EnvironmentVarGuard() as env:
437436
env.clear()
438437
env["A"] = "B"
439438
n = 100_000

Lib/test/test_ntpath.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import unittest
55
import warnings
66
from ntpath import ALLOW_MISSING
7-
from test.support import TestFailed, FakePath, os_helper
7+
from test.support import TestFailed, FakePath, EnvironmentVarGuard
88
from test import support, test_genericpath
99
from tempfile import TemporaryFile
1010

@@ -641,7 +641,7 @@ def test_realpath_cwd(self):
641641
ntpath.realpath("file.txt", **kwargs))
642642

643643
def test_expandvars(self):
644-
with support.EnvironmentVarGuard() as env:
644+
with EnvironmentVarGuard() as env:
645645
env.clear()
646646
env["foo"] = "bar"
647647
env["{foo"] = "baz1"
@@ -670,7 +670,7 @@ def test_expandvars(self):
670670
def test_expandvars_nonascii(self):
671671
def check(value, expected):
672672
tester('ntpath.expandvars(%r)' % value, expected)
673-
with support.EnvironmentVarGuard() as env:
673+
with EnvironmentVarGuard() as env:
674674
env.clear()
675675
nonascii = support.FS_NONASCII
676676
env['spam'] = nonascii
@@ -689,7 +689,7 @@ def check(value, expected):
689689
@support.requires_resource('cpu')
690690
def test_expandvars_large(self):
691691
expandvars = ntpath.expandvars
692-
with os_helper.EnvironmentVarGuard() as env:
692+
with EnvironmentVarGuard() as env:
693693
env.clear()
694694
env["A"] = "B"
695695
n = 100_000
@@ -702,7 +702,7 @@ def test_expandvars_large(self):
702702
def test_expanduser(self):
703703
tester('ntpath.expanduser("test")', 'test')
704704

705-
with support.EnvironmentVarGuard() as env:
705+
with EnvironmentVarGuard() as env:
706706
env.clear()
707707
tester('ntpath.expanduser("~test")', '~test')
708708

0 commit comments

Comments
 (0)