title: Pytest - How to make sure mutable fixture stay unchanged?
body: <p>I have some dummy fixtures:</p>
  <pre><code>import pytest
  
  
  @pytest.fixture
  def base():
      return {
          'name': 'John',
          'surname': 'Snow'
      }
  
  
  @pytest.fixture
  def data(base):
      base['name'] = 'Alfred'
      return base
  </code></pre>
  <p>Also there is test function:</p>
  <pre><code>def test_function(data, base):
      assert data == base
  </code></pre>
  <p>The result of the test is <strong>True</strong>. But it is unexpected result. As you could guess the problem is that in <strong>data</strong> fixture the <strong>name</strong> field was overwritten.</p>
  <p>This bug can be solved like this:</p>
  <pre><code>@pytest.fixture
  def data(base):
      base = copy.deepcopy(base)
      base['name'] = 'Alfred'
      return base
  </code></pre>
  <p>But may there is more standart way?</p>