- commit
- e83a5c6cdeef87cf089eb121cb3570da5aeac8d4
- parent
- b245d6863fbc5974dd20b420baf75c812e6a646b
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2019-02-09 16:20
extend README
Diffstat
| M | README.md | 20 | ++++++++++++++++---- |
1 files changed, 16 insertions, 4 deletions
diff --git a/README.md b/README.md
@@ -2,7 +2,16 @@ assamtest is an experimental python test framework inspired by JavaScript 2 2 libraries such as [mocha](https://mochajs.org/) or 3 3 [jasmine](https://jasmine.github.io/). 4 4 -1 5 - everything is explicit, no magic -1 6 - simple generated tests and suites -1 7 - arbitrary nesting of test suites -1 8 - compatible with converage -1 9 - easily extendable with decorators and custom outcomes -1 10 -1 11 ## Usage -1 12 5 13 ```python -1 14 # tests.py 6 15 import assamtest 7 16 from assamtest import expect 8 17 @@ -26,7 +35,7 @@ A suite is just a function 26 35 ## Why another test framework? 27 36 28 37 The idea for this library came out of my growing frustration with pytest,29 -1 especially its `parametrize` feature.-1 38 especially its [`parametrize`][1] feature. 30 39 31 40 In jasmine, parametrization is trivial: 32 41 @@ -40,9 +49,9 @@ describe('#isNumber', function() { 40 49 }); 41 50 ``` 42 5143 -1 This is because the tests are registered explicitly. The popular python test44 -1 frameworks (pytest, unittest) on the other hand use an implicit mechanism where45 -1 each function that starts with 'test\_' is registered. This makes-1 52 This is because the tests are [registered explicitly][2]. The popular python -1 53 test frameworks (pytest, unittest) on the other hand use an implicit mechanism -1 54 where each function that starts with 'test\_' is registered. This makes 46 55 parametrization way harder than it needs to be. 47 56 48 57 This library is an attempt to bring the explicit approach to python. However, @@ -57,6 +66,9 @@ approach a bit less elegant in python: 57 66 - In python, variables are local by default. If you want to write to variables 58 67 from a descendant scope you have to use the `nonlocal` (or `global`) keyword. 59 68 -1 69 [1]: https://docs.pytest.org/en/latest/parametrize.html -1 70 [2]: https://mochajs.org/#dynamically-generating-tests -1 71 60 72 ## Reference 61 73 62 74 ### `@test(name=None, args=[], decorators=[])`