1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-10 01:25:34 +00:00

pytest.mark.online tests that need internet

This commit is contained in:
Jochen Sprickerhof
2022-12-16 18:55:56 +01:00
committed by Jochen Sprickerhof
parent e3aae34ef7
commit 7007e944ae
12 changed files with 57 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ from unittest import TextTestRunner, defaultTestLoader
from unittest.mock import MagicMock
from urllib.request import urlopen
import pytest
from vcr.unittest import VCRTestCase
@@ -126,6 +128,7 @@ def test_vcr_kwargs_cassette_dir():
assert test._get_cassette_library_dir.call_count == 0
@pytest.mark.online
def test_get_vcr_with_matcher(tmpdir):
cassette_dir = tmpdir.mkdir("cassettes")
assert len(cassette_dir.listdir()) == 0
@@ -160,6 +163,7 @@ def test_get_vcr_with_matcher(tmpdir):
)
@pytest.mark.online
def test_testcase_playback(tmpdir):
cassette_dir = tmpdir.mkdir("cassettes")
assert len(cassette_dir.listdir()) == 0