mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
[3.13] gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065) (GH-119087)
(cherry picked from commit 0152dc4ff5
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
bca7fb0e7a
commit
1dc7fcd803
19 changed files with 115 additions and 127 deletions
|
@ -2,7 +2,6 @@ import collections
|
|||
import configparser
|
||||
import io
|
||||
import os
|
||||
import pathlib
|
||||
import textwrap
|
||||
import unittest
|
||||
|
||||
|
@ -745,12 +744,12 @@ boolean {0[0]} NO
|
|||
self.assertEqual(cf.get("Foo Bar", "foo"), "newbar")
|
||||
# check when we pass only a Path object:
|
||||
cf = self.newconfig()
|
||||
parsed_files = cf.read(pathlib.Path(file1), encoding="utf-8")
|
||||
parsed_files = cf.read(os_helper.FakePath(file1), encoding="utf-8")
|
||||
self.assertEqual(parsed_files, [file1])
|
||||
self.assertEqual(cf.get("Foo Bar", "foo"), "newbar")
|
||||
# check when we passed both a filename and a Path object:
|
||||
cf = self.newconfig()
|
||||
parsed_files = cf.read([pathlib.Path(file1), file1], encoding="utf-8")
|
||||
parsed_files = cf.read([os_helper.FakePath(file1), file1], encoding="utf-8")
|
||||
self.assertEqual(parsed_files, [file1, file1])
|
||||
self.assertEqual(cf.get("Foo Bar", "foo"), "newbar")
|
||||
# check when we pass only missing files:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue