(ModelTwo, copy_method)
| 162 | |
| 163 | |
| 164 | def test_deep_copy(ModelTwo, copy_method): |
| 165 | m = ModelTwo(a=24, d=Model(a='12')) |
| 166 | m._foo_ = {'new value'} |
| 167 | m2 = copy_method(m, deep=True) |
| 168 | |
| 169 | assert m.a == m2.a == 24 |
| 170 | assert m.b == m2.b == 10 |
| 171 | assert m.c == m2.c == 'foobar' |
| 172 | assert m.d is not m2.d |
| 173 | assert m == m2 |
| 174 | assert m._foo_ == m2._foo_ |
| 175 | assert m._foo_ is not m2._foo_ |
| 176 | |
| 177 | |
| 178 | @pytest.mark.thread_unsafe(reason='`pytest.warns()` is thread unsafe') |
nothing calls this directly
no test coverage detected