mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Fix test_typing.test_unpack_wrong_type (#6009)
This commit is contained in:
1 parent
99c1afe0be
commit
3bce41baab
3 files changed
+4
-5
No files matched your search
Vendored
-2
@@ -5074,8 +5074,6 @@ order (MRO) for bases """
|
||||
gc.collect()
|
||||
self.assertEqual(Parent.__subclasses__(), [])
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_attr_raise_through_property(self):
|
||||
# test case for gh-103272
|
||||
class A:
|
||||
|
||||
Vendored
-2
@@ -1228,8 +1228,6 @@ class UnpackTests(BaseTestCase):
|
||||
self.assertEqual(PartNew[Unpack[tuple[str]]].__args__, (int, str))
|
||||
self.assertEqual(PartNew[Unpack[Tuple[str]]].__args__, (int, str))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_unpack_wrong_type(self):
|
||||
Ts = TypeVarTuple("Ts")
|
||||
class Gen[*Ts]: ...
|
||||
|
||||
@@ -286,7 +286,10 @@ fn getattro_wrapper(zelf: &PyObject, name: &Py<PyStr>, vm: &VirtualMachine) -> P
|
||||
let __getattr__ = identifier!(vm, __getattr__);
|
||||
match vm.call_special_method(zelf, __getattribute__, (name.to_owned(),)) {
|
||||
Ok(r) => Ok(r),
|
||||
Err(_) if zelf.class().has_attr(__getattr__) => {
|
||||
Err(e)
|
||||
if e.fast_isinstance(vm.ctx.exceptions.attribute_error)
|
||||
&& zelf.class().has_attr(__getattr__) =>
|
||||
{
|
||||
vm.call_special_method(zelf, __getattr__, (name.to_owned(),))
|
||||
}
|
||||
Err(e) => Err(e),
|
||||
|
||||
Reference in new issue
Block a user