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

Format project with black (#467)

Format with line length 110 to match flake8

make black part of linting check

Update travis spec for updated black requirements

Add diff output for black on failure

update changelog
This commit is contained in:
Josh Peak
2019-08-24 11:36:35 +10:00
committed by GitHub
parent 75969de601
commit 7caf29735a
70 changed files with 2000 additions and 2217 deletions

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
'''Basic tests about save behavior'''
"""Basic tests about save behavior"""
# External imports
import os
@@ -11,11 +11,11 @@ import vcr
def test_disk_saver_nowrite(tmpdir, httpbin):
'''
"""
Ensure that when you close a cassette without changing it it doesn't
rewrite the file
'''
fname = str(tmpdir.join('synopsis.yaml'))
"""
fname = str(tmpdir.join("synopsis.yaml"))
with vcr.use_cassette(fname) as cass:
urlopen(httpbin.url).read()
assert cass.play_count == 0
@@ -31,11 +31,11 @@ def test_disk_saver_nowrite(tmpdir, httpbin):
def test_disk_saver_write(tmpdir, httpbin):
'''
"""
Ensure that when you close a cassette after changing it it does
rewrite the file
'''
fname = str(tmpdir.join('synopsis.yaml'))
"""
fname = str(tmpdir.join("synopsis.yaml"))
with vcr.use_cassette(fname) as cass:
urlopen(httpbin.url).read()
assert cass.play_count == 0
@@ -45,9 +45,9 @@ def test_disk_saver_write(tmpdir, httpbin):
# the mtime doesn't change
time.sleep(1)
with vcr.use_cassette(fname, record_mode='any') as cass:
with vcr.use_cassette(fname, record_mode="any") as cass:
urlopen(httpbin.url).read()
urlopen(httpbin.url + '/get').read()
urlopen(httpbin.url + "/get").read()
assert cass.play_count == 1
assert cass.dirty
last_mod2 = os.path.getmtime(fname)