Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Return registered functions from
register_target
and `regist…
…er_check` decorators
- Loading branch information
1 parent
7b367b7
commit a539512
Showing
4 changed files
with
49 additions
and
2 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,22 @@ | ||
import pytest | ||
|
||
import schemathesis | ||
from schemathesis.cli import reset_checks | ||
|
||
|
||
@pytest.fixture | ||
def new_check(): | ||
@schemathesis.register_check | ||
def check_function(response, case): | ||
pass | ||
|
||
yield check_function | ||
|
||
reset_checks() | ||
|
||
|
||
def test_register_returns_a_value(new_check): | ||
# When a function is registered via the `register_check` decorator | ||
# Then this function should be available for further usage | ||
# See #721 | ||
assert new_check is not None |
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