def METHOD_NAME(self, tmpdir, envopt, pytestconfig):
    """
    Run test in own dir so we can keep results separate from
    other tests.
    """
    if not tmpdir.ensure(self.subdir, dir=True):
        p = tmpdir.mkdir(self.subdir).strpath
    else:
        p = tmpdir.join(self.subdir).strpath
    os.chdir(p)
    # NOTE: This could be explicitly controlled using pytest fixture
    #       but too many ways to do the same thing would be confusing.
    #       Refine this logic if using pytest fixture.
    # HSTCAL cannot open remote CRDS on FTP but central storage is okay.
    # So use central storage if available to avoid FTP.
    if self.prevref is None or self.prevref.startswith(('ftp', 'http')):
        os.environ[self.refstr] = p + os.sep
        self.use_ftp_crds = True
    # This controls astropy.io.fits timeout
    conf.remote_timeout = self.timeout
    # Update tree to point to correct environment
    self.tree = envopt
    # Collect pytest configuration values specified in setup.cfg or pytest.ini
    self.inputs_root = pytestconfig.getini('inputs_root')[0]
    self.results_root = pytestconfig.getini('results_root')[0]