1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +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

@@ -1,5 +1,7 @@
from urllib.request import urlopen
import pytest
import vcr
@@ -11,6 +13,7 @@ def false_matcher(r1, r2):
return False
@pytest.mark.online
def test_registered_true_matcher(tmpdir, mockbin_request_url):
my_vcr = vcr.VCR()
my_vcr.register_matcher("true", true_matcher)
@@ -26,6 +29,7 @@ def test_registered_true_matcher(tmpdir, mockbin_request_url):
urlopen(mockbin_request_url)
@pytest.mark.online
def test_registered_false_matcher(tmpdir, mockbin_request_url):
my_vcr = vcr.VCR()
my_vcr.register_matcher("false", false_matcher)