Skip to content

Commit

Permalink
Add context-cleanups and fixture concept.
Browse files Browse the repository at this point in the history
Context-cleanup:
Use context.add_cleanup(cleanup_func) to perform cleanups at end of scenario,
feature or test-run (depending on which context-layer the cleanup was added).
Cleanups are performed when current context-layer is removed.

Fixtures:
Simplify setup/cleanup tasks for scenario, feature or test-run.
A fixture basically provides a scope-guard
(similar to: @contextlib.contextmanager, @pytest.fixture).
  • Loading branch information
jenisys committed Oct 1, 2017
1 parent 2649680 commit c46c91f
Show file tree
Hide file tree
Showing 41 changed files with 3,505 additions and 59 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ SITE:

ENHANCEMENTS:

* fixtures: Add concept to simplify setup/cleanup tasks for scenario/feature/test-run
* context-cleanups: Use context.add_cleanup() to perform cleanups after scenario/feature/test-run.
* Tagged Examples: Examples in a ScenarioOutline can now have tags.
* pull #447: behave settings from tox.ini (provided by: bittner)
* issue #411: Support multiple active-tags with same category (submitted by: Kani999)
Expand Down
13 changes: 8 additions & 5 deletions PROJECT_INFO.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
Project Info
===============================================================================

=============== ===============================================================
=============== ===================================================================
Category Hyperlink
=============== ===============================================================
Documentation: http://pythonhosted.org/behave/
(or: http://behave.readthedocs.org/ for latest and stable)
=============== ===================================================================
Documentation: http://behave.readthedocs.io/ for `latest`_ and `stable`_ (`PDF`_)
Download: http://pypi.python.org/pypi/behave (or: `github archive`_)
Development: https://github.com/behave/behave
Issue Tracker: https://github.com/behave/behave/issues
Changelog: `CHANGES.rst <CHANGES.rst>`_
Newsgroup: https://groups.google.com/forum/#!forum/behave-users
=============== ===============================================================
=============== ===================================================================

.. hint::

The PyPI version is the latest stable version.
Otherwise, use the latest stable tag or the "bleeding edge" from Github.

.. _latest: http://behave.readthedocs.io/en/latest/
.. _stable: http://behave.readthedocs.io/en/stable/
.. _PDF: https://media.readthedocs.org/pdf/behave/latest/behave.pdf

.. _`github archive`: https://github.com/behave/behave/tags
2 changes: 2 additions & 0 deletions behave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
from __future__ import absolute_import
from behave.step_registry import * # pylint: disable=wildcard-import
from behave.matchers import use_step_matcher, step_matcher, register_type
from behave.fixture import fixture, use_fixture

# pylint: disable=undefined-all-variable
__all__ = [
"given", "when", "then", "step", "use_step_matcher", "register_type",
"Given", "When", "Then", "Step",
"fixture", "use_fixture",
# -- DEPRECATING:
"step_matcher"
]
Expand Down
Loading

0 comments on commit c46c91f

Please sign in to comment.