import pytest

@pytest.fixture(scope="session")
def initdir(tmpdir):
    tmpdir.chdir()

import pytest

@pytest.fixture(autouse=True)
def initdir(tmpdir):
    tmpdir.chdir()

Switch from scope="session" to autouse=True
Switch from scope="session" to autouse=True

  import pytest
  
- @pytest.fixture(scope="session")
+ @pytest.fixture(autouse=True)
  def initdir(tmpdir):
      tmpdir.chdir()
  
Switch from scope="session" to autouse=True
## Code Before:
import pytest

@pytest.fixture(scope="session")
def initdir(tmpdir):
    tmpdir.chdir()

## Instruction:
Switch from scope="session" to autouse=True
## Code After:
import pytest

@pytest.fixture(autouse=True)
def initdir(tmpdir):
    tmpdir.chdir()
