Skip to content

Commit 5dbb2ac

Browse files
committed
Move notebook fixture to deletetest file to minimize the dependency on changes in PR jupyter#3475. This should be update once that PR is merged
1 parent 6b1691d commit 5dbb2ac

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

notebook/tests/selenium/test_deletecell.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
import pytest
33
from .utils import Notebook
44

5+
@pytest.fixture
6+
def notebook(authenticated_browser):
7+
return Notebook.new_notebook(authenticated_browser)
8+
59
def get_cells_contents(nb):
610
JS = 'return Jupyter.notebook.get_cells().map(function(c) {return c.get_text();})'
711
return nb.browser.execute_script(JS)

notebook/tests/selenium/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ def add_cell(self, index=-1, cell_type="code", content=""):
154154
new_index = index + 1 if index >= 0 else index
155155
if content:
156156
self.edit_cell(index=index, content=content)
157-
self.convert_cell_type(index=new_index, cell_type=cell_type)
157+
if cell_type != 'code':
158+
self.convert_cell_type(index=new_index, cell_type=cell_type)
158159

159160
def add_markdown_cell(self, index=-1, content="", render=True):
160161
self.add_cell(index, cell_type="markdown")

0 commit comments

Comments
 (0)