Skip to content

Commit 0fc6dc1

Browse files
committed
Use FakePath
1 parent c91aa82 commit 0fc6dc1

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Lib/test/test_capi/test_file.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
class CAPIFileTest(unittest.TestCase):
1010
def test_py_fopen(self):
1111
# Test Py_fopen() and Py_fclose()
12-
class FSPath:
13-
def __init__(self, path):
14-
self.path = path
15-
def __fspath__(self):
16-
return self.path
1712

1813
with open(__file__, "rb") as fp:
1914
source = fp.read()
@@ -23,7 +18,7 @@ def __fspath__(self):
2318
data = _testcapi.py_fopen(filename, "rb")
2419
self.assertEqual(data, source[:256])
2520

26-
data = _testcapi.py_fopen(FSPath(filename), "rb")
21+
data = _testcapi.py_fopen(os_helper.FakePath(filename), "rb")
2722
self.assertEqual(data, source[:256])
2823

2924
filenames = [

0 commit comments

Comments
 (0)