| 717 | assert y.element2 == "this is the shared attr" |
| 718 | |
| 719 | def test_no_double_state(self): |
| 720 | states = set() |
| 721 | |
| 722 | class Foo: |
| 723 | def __init__(self): |
| 724 | states.add(attributes.instance_state(self)) |
| 725 | |
| 726 | class Bar(Foo): |
| 727 | def __init__(self): |
| 728 | states.add(attributes.instance_state(self)) |
| 729 | Foo.__init__(self) |
| 730 | |
| 731 | instrumentation.register_class(Foo) |
| 732 | instrumentation.register_class(Bar) |
| 733 | |
| 734 | b = Bar() |
| 735 | eq_(len(states), 1) |
| 736 | eq_(list(states)[0].obj(), b) |
| 737 | |
| 738 | def test_inheritance2(self): |
| 739 | """test that the attribute manager can properly traverse the |