-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
123 additions
and
35 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,10 @@ | ||
# StateMachine 2.1.1 | ||
|
||
*August 3, 2023* | ||
|
||
|
||
## Bugfixes in 2.1.1 | ||
|
||
- Fixes [#391](https://github.com/fgmacedo/python-statemachine/issues/391) adding support to | ||
[pytest-mock](https://pytest-mock.readthedocs.io/en/latest/index.html) `spy` method. | ||
- Improved factory type hints [#399](https://github.com/fgmacedo/python-statemachine/pull/399). |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "python-statemachine" | ||
version = "2.1.0" | ||
version = "2.1.1" | ||
description = "Python Finite State Machines made easy." | ||
authors = ["Fernando Macedo <[email protected]>"] | ||
maintainers = [ | ||
|
@@ -45,6 +45,7 @@ pre-commit = "^2.21.0" | |
mypy = "^0.991" | ||
black = "^22.12.0" | ||
pdbpp = "^0.10.3" | ||
pytest-mock = "^3.10.0" | ||
|
||
[tool.poetry.group.docs.dependencies] | ||
Sphinx = "4.5.0" | ||
|
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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
__author__ = """Fernando Macedo""" | ||
__email__ = "[email protected]" | ||
__version__ = "2.1.0" | ||
__version__ = "2.1.1" | ||
|
||
__all__ = ["StateMachine", "State"] |
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,25 @@ | ||
from statemachine import State | ||
from statemachine import StateMachine | ||
|
||
|
||
def test_minimal(mocker): | ||
class Observer: | ||
def on_enter_state(self, event, model, source, target, state): | ||
... | ||
|
||
obs = Observer() | ||
on_enter_state = mocker.spy(obs, "on_enter_state") | ||
|
||
class Machine(StateMachine): | ||
a = State("Init", initial=True) | ||
b = State("Fin") | ||
|
||
cycle = a.to(b) | b.to(a) | ||
|
||
state = Machine().add_observer(obs) | ||
assert state.a.is_active | ||
|
||
state.cycle() | ||
|
||
assert state.b.is_active | ||
on_enter_state.assert_called_once() |
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