diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-08-03 16:47:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-03 16:47:42 (GMT) |
commit | bb0424b122e3d222a558bd4177ce37befd3e0347 (patch) | |
tree | f5962e6276319558e48b702b6fa5a48f5c03ff6b /Lib/test/test_pydoc.py | |
parent | a7f5d93bb6906d0f999248b47295d3a59b130f4d (diff) | |
download | cpython-bb0424b122e3d222a558bd4177ce37befd3e0347.zip cpython-bb0424b122e3d222a558bd4177ce37befd3e0347.tar.gz cpython-bb0424b122e3d222a558bd4177ce37befd3e0347.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21451)
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index f0d7ffd..76d2af8 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -23,13 +23,12 @@ import xml.etree.ElementTree import textwrap from io import StringIO from collections import namedtuple +from test.support import os_helper from test.support.script_helper import assert_python_ok from test.support import threading_helper -from test.support import ( - TESTFN, rmtree, - reap_children, captured_output, captured_stdout, - captured_stderr, unlink, requires_docstrings -) +from test.support import (reap_children, captured_output, captured_stdout, + captured_stderr, requires_docstrings) +from test.support.os_helper import (TESTFN, rmtree, unlink) from test import pydoc_mod @@ -728,7 +727,7 @@ class PydocDocTest(unittest.TestCase): self.assertEqual(synopsis, expected) def test_synopsis_sourceless_empty_doc(self): - with test.support.temp_cwd() as test_dir: + with os_helper.temp_cwd() as test_dir: init_path = os.path.join(test_dir, 'foomod42.py') cached_path = importlib.util.cache_from_source(init_path) with open(init_path, 'w') as fobj: @@ -745,11 +744,11 @@ class PydocDocTest(unittest.TestCase): ('I Am A Doc', '\nHere is my description')) def test_is_package_when_not_package(self): - with test.support.temp_cwd() as test_dir: + with os_helper.temp_cwd() as test_dir: self.assertFalse(pydoc.ispackage(test_dir)) def test_is_package_when_is_package(self): - with test.support.temp_cwd() as test_dir: + with os_helper.temp_cwd() as test_dir: init_path = os.path.join(test_dir, '__init__.py') open(init_path, 'w').close() self.assertTrue(pydoc.ispackage(test_dir)) |