Fix for python 2.

This commit is contained in:
Michael Lazar
2016-07-15 22:42:19 -07:00
parent add11e9f22
commit 23267d8a4b

View File

@@ -125,17 +125,18 @@ def refresh_token(request):
@pytest.yield_fixture() @pytest.yield_fixture()
def config(): def config():
with patch('rtv.config.Config.save_history'), \ conf = Config()
patch('rtv.config.Config.delete_history'), \ with mock.patch.object(conf, 'save_history'), \
patch('rtv.config.Config.save_refresh_token'), \ mock.patch.object(conf, 'delete_history'), \
patch('rtv.config.Config.delete_refresh_token'): 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 # Skip the os.remove
self.refresh_token = None conf.refresh_token = None
Config.delete_refresh_token.side_effect = delete_refresh_token conf.delete_refresh_token.side_effect = delete_refresh_token
yield Config() yield conf
@pytest.yield_fixture() @pytest.yield_fixture()