Skip to content

Commit 59aa483

Browse files
authored
chore: nox doctests only in Python 3.12 (#1222)
* only doctest in 3.12 in nox * skip writing file in doctests
1 parent 73829c0 commit 59aa483

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

narwhals/dataframe.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,9 @@ def write_parquet(self, file: str | Path | BytesIO) -> Any:
582582
583583
We can then pass either pandas, Polars or PyArrow to `func`:
584584
585-
>>> func(df_pd)
586-
>>> func(df_pl)
587-
>>> func(df_pa)
585+
>>> func(df_pd) # doctest:+SKIP
586+
>>> func(df_pl) # doctest:+SKIP
587+
>>> func(df_pa) # doctest:+SKIP
588588
"""
589589
self._compliant_frame.write_parquet(file)
590590

noxfile.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def run_common(session: Session, coverage_threshold: float) -> None:
2727
f"--cov-fail-under={coverage_threshold}",
2828
"--runslow",
2929
)
30-
session.run("pytest", "narwhals", "--doctest-modules")
30+
31+
if session.python == "3.12":
32+
session.run("pytest", "narwhals", "--doctest-modules")
3133

3234

3335
@nox.session(python=PYTHON_VERSIONS) # type: ignore[misc]

0 commit comments

Comments
 (0)