Skip to content

Commit bfcbbe4

Browse files
committed
Add a test to reproduce #1131
1 parent 923798e commit bfcbbe4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/functional/others/test_active_cells.py

+13
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,19 @@ def test_active_cells_from_py_percent(
291291
compare(text2, text)
292292

293293

294+
def test_comments_work_in_active_cells_from_py_percent_1131(
295+
text="""# %% tags=["active-py"]
296+
# this is a comment
297+
""",
298+
):
299+
nb = jupytext.reads(text, "py:percent")
300+
assert nb.cells[0].cell_type == "raw"
301+
assert nb.cells[0].source == "# this is a comment"
302+
303+
text2 = jupytext.writes(nb, "py:percent")
304+
compare(text2, text)
305+
306+
294307
def test_active_cells_from_py_light(
295308
text="""# + active="py"
296309
print('should only be displayed in py file')

0 commit comments

Comments
 (0)