-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce conftest.py to add pytest fixture for doctest_namespace See https://docs.pytest.org/en/latest/doctest.html#doctest-namespace-fixture * Remove the "import semver" line in each doctest; this is covered in conftest.py now as a pytest fixture * Extend setup.cfg with --doctest-report ndiff Makes the output a bit nicer in case something goes wrong
- Loading branch information
Showing
3 changed files
with
16 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import pytest | ||
import semver | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def add_semver(doctest_namespace): | ||
doctest_namespace["semver"] = semver |
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ addopts = | |
--cov=semver | ||
--cov-report=term-missing | ||
--doctest-modules | ||
--doctest-report ndiff |