(tmp_path: Path)
| 70 | class TestConvert: |
| 71 | @staticmethod |
| 72 | def test_convert_ipynb(tmp_path: Path) -> None: |
| 73 | notebook_path = tmp_path / "test_notebook.ipynb" |
| 74 | notebook_content = """ |
| 75 | { |
| 76 | "cells": [ |
| 77 | { |
| 78 | "cell_type": "code", |
| 79 | "execution_count": null, |
| 80 | "metadata": {}, |
| 81 | "outputs": [], |
| 82 | "source": [ |
| 83 | "print('Hello, World!')" |
| 84 | ] |
| 85 | } |
| 86 | ], |
| 87 | "metadata": {}, |
| 88 | "nbformat": 4, |
| 89 | "nbformat_minor": 4 |
| 90 | } |
| 91 | """ |
| 92 | notebook_path.write_text(notebook_content) |
| 93 | |
| 94 | p = subprocess.run( |
| 95 | ["marimo", "convert", str(notebook_path)], |
| 96 | capture_output=True, |
| 97 | text=True, |
| 98 | ) |
| 99 | assert p.returncode == 0, p.stderr |
| 100 | output = p.stdout |
| 101 | output = re.sub(r"__generated_with = .*", "", output) |
| 102 | snapshot("ipynb_to_marimo.txt", output) |
| 103 | |
| 104 | @staticmethod |
| 105 | def test_convert_markdown(tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected