-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
40b67b5
commit 7e14da6
Showing
2 changed files
with
29 additions
and
4 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,29 @@ | ||
Current system-tests implements mostly functional end-to-end scenario. But it an achieve any test paradigm you like. Build uppon pytest, it introduces a simple - an extensible - object: `Scenario`. | ||
|
||
A scenario is the abstraction for a context to test, and anything can be defined inside this context. Here is the most simple context scenario you can imagine : | ||
|
||
|
||
### `utils/_context/_scenarios/custom_scenario.py` | ||
|
||
```python | ||
from .core import Scenario | ||
|
||
class CustomScenario(Scenario): | ||
def session_start(self, session): | ||
""" if needed, use this function to start anything needed to your scenario """ | ||
|
||
def pytest_sessionfinish(self): | ||
""" if needed, clean what need to be cleaned at the end of the test session" | ||
``` | ||
And include you scenario in `utils/_context/_scenarios/__init__.py` | ||
Then, just flag you tests classes/methods with you scenario : | ||
```python | ||
@scenarios.custom_scenario | ||
class Test_NewStuff: | ||
def test_main(self): | ||
assert 1+1 == 2 | ||
``` |
This file was deleted.
Oops, something went wrong.