Fix test_path_like_objects (#4773)

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
This commit is contained in:
ilp-sys
2023-06-13 00:10:50 +09:00
committed by GitHub
parent 2b4f607cbc
commit 8dbf7b27ef
4 changed files with 4 additions and 6 deletions

View File

@@ -757,8 +757,6 @@ if 1:
self.assertTrue(f1(0))
self.assertTrue(f2(0.0))
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_path_like_objects(self):
# An implicit test for PyUnicode_FSDecoder().
compile("42", FakePath("test_compile_pathlike"), "single")

View File

@@ -656,8 +656,6 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
self._check_script(script_name, "<run_path>", script_name,
script_name, expect_spec=False)
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_basic_script_with_path_object(self):
with temp_dir() as script_dir:
mod_name = 'script'

View File

@@ -21,7 +21,8 @@ mod builtins {
convert::ToPyException,
function::{
ArgBytesLike, ArgCallable, ArgIndex, ArgIntoBool, ArgIterable, ArgMapping,
ArgStrOrBytesLike, Either, FuncArgs, KwArgs, OptionalArg, OptionalOption, PosArgs,
ArgStrOrBytesLike, Either, FsPath, FuncArgs, KwArgs, OptionalArg, OptionalOption,
PosArgs,
},
protocol::{PyIter, PyIterReturn},
py_io,
@@ -97,7 +98,7 @@ mod builtins {
#[allow(dead_code)]
struct CompileArgs {
source: PyObjectRef,
filename: PyStrRef,
filename: FsPath,
mode: PyStrRef,
#[pyarg(any, optional)]
flags: OptionalArg<PyIntRef>,

View File

@@ -5,6 +5,7 @@ use crate::{
function::{ArgumentError, FromArgs, FsPath, FuncArgs},
AsObject, Py, PyObjectRef, PyPayload, PyResult, TryFromObject, VirtualMachine,
};
use std::{
ffi, fs, io,
path::{Path, PathBuf},