summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailcap.py
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-06-30 13:46:31 (GMT)
committerGitHub <noreply@github.com>2020-06-30 13:46:31 (GMT)
commit0c4f0f3b29d84063700217dcf90ad6860ed71c70 (patch)
tree22c7c745a13327858287f8ea010794ba51af7be9 /Lib/test/test_mailcap.py
parent3ddc634cd5469550c0c2dc5a6051a70739995699 (diff)
downloadcpython-0c4f0f3b29d84063700217dcf90ad6860ed71c70.zip
cpython-0c4f0f3b29d84063700217dcf90ad6860ed71c70.tar.gz
cpython-0c4f0f3b29d84063700217dcf90ad6860ed71c70.tar.bz2
bpo-40275: Use new test.support helper submodules in tests (GH-21169)
Diffstat (limited to 'Lib/test/test_mailcap.py')
-rw-r--r--Lib/test/test_mailcap.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_mailcap.py b/Lib/test/test_mailcap.py
index c08423c..51a0c7d 100644
--- a/Lib/test/test_mailcap.py
+++ b/Lib/test/test_mailcap.py
@@ -2,6 +2,7 @@ import mailcap
import os
import copy
import test.support
+from test.support import os_helper
import unittest
# Location of mailcap file
@@ -74,7 +75,7 @@ class HelperFunctionTest(unittest.TestCase):
self.assertIsInstance(mcfiles, list)
for m in mcfiles:
self.assertIsInstance(m, str)
- with test.support.EnvironmentVarGuard() as env:
+ with os_helper.EnvironmentVarGuard() as env:
# According to RFC 1524, if MAILCAPS env variable exists, use that
# and only that.
if "MAILCAPS" in env:
@@ -136,7 +137,7 @@ class GetcapsTest(unittest.TestCase):
# Test mailcap.getcaps() using mock mailcap file in this dir.
# Temporarily override any existing system mailcap file by pointing the
# MAILCAPS environment variable to our mock file.
- with test.support.EnvironmentVarGuard() as env:
+ with os_helper.EnvironmentVarGuard() as env:
env["MAILCAPS"] = MAILCAPFILE
caps = mailcap.getcaps()
self.assertDictEqual(caps, MAILCAPDICT)