Commit Graph

34 Commits

Author SHA1 Message Date
Alessio Bogon 4ee87feaa8 Only "Givens" are allowed in "Background" 2022-03-13 23:05:46 +01:00
Alessio Bogon c9a9aebaf3 Actually invoke validation in tests 2022-03-13 22:15:48 +01:00
Alessio Bogon 8f9c26328d Add some validation logic.
Required only since we build objects (feature, scenario, etc.) incrementally, and we want to make sure we filled in everything correctly.
2022-03-13 22:09:38 +01:00
Alessio Bogon f73efac5b1 Datatables! 2022-03-13 20:37:45 +01:00
Alessio Bogon 9c37f090e4 Step docstrings! (1 test still failing though) 2022-03-12 15:01:27 +01:00
Alessio Bogon a10e93a1d9 Use dataclass instead of attrs, one less dependency.
Unfortunately, we can't get rid of Step.__init__
2022-03-11 20:54:27 +01:00
Alessio Bogon 99b61fdc8d More attrs 2022-03-11 19:42:48 +01:00
Alessio Bogon a6523e020a Use attrs and implement test comprehensively 2022-03-11 19:20:00 +01:00
Alessio Bogon cc130b6e19 Fix tags, and no need for space at the end of the keyword 2022-03-10 16:03:25 +01:00
Alessio Bogon 67d793d3da Examples! (still a failing test in case there is an escaped pipe [skip pre-commit.ci] 2022-03-09 16:45:30 +01:00
Alessio Bogon 559c0f9050 tags in feature and scenario 2022-03-08 11:21:02 +01:00
Alessio Bogon 275f98da0d "And" steps! 2022-03-06 13:16:56 +01:00
Alessio Bogon 615b247bed Fix types 2022-03-05 17:44:14 +01:00
Alessio Bogon 39825aa801 Fix types, remove unused code 2022-03-03 13:01:45 +01:00
Alessio Bogon 644df2ee52 Use newer typing syntax 2022-02-24 16:00:36 +01:00
Alessio Bogon 021aa3a2e3 Use "from __future__ import annotations" to be less verbose 2022-02-24 15:32:20 +01:00
Alessio Bogon 4fd1ab950c Merge remote-tracking branch 'origin/master' into add-type-annotations
# Conflicts:
#	pytest_bdd/parser.py
#	pytest_bdd/scenario.py
2022-02-24 14:04:24 +01:00
Alessio Bogon 1bd6998263 Remove unused code 2022-02-24 13:19:14 +01:00
Oleg Pidsadnyi 496fabbd14 Scenario example validation restrictions removed. 2022-02-13 11:54:58 +01:00
pre-commit-ci[bot] 437bb6315d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-01-15 20:36:38 +01:00
Oleg Pidsadnyi 7cd7b40df3 Step arguments are no longer fixtures 2022-01-15 20:36:38 +01:00
Oleg Pidsadnyi 6730b428ed Removing the vertical examples support 2022-01-15 19:22:10 +01:00
Oleg Pidsadnyi e0a1437908 Feature examples removal. Compatibility with official gherkin 2022-01-15 19:07:11 +01:00
Alessio Bogon 78cf86af32 Fix many types 2021-10-20 17:15:03 +02:00
Alessio Bogon bd2f262a4d Add annotation 2021-10-01 20:53:59 +02:00
Alessio Bogon 4ddb257230 Get `pytest tests/` to work again 2021-10-01 20:51:59 +02:00
Alessio Bogon 7ab5aeeb2a Blindly add annotations using pyannotate. A lot to fix.
Commands run:
```
pytest tests/
pyannotate --py3 -w pytest_bdd tests
git add pytest_bdd tests
pre-commit run
```
2021-10-01 20:17:43 +02:00
Alessio Bogon 379cb4b47c
Rewrite scenario/feature examples logic (#445)
* rewrite examples subsitution using templating

* Remove “example_converters”

* Remove "expanded" option. It's now the default

* Add utility functions to be able to inspect tests run by the pytester.

* use better timer

* Fix typos

* Fix and simplify tests

* Update to latest python 3.10 version

* Add isort configuration and pre-commit hook

* Fix imports

* Fix types

* Update changelog

* Update README (mainly fix typos, remove outdated options)

* Fix examples in README

* Remove python2 junk

Co-authored-by: Oleg Pidsadnyi <oleg.pidsadnyi@gmail.com>
2021-09-23 21:07:15 +02:00
Oleg Pidsadnyi c6b7134e59 Revert "Allows use <params> in parsers defined steps"
This reverts commit 7850f218b7.
2021-08-18 09:23:31 +02:00
Konstantin Goloveshko 7850f218b7 Allows use <params> in parsers defined steps
So parsers could parse values defined in Examples
2021-08-17 20:59:14 +02:00
Alessio Bogon cdb1bdada9
Add `pyupgrade` tool to pre-commit hooks (#416)
* `pyupgrade --py36-plus tests/**/*.py pytest_bdd/**/*.py setup.py`

* add pyupgrade to pre-commit config
2021-04-16 09:35:49 +02:00
Konstantin Goloveshko e1dc0cad9a Update python and pytest
- Drop support of python 2.7, 3.5; Add explicit support for python >=3.6
- Remove six dependency
- Simplify getting step parser strategy; If step could be stringified it could be used
- Respect pytest --strict option in tests
2021-03-02 19:08:00 +02:00
Alessio Bogon 7cb344ef64
Fix bug when using comments in the "Examples:" section (#398)
* Fix bug when using comments in the "Examples:" section
2020-12-07 13:38:07 +01:00
Alessio Bogon 02e667f239
Move Feature, Scenario, Step classes into the parser module (#388)
* Move the parsing logic to its own module

* Remove Feature.get_feature classmethod, in favour of the get_feature function on the feature module
2020-09-15 11:18:57 +02:00