Skip to content

Commit 87fc304

Browse files
committed
examples smoke test
1 parent 994c0fc commit 87fc304

File tree

5 files changed

+41
-19
lines changed

5 files changed

+41
-19
lines changed

.github/workflows/test.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
8+
jobs:
9+
typos:
10+
name: Test notebooks
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 🛑 Cancel Previous Runs
14+
uses: styfle/cancel-workflow-action@0.12.1
15+
- name: 🐍 Setup uv
16+
uses: yezz123/setup-uv@v4
17+
- name: Run tests
18+
run: |
19+
uvx --with marimo pytest -v

.github/workflows/test_typos.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ repos:
2222
rev: dictgen-v0.3.1
2323
hooks:
2424
- id: typos
25+
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: v0.9.1
28+
hooks:
29+
# Run the formatter
30+
- id: ruff-format
31+

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ and apps.
1313

1414
## Running examples
1515

16-
Each example has a README that tells you how to run it locally.
17-
18-
Most examples can also be opened in marimo's [online
16+
Each example has a README that tells you how to run it locally. Most examples
17+
can also be opened in marimo's [online
1918
playground](https://docs.marimo.io/guides/publishing/playground/) by clicking
2019
the "open in marimo" badge in its README.
2120

@@ -25,7 +24,8 @@ We welcome community contributions of examples; you don't need to be
2524
an expert to help out!
2625

2726
Open a pull request to contribute a new example. Each example should be placed
28-
in its own folder and include a short `README.md`.
27+
in its own folder and include a short `README.md`. We also include smoke tests
28+
for each notebook in `tests/`. Run tests with `uvx --with marimo pytest .`
2929

3030
Looking for a specific example or template but can't find it? Feel free
3131
to file an issue and request it!
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Smoke tests that check notebooks don't have syntax errors."""
2+
3+
import pathlib
4+
import sys
5+
6+
ROOT = pathlib.Path(__file__).parent.parent
7+
sys.path.append(str(ROOT))
8+
9+
def test_nlp_span_comparison() -> None:
10+
from nlp_span_comparison import nlp_span_comparison
11+
assert not nlp_span_comparison.app._unparsable

0 commit comments

Comments
 (0)