title: Pytest setup and teardown functions - same as self written functions?
body: <p>In the following example from pytest documentation:</p>
  
  <p><a href="https://i.stack.imgur.com/i7SrS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/i7SrS.png" alt="enter image description here"></a></p>
  
  <p>The function <code>setup_function</code> is supposed to setup some data for some other function, say <code>test_data</code>. So If i write the function <code>test_data</code> i will have to invoke <code>setup_function</code> like this:</p>
  
  <pre><code>def test_data():
      setup_function(....)
      &lt;Test logic here&gt;
      teardown_function(....)
  </code></pre>
  
  <p>So the only difference is name convention ?</p>
  
  <p>I don't understand how exactly is helps me creating setup data. I could have written the same code like this:</p>
  
  <pre><code>def test_data():
      my_own_setup_function(....)
      &lt;Test logic here&gt;
      my_own_teardown_function(....)
  </code></pre>
  
  <p>Since there is no way to tell pytest to automatically link a setup function to the test function it creates the setup data for - the parameter <code>function</code> of the function <code>setup_function</code> doesn't really help me if i don't need a function pointer.... so why bother creating name conventions for no reason?</p>
  
  <p>From what i understand, the setup function parameter <code>function</code> only helps me if i need to use a function pointer - something i rarely need.</p>