Check that classes are using slots and are weak-referenceable
(self)
| 92 | Selector(r1).xpath("//text()").getall() |
| 93 | |
| 94 | def test_weakref_slots(self): |
| 95 | """Check that classes are using slots and are weak-referenceable""" |
| 96 | x = Selector(text="") |
| 97 | weakref.ref(x) |
| 98 | assert not hasattr(x, "__dict__"), ( |
| 99 | f"{x.__class__.__name__} does not use __slots__" |
| 100 | ) |
| 101 | |
| 102 | def test_selector_bad_args(self): |
| 103 | with pytest.raises(ValueError, match="received both response and text"): |