Skip to content

Commit

Permalink
tests: fix new clippy warning (does not like Foo::foo)
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Aug 17, 2021
1 parent fc90092 commit cd30da5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_class_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Foo {
}

#[classattr]
fn foo() -> Foo {
fn a_foo() -> Foo {
Foo { x: 1 }
}
}
Expand All @@ -54,7 +54,7 @@ fn class_attributes() {
py_assert!(py, foo_obj, "foo_obj.RENAMED_CONST == 'foobar_2'");
py_assert!(py, foo_obj, "foo_obj.a == 5");
py_assert!(py, foo_obj, "foo_obj.B == 'bar'");
py_assert!(py, foo_obj, "foo_obj.foo.x == 1");
py_assert!(py, foo_obj, "foo_obj.a_foo.x == 1");
}

// Ignored because heap types are not immutable:
Expand All @@ -71,7 +71,7 @@ fn class_attributes_are_immutable() {
#[pymethods]
impl Bar {
#[classattr]
fn foo() -> Foo {
fn a_foo() -> Foo {
Foo { x: 3 }
}
}
Expand All @@ -83,7 +83,7 @@ fn recursive_class_attributes() {

let foo_obj = py.get_type::<Foo>();
let bar_obj = py.get_type::<Bar>();
py_assert!(py, foo_obj, "foo_obj.foo.x == 1");
py_assert!(py, foo_obj, "foo_obj.a_foo.x == 1");
py_assert!(py, foo_obj, "foo_obj.bar.x == 2");
py_assert!(py, bar_obj, "bar_obj.foo.x == 3");
py_assert!(py, bar_obj, "bar_obj.a_foo.x == 3");
}

0 comments on commit cd30da5

Please sign in to comment.