1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

use six.moves instead of _compat

This commit is contained in:
Kevin McCarthy
2014-03-08 23:01:49 -10:00
parent 985e573303
commit 6d0a8d8ed9
10 changed files with 10 additions and 18 deletions

View File

@@ -3,10 +3,10 @@
# External imports # External imports
import os import os
from six.moves.urllib.request import urlopen
# Internal imports # Internal imports
import vcr import vcr
from vcr._compat import urlopen
def test_nonexistent_directory(tmpdir): def test_nonexistent_directory(tmpdir):

View File

@@ -2,7 +2,7 @@ import os
import json import json
import pytest import pytest
import vcr import vcr
from vcr._compat import urlopen from six.moves.urllib.request import urlopen
def test_set_serializer_default_config(tmpdir): def test_set_serializer_default_config(tmpdir):

View File

@@ -4,10 +4,10 @@
# External imports # External imports
import os import os
import time import time
from six.moves.urllib.request import urlopen
# Internal imports # Internal imports
import vcr import vcr
from vcr._compat import urlopen
def test_disk_saver_nowrite(tmpdir): def test_disk_saver_nowrite(tmpdir):

View File

@@ -1,6 +1,6 @@
import pytest import pytest
import vcr import vcr
from vcr._compat import urlopen from six.moves.urllib.request import urlopen
def test_making_extra_request_raises_exception(tmpdir): def test_making_extra_request_raises_exception(tmpdir):

View File

@@ -1,7 +1,7 @@
import os import os
import pytest import pytest
import vcr import vcr
from vcr._compat import urlopen from six.moves.urllib.request import urlopen
def test_once_record_mode(tmpdir): def test_once_record_mode(tmpdir):

View File

@@ -1,5 +1,5 @@
import vcr import vcr
from vcr._compat import urlopen from six.moves.urllib.request import urlopen
def true_matcher(r1, r2): def true_matcher(r1, r2):

View File

@@ -1,5 +1,5 @@
import vcr import vcr
from vcr._compat import urlopen from six.moves.urllib.request import urlopen
def test_recorded_request_url_with_redirected_request(tmpdir): def test_recorded_request_url_with_redirected_request(tmpdir):

View File

@@ -5,10 +5,11 @@
import os import os
import pytest import pytest
from six.moves.urllib.request import urlopen
from six.moves.urllib_parse import urlencode
# Internal imports # Internal imports
import vcr import vcr
from vcr._compat import urlopen, urlencode
from assertions import assert_cassette_empty, assert_cassette_has_one_response from assertions import assert_cassette_empty, assert_cassette_has_one_response

View File

@@ -1,9 +0,0 @@
try:
import httplib
from urllib2 import urlopen
from urllib import urlencode
except ImportError:
import http.client as httplib
from urllib.request import urlopen
from urllib.parse import urlencode

View File

@@ -1,7 +1,7 @@
'''Utilities for patching in cassettes''' '''Utilities for patching in cassettes'''
from .stubs import VCRHTTPConnection, VCRHTTPSConnection from .stubs import VCRHTTPConnection, VCRHTTPSConnection
from vcr._compat import httplib from six.moves import http_client as httplib
# Save some of the original types for the purposes of unpatching # Save some of the original types for the purposes of unpatching