vcrpy is the python record/play package, below is the common way from the guideline
class TestCloudAPI(unittest.TestCase):
def test_get_api_token(self):
with vcr.use_cassette('fixtures/vcr_cassettes/test_get_api_token.yaml'):
# real request and testing
def test_container_lifecycle(self):
with vcr.use_cassette('fixtures/vcr_cassettes/test_container_lifecycle.yaml'):
I want to have different record files, so I have to repeat this in every method.
Is it possible to have one line somewhere to simplify this like:
TEST_CASE_VCR(USE_METHOD_AS_FILENAME)
class TestCloudAPI(unittest.TestCase):
def test_get_api_token(self):
# real request and testing
def test_container_lifecycle(self):