瀏覽代碼

Ignore requests to localhosts for all tests

JoostSijm 4 年之前
父節點
當前提交
e4fd1ab90e
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      tests/conftest.py

+ 9 - 1
tests/conftest.py

@@ -5,15 +5,23 @@ import os
 import pytest
 from dotenv import load_dotenv
 
-from rival_regions_wrapper import RemoteAuthentication, LocalAuthentication, ApiWrapper
+from rival_regions_wrapper import LocalAuthentication, ApiWrapper
 
 
 load_dotenv()
 
+
 class MissingAuthenticationError(Exception):
     """Error for missing authentication"""
 
 
+@pytest.fixture(scope='module')
+def vcr(vcr):
+    """Set parameters vor VCR"""
+    vcr.ignore_localhost = True
+    return vcr
+
+
 @pytest.fixture(scope="module")
 def api_wrapper():
     """Set up wrapper before test"""