title: Mocking default values of attr.ib()
body: <p>I have a situation similar to the following</p>
  
  <pre><code>@attrs(auto_attribs=True)
  class ExampleClass:
    _prop: OtherClass = attrib(init=False, default=OtherClass())
    def some_func(self):
      test_var = OtherClass()
      test_var.some_func()
      self._prop.some_func()
  
  class OtherClass:
    def some_func(self):
      raise NotImplementedException
  
  def test_example(mocker):
    mocker.patch("path.to.example_class.OtherClass")
    sut = ExampleClass()
    sut.some_func()
  </code></pre>
  
  <p>All of the classes and tests are in different files and the mocker is a fixture provided by pytest_mock that is just a wrapper around unittest.mock that takes care of cleanup easier.</p>
  
  <p>The issue I run into is that when running the unit tests, test_var is getting correctly assigned as a MagicMock from the patch function. So when test_var.some_func() is returned everything is fine.</p>
  
  <p>When <code>self._prop.some_func()</code> is being called, the <code>NotImplementedException</code> is getting raised as it appears that the patch is not impacting this. </p>
  
  <p>In my unit test, I could set <code>sut._prop = MagicMock()</code> but this is an internal implementation detail making it a fragile test. </p>
  
  <p>How does one go about mocking the default variable in the attrib to avoid this? </p>