title: Do you unit test __init__ method if it sets up public attributes of a class?
body: <p>I am trying to apply Sandi Metz’s rules of unit testing only the messages that really have influence on the public side of the object and testing all the private stuff indirectly by testing the public stuff.</p>
  
  <p>Thus we avoid testing the implementation and can change it at any time.</p>
  
  <p>My question is this: if my <code>__init__</code> method sets up publicly available instance attributes should I unit test it as well. </p>
  
  <p>I am basically not sure if the init should be treated as private method (and believe that if it sets public stuff it should be unit tested).</p>
  
  <p>Example:</p>
  
  <pre><code>MyClass(object):
  
      def __init__(self, public_parameter_1, public_param_2)
  
          self.public_parameter_1 = public_parameter_1
          self.public_parameter_2 = public_parameter_2
  </code></pre>
  
  <p>The test using pytest:</p>
  
  <pre><code>def test_instance():
  
      instance = MyClass(1, 2)
  
      assert instance.public_parameter_1 == 1
      assert instance.public_parameter_2 == 2
  </code></pre>