def test_prev_layer(self): with self.assertRaises(AssertionError): Layer(15).prev_layer('') x = Layer(1) y = Layer(2) y.prev_layer(x) y.prev is x