File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -454,17 +454,31 @@ def test_parse_error_in_notebook_file() -> None:
454454 assert len (result .notebook .cells ) == 3
455455
456456 @staticmethod
457- def test_line_continuation_at_eof_file () -> None :
457+ def test_line_continuation_at_eof_file (tmp_path : object ) -> None :
458458 """Test a notebook with a backslash continuation at EOF.
459459
460460 The scanner should recover the cell as unparsable and find
461461 the run guard.
462462 """
463- filepath = os .path .join (
464- os .path .dirname (os .path .realpath (__file__ )),
465- "codegen_data/_test_line_continuation_at_eof.py" ,
463+ filepath = Path (str (tmp_path )) / "line_continuation_at_eof.py"
464+ filepath .write_text (
465+ textwrap .dedent ("""\
466+ import marimo
467+
468+ __generated_with = "0.1.0"
469+ app = marimo.App()
470+
471+
472+ @app.cell
473+ def _():
474+ x = 1 + \\
475+
476+
477+ if __name__ == "__main__":
478+ app.run()
479+ """ )
466480 )
467- result = get_notebook_status (filepath )
481+ result = get_notebook_status (str ( filepath ) )
468482 assert result .status == "has_errors"
469483 assert result .notebook is not None
470484 assert len (result .notebook .cells ) == 1
You can’t perform that action at this time.
0 commit comments