summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-03-03 12:19:29 (GMT)
committerGitHub <noreply@github.com>2018-03-03 12:19:29 (GMT)
commitfbdd075c64a5229dfa26632cf1b2cf2361dc5003 (patch)
treea959f2fc206302c629b217ca811f305b7f5060be /Lib/test/test_compile.py
parent10fb1bf7766e7eb9500d328ddd1035e3f823fb57 (diff)
downloadcpython-fbdd075c64a5229dfa26632cf1b2cf2361dc5003.zip
cpython-fbdd075c64a5229dfa26632cf1b2cf2361dc5003.tar.gz
cpython-fbdd075c64a5229dfa26632cf1b2cf2361dc5003.tar.bz2
[3.6] bpo-32964: Reuse a testing implementation of the path protocol in tests. (GH-5930). (GH-5958)
(cherry picked from commit b21d155f57d284aecf9092a9bd24258293965c2f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 7fe3465..c9812e4 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -6,7 +6,7 @@ import _ast
import tempfile
import types
from test import support
-from test.support import script_helper
+from test.support import script_helper, FakePath
class TestSpecifics(unittest.TestCase):
@@ -670,13 +670,7 @@ if 1:
def test_path_like_objects(self):
# An implicit test for PyUnicode_FSDecoder().
- class PathLike:
- def __init__(self, path):
- self._path = path
- def __fspath__(self):
- return self._path
-
- compile("42", PathLike("test_compile_pathlike"), "single")
+ compile("42", FakePath("test_compile_pathlike"), "single")
class TestStackSize(unittest.TestCase):