If takes_self on factories is True, self is passed.
(self)
| 845 | assert isinstance(i.b, D) |
| 846 | |
| 847 | def test_factory_takes_self(self): |
| 848 | """ |
| 849 | If takes_self on factories is True, self is passed. |
| 850 | """ |
| 851 | C = make_class( |
| 852 | "C", |
| 853 | { |
| 854 | "x": attr.ib( |
| 855 | default=Factory((lambda self: self), takes_self=True) |
| 856 | ) |
| 857 | }, |
| 858 | ) |
| 859 | |
| 860 | i = C() |
| 861 | |
| 862 | assert i is i.x |
| 863 | |
| 864 | def test_factory_hashable(self): |
| 865 | """ |
nothing calls this directly
no test coverage detected