Skip to content

Commit

Permalink
Fix cleanup of Document
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 7, 2020
1 parent 7221f64 commit 27460c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions holoviews/tests/plotting/bokeh/testserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from bokeh.application import Application
from bokeh.client import pull_session
from bokeh.document import Document
from bokeh.io import curdoc
from bokeh.io.doc import curdoc, set_curdoc
from bokeh.models import ColumnDataSource
from bokeh.server.server import Server

Expand All @@ -41,6 +41,8 @@ def setUp(self):
if not bokeh_renderer:
raise SkipTest("Bokeh required to test plot instantiation")
Store.current_backend = 'bokeh'
self.doc = curdoc()
set_curdoc(Document())
self.nbcontext = Renderer.notebook_context
with param.logging_level('ERROR'):
Renderer.notebook_context = False
Expand All @@ -53,6 +55,7 @@ def tearDown(self):
Renderer.notebook_context = self.nbcontext
state.curdoc = None
curdoc().clear()
set_curdoc(self.doc)
time.sleep(1)

def test_render_server_doc_element(self):
Expand Down Expand Up @@ -97,7 +100,7 @@ def test_set_up_linked_event_stream_on_server_doc(self):



class TestBokehServerRun(ComparisonTestCase):
class TestBokehServer(ComparisonTestCase):

def setUp(self):
self.previous_backend = Store.current_backend
Expand Down

0 comments on commit 27460c5

Please sign in to comment.