Skip to content

Commit

Permalink
Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeauchesne committed Aug 20, 2024
1 parent 40b67b5 commit 7e14da6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
29 changes: 29 additions & 0 deletions docs/edit/from-scratch.md
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
```
4 changes: 0 additions & 4 deletions docs/edit/weblog.md

This file was deleted.

0 comments on commit 7e14da6

Please sign in to comment.