Fix for python 2.
This commit is contained in:
@@ -125,17 +125,18 @@ def refresh_token(request):
|
||||
|
||||
@pytest.yield_fixture()
|
||||
def config():
|
||||
with patch('rtv.config.Config.save_history'), \
|
||||
patch('rtv.config.Config.delete_history'), \
|
||||
patch('rtv.config.Config.save_refresh_token'), \
|
||||
patch('rtv.config.Config.delete_refresh_token'):
|
||||
conf = Config()
|
||||
with mock.patch.object(conf, 'save_history'), \
|
||||
mock.patch.object(conf, 'delete_history'), \
|
||||
mock.patch.object(conf, 'save_refresh_token'), \
|
||||
mock.patch.object(conf, 'delete_refresh_token'):
|
||||
|
||||
def delete_refresh_token(self):
|
||||
def delete_refresh_token():
|
||||
# Skip the os.remove
|
||||
self.refresh_token = None
|
||||
Config.delete_refresh_token.side_effect = delete_refresh_token
|
||||
conf.refresh_token = None
|
||||
conf.delete_refresh_token.side_effect = delete_refresh_token
|
||||
|
||||
yield Config()
|
||||
yield conf
|
||||
|
||||
|
||||
@pytest.yield_fixture()
|
||||
|
||||
Reference in New Issue
Block a user