import pytest
import unittest

class MyTest(unittest.TestCase):

	@pytest.fixture(autouse=True)
	def initdir(self, tmpdir):
		tmpdir.chdir() # change to pytest-provided temporary directory
		tmpdir.join("samplefile.ini").write("# testdata")

	def test_method(self):
		with open("samplefile.ini") as f:
			s = f.read()
		assert "testdata" in s
1081b8e54ed1206c8945fd205f5c0b30b8beaa16
<mask token>


class MyTest(unittest.TestCase):
    <mask token>
    <mask token>

<mask token>


class MyTest(unittest.TestCase):
    <mask token>

    def test_method(self):
        with open('samplefile.ini') as f:
            s = f.read()
        assert 'testdata' in s

<mask token>


class MyTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def initdir(self, tmpdir):
        tmpdir.chdir()
        tmpdir.join('samplefile.ini').write('# testdata')

    def test_method(self):
        with open('samplefile.ini') as f:
            s = f.read()
        assert 'testdata' in s

import pytest
import unittest


class MyTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def initdir(self, tmpdir):
        tmpdir.chdir()
        tmpdir.join('samplefile.ini').write('# testdata')

    def test_method(self):
        with open('samplefile.ini') as f:
            s = f.read()
        assert 'testdata' in s

import pytest
import unittest

class MyTest(unittest.TestCase):

	@pytest.fixture(autouse=True)
	def initdir(self, tmpdir):
		tmpdir.chdir() # change to pytest-provided temporary directory
		tmpdir.join("samplefile.ini").write("# testdata")

	def test_method(self):
		with open("samplefile.ini") as f:
			s = f.read()
		assert "testdata" in s