-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Provide StepMatcherFactory to better keep track of things * Matcher classes: Provide register_type(), ... to better keep track of Matcher specific type-converters. OTHERWISE: * ADDED: behave.api.step_matchers -- Provides public API for step writers * behave._stepimport: Added SimpleStepContainer to simplify reuse HINT: Moved here from tests.api.testing_support module.
- Loading branch information
Showing
18 changed files
with
1,325 additions
and
565 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 |
---|---|---|
|
@@ -18,6 +18,7 @@ reports/ | |
tools/virtualenvs | ||
.cache/ | ||
.direnv/ | ||
.fleet/ | ||
.idea/ | ||
.pytest_cache/ | ||
.tox/ | ||
|
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,32 @@ | ||
# -*- coding: UTF-8 -*- | ||
""" | ||
Official API for step writers that want to use step-matchers. | ||
""" | ||
|
||
from __future__ import absolute_import, print_function | ||
import warnings | ||
from behave import matchers as _step_matchers | ||
|
||
|
||
def register_type(**kwargs): | ||
_step_matchers.register_type(**kwargs) | ||
|
||
|
||
def use_default_step_matcher(name=None): | ||
return _step_matchers.use_default_step_matcher(name=name) | ||
|
||
def use_step_matcher(name): | ||
return _step_matchers.use_step_matcher(name) | ||
|
||
def step_matcher(name): | ||
"""DEPRECATED, use :func:`use_step_matcher()` instead.""" | ||
# -- BACKWARD-COMPATIBLE NAME: Mark as deprecated. | ||
warnings.warn("deprecated: Use 'use_step_matcher()' instead", | ||
DeprecationWarning, stacklevel=2) | ||
return use_step_matcher(name) | ||
|
||
|
||
# -- REUSE: API function descriptions (aka: docstrings). | ||
register_type.__doc__ = _step_matchers.register_type.__doc__ | ||
use_step_matcher.__doc__ = _step_matchers.use_step_matcher.__doc__ | ||
use_default_step_matcher.__doc__ = _step_matchers.use_default_step_matcher.__doc__ |
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
Oops, something went wrong.