-
-
Notifications
You must be signed in to change notification settings - Fork 5
Run tests in context managers #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
4a71b67
2211869
eacfc08
af12312
72b10b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |||||
| from _pytest.pathlib import import_path | ||||||
| from _pytest.outcomes import skip | ||||||
|
|
||||||
| from scpdt.impl import DTChecker, DTParser, DTFinder | ||||||
| from scpdt.impl import DTChecker, DTParser, DTFinder, DebugDTRunner | ||||||
| from scpdt.conftest import dt_config | ||||||
|
|
||||||
| copied_files = [] | ||||||
|
|
@@ -19,6 +19,7 @@ def pytest_configure(config): | |||||
| Allow plugins and conftest files to perform initial configuration. | ||||||
| """ | ||||||
|
|
||||||
| doctest._get_runner = _get_runner | ||||||
| doctest._get_checker = _get_checker | ||||||
| doctest.DoctestModule = DTModule | ||||||
| doctest.DoctestTextfile = DTTextfile | ||||||
|
|
@@ -39,7 +40,7 @@ def pytest_unconfigure(config): | |||||
|
|
||||||
| def _get_checker(): | ||||||
| """ | ||||||
| Override function to return an instance of DTChecker with default configurations | ||||||
| Override function to return an instance of DTChecker | ||||||
| """ | ||||||
| return DTChecker(config=dt_config) | ||||||
|
|
||||||
|
|
@@ -99,16 +100,16 @@ def collect(self): | |||||
| # We plugin scpdt's `DTFinder` that uses the `DTParser` which parses the doctest examples | ||||||
| # from the python module or file and filters out stopwords and pseudocode. | ||||||
| finder = DTFinder(config=dt_config) | ||||||
|
|
||||||
| # the rest remains unchanged | ||||||
| optionflags = doctest.get_optionflags(self) | ||||||
| runner = doctest._get_runner( | ||||||
|
|
||||||
| # We plugin scpdt's `DebugDTRunner` | ||||||
|
||||||
| # We plugin scpdt's `DebugDTRunner` | |
| # We plug in scpdt's `DebugDTRunner` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we dropping continue_on_failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continue_on_failure is a pytest ini option. Figured it would be best to use DTConfig's nameerror_after_exception attribute instead since both do the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#87 (comment) please make sure that this test passes with the plugin
Uh oh!
There was an error while loading. Please reload this page.