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

Fix Py3 tests using b'' literal

This commit is contained in:
Dan Passaro
2016-07-12 13:59:45 -04:00
committed by Jair Henrique
parent 995020bf06
commit 7599f4d50a

View File

@@ -67,7 +67,7 @@ def test_dont_record_on_exception(tmpdir):
@my_vcr.use_cassette(str(tmpdir.join('dontsave.yml'))) @my_vcr.use_cassette(str(tmpdir.join('dontsave.yml')))
def some_test(): def some_test():
assert 'Not in content' in urlopen('http://httpbin.org/get') assert b'Not in content' in urlopen('http://httpbin.org/get')
with pytest.raises(AssertionError): with pytest.raises(AssertionError):
some_test() some_test()
@@ -77,6 +77,6 @@ def test_dont_record_on_exception(tmpdir):
# Make sure context decorator has the same behavior # Make sure context decorator has the same behavior
with pytest.raises(AssertionError): with pytest.raises(AssertionError):
with my_vcr.use_cassette(str(tmpdir.join('dontsave2.yml'))): with my_vcr.use_cassette(str(tmpdir.join('dontsave2.yml'))):
assert 'Not in content' in urlopen('http://httpbin.org/get').read() assert b'Not in content' in urlopen('http://httpbin.org/get').read()
assert not os.path.exists(str(tmpdir.join('dontsave2.yml'))) assert not os.path.exists(str(tmpdir.join('dontsave2.yml')))