forked from delta-io/delta-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: run doctest in CI for Python API examples (delta-io#1840)
- Loading branch information
1 parent
fe4fe51
commit c38b518
Showing
5 changed files
with
268 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
import pathlib | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def doctest_setup( | ||
request: pytest.FixtureRequest, | ||
monkeypatch: pytest.MonkeyPatch, | ||
tmp_path: pathlib.Path, | ||
): | ||
if isinstance(request.node, pytest.DoctestItem): | ||
# disable color for doctests so we don't have to include | ||
# escape codes in docstrings | ||
monkeypatch.setitem(os.environ, "NO_COLOR", "1") | ||
# Explicitly set the column width | ||
monkeypatch.setitem(os.environ, "COLUMNS", "80") | ||
# Work in a temporary directory | ||
monkeypatch.chdir(str(tmp_path)) |
Oops, something went wrong.