-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests for uncovered code paths
- Loading branch information
1 parent
8ff77bd
commit b55463b
Showing
2 changed files
with
35 additions
and
0 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,20 @@ | ||
import sys | ||
import warnings | ||
|
||
from hypothesis.errors import NonInteractiveExampleWarning | ||
|
||
from schemathesis._compat import handle_warnings | ||
|
||
|
||
def test_handle_warnings(recwarn): | ||
with handle_warnings(): | ||
warnings.warn("Message", NonInteractiveExampleWarning) | ||
assert not recwarn | ||
|
||
|
||
def test_handle_warnings_old_hypothesis(monkeypatch, recwarn): | ||
# Assume that there is an import error - old hypothesis version | ||
monkeypatch.setitem(sys.modules, "hypothesis.errors", None) | ||
with handle_warnings(): | ||
warnings.warn("Message", NonInteractiveExampleWarning) | ||
assert recwarn |
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