Skip to content

Commit 5f3bebe

Browse files
committed
Add pytest option to update cassettes
1 parent 4a842dc commit 5f3bebe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/hubstorage/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ def deserialize(self, cassette_string):
4343
my_vcr.serializer = 'gz'
4444

4545

46+
def pytest_addoption(parser):
47+
parser.addoption(
48+
"--update-cassettes", action="store_true", default=False,
49+
help="make tests with real services instead of vcr cassettes")
50+
51+
52+
def pytest_generate_tests(metafunc):
53+
if metafunc.config.option.update_cassettes:
54+
my_vcr.record_mode = 'all'
55+
56+
4657
@pytest.fixture(scope='session')
4758
def hsclient():
4859
return HubstorageClient(auth=TEST_AUTH, endpoint=TEST_ENDPOINT)

0 commit comments

Comments
 (0)