8000 Config plot option by aneda · Pull Request #260 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

Config plot option #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jul 20, 2015
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stash/restore session in PlotlyTestCase.
  • Loading branch information
theengineear committed Jul 15, 2015
commit f93e6df0a3db001939b95cde7faae33fd5a079ae
9 changes: 9 additions & 0 deletions plotly/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import copy
import json
from numbers import Number as Num
from unittest import TestCase

from plotly import session
from plotly.tools import CREDENTIALS_FILE, CONFIG_FILE, _file_permissions


Expand All @@ -12,6 +14,7 @@ class PlotlyTestCase(TestCase):
def __init__(self, **kwargs):
self._file_credentials = None
self._file_config = None
self._session = None
super(PlotlyTestCase, self).__init__(**kwargs)

def setUp(self):
Expand All @@ -36,6 +39,12 @@ def restore_file_credentials_and_config(self):
with open(CONFIG_FILE, 'w') as f:
json.load(self._file_config, f)

def stash_session(self):
self._session = copy.deepcopy(session._session)

def restore_session(self):
session._session.clear() # clear and update to preserve references.
session._session.update(self._session)

def compare_dict(dict1, dict2, equivalent=True, msg='', tol=10e-8):
for key in dict1:
Expand Down
0