Commit Graph

70 Commits

Author SHA1 Message Date
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
Alessio Bogon ad593d2caf Let "when" and "then" steps define a target fixture.
See discussion at https://github.com/pytest-dev/pytest-bdd/issues/402#issuecomment-869615840
2021-07-03 09:45:21 +02:00
Alessio Bogon 0930c8a043 remove redundant variable 2021-04-28 15:37:55 +02:00
Alessio Bogon 86c471a24f Remove ancient pytest compatibility 2021-04-28 12:39:59 +02:00
Alessio Bogon 635dd3f679 Remove compatibility code for ancient versions of pytest 2021-04-28 12:33:22 +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 853c615748
Support for pytest 6 "--import-mode=importlib" (#384)
* Fix compatibility with pytest 6 "--import-mode=importlib"

* Rewrite `scenario` and `scenarios` tests so that we can easily parametrize with the different pytest --import-mode.

* Update changelog
2020-09-07 09:43:29 +02:00
Oleg Pidsadnyi 8008c0f4bc
Given step is no longer a fixture (#376)
* Removing strict gherkin.
* Update README.rst
* Update CHANGELOG
2020-07-01 11:57:00 +02:00
Alessio Bogon 6047a35ef1 Apply `black` formatter to the codebase 2019-08-27 17:54:58 +02:00
Alessio Bogon 2226128936
Remove code that rewrites code (#309)
* Stop testing for old pytest and python versions

* Switch from pytest-pep8 to pycodestyle.

Pytest-pep8 received the last update in 2014, and it is now not working with pytest >= 4.5

* Explicitly state used markers

* Remove supposedly useless test

* Fix pytest missing markers definitions

* Fix pytest missing markers definitions

* Fix wrong command line usage

* Remove compatibility with ancient pytest

* Be more lenient when checking for failed test string

* Remove dead code
2019-08-20 10:49:20 +02:00
Florian Bruhin 0b6cc6518c Fix Python 3.8 support 2019-08-19 13:28:33 +02:00
Blaise Kal 55069df7a7 Allow unicode type in given step names in Py 2
Allows the given step name to be unicode in Py2. 

Py 3 is not affected. It still does not allow non-ascii characters as they're not allowed in Py 2 `__name__`s.
2019-07-07 14:41:57 +02:00
Alessio Bogon dbf2339e62 Remove compat function get_request_fixture_names 2019-02-18 10:26:14 +01:00
Alessio Bogon 7f4ba0315d Remove compat function 2019-02-18 10:26:14 +01:00
Alessio Bogon b411cfa463 (supposedly) drop compatibility with pytest < 3.3.2
The test suite still passes with all the pytests >= 3, so I wonder if I
actually broke the compatibility
2019-02-18 10:26:14 +01:00
Alessio Bogon ee05a101e9 drop compatibility with pytest < 3.0.0 2019-02-18 10:26:14 +01:00
Alessio Bogon 39f72977f9 Defer fixture wrapping of lazy_step_function
This will ensure that we attach parser and converters to the actual
function that pytest will discover when collecting fixtures.
2018-10-16 09:45:16 +02:00
Oleg Pidsadnyi 7c6ba36ffc
Fixes #201 and pytest compatibility. (#232)
* Fixes #201 and pytest compatibility.

* Review comments
2018-01-23 20:43:43 +01:00
Bruno Oliveira 7f16bc93ea Last pytest 3.0 compatibility fixes 2016-08-19 16:47:56 +02:00
Florian Bruhin 27553d8222 Make fixture code pytest 3.0 compatible 2016-08-05 13:32:40 +02:00
Oleg Pidsadnyi 544c81f59e Fixing latest pytest compatibility 2016-07-21 22:05:16 +02:00
Florian Bruhin 28413e5793 Fix FixtureDef signature for newer pytest versions
In https://github.com/pytest-dev/pytest/pull/1586 the "yieldctx"
argument to FixtureDef was removed.

This uses utils.get_args to check if it's needed or not so pytest-bdd
works on pytest versions before and after that PR.
2016-06-17 10:56:57 +02:00
Florian Bruhin 7d8bb2ffa1 Use inspect.signature() if it's available.
Fixes #153.
2015-11-17 21:49:35 +01:00
Laurence Rowe 5bdb0a4b97 Prefix step definition fixture names to avoid name collisions 2015-06-07 23:04:12 +02:00
Anatoly Bubenkov 27d8e1c382 step fixture injection 2015-05-24 10:17:17 +02:00
Anatoly Bubenkov 83e8a9def7 Allow to pass scope for given steps. closes #109 2015-04-07 18:40:45 +02:00
Anatoly Bubenkov 29f2c1cbe4 Implemented shortcut to automatically bind scenarios to tests. closes #103, #89, #92, #90 2015-03-18 23:51:37 +01:00
Oleg Pidsadnyi c8fda61ace Fixes travis build 2015-02-28 21:52:22 +01:00
Anatoly Bubenkov d1fa804426 Pluggable parsers for step definitions. closes #91 2015-01-07 16:26:20 +01:00
Oleg Pidsadnyi 7fcd7e2eba Refactor of the feature step, reporting and fix for the multiline background steps. 2014-11-09 12:56:50 +01:00
Anatoly Bubenkov 002c517093 Fix unicode regex argumented steps issue, reimplements #75 2014-10-21 16:08:42 +00:00
Anatoly Bubenkov 5433bfeb61 Correct timing values for cucumber json reporting 2014-09-20 00:18:19 +00:00
Oleg Pidsadnyi 388ed6183c Merge pull request #65 from bubenkoff/fix-double-collection
Fixed double collection of the conftest files if scenario decorator is used
2014-09-15 09:53:45 +02:00
Anatoly Bubenkov 008dcee6b6 Fixed double collection of the conftest files if scenario decorator is used 2014-09-14 21:36:23 +00:00
Oleg Pidsadnyi 1748de1fe7 version bumped 2014-09-11 22:06:54 +02:00
Anatoly Bubenkov 5aaf42e4b5 better reporting 2014-07-25 22:17:58 +02:00
Anatoly Bubenkov e3e4cb6ad2 Scenario outline implementation based on pure pytest parametrization 2014-03-13 18:33:53 +01:00
Anatoly Bubenkov c3121c82c8 fixes for step hooks 2013-12-13 04:27:25 +01:00
Anatoly Bubenkov 011409b029 hide scenario module in pytest verbose mode 2013-12-11 03:43:58 +01:00
Oleg Pidsadnyi c7957e694a tests fixed 2013-09-20 23:29:42 +02:00
Oleg Pidsadnyi 6cd91e6e75 given validation 2013-09-20 22:48:40 +02:00
Oleg Pidsadnyi 82398e8c3f tests added 2013-09-20 00:46:29 +02:00
Anatoly Bubenkov 000f8f764a step arguments in progress 2013-09-19 00:21:56 +02:00
Oleg Pidsadnyi eeb9f9afc0 attempt to implement regex params 2013-09-18 00:59:46 +02:00
Oleg Pidsadnyi 04a278eb97 Fixed the docs and few spelling error. 2013-08-18 02:02:50 +02:00
Anatoly Bubenkov abc4ab0d47 less strict parametrization checks. preserve docstring for steps. 2013-08-17 17:57:50 +02:00
Anatoly Bubenkov 95fa10378f sanity fixes for test assertions 2013-08-12 00:52:23 +02:00
Anatoly Bubenkov 1801193062 python 3 support. additional checks for parameters 2013-08-12 00:42:09 +02:00
Anatoly Bubenkov 1f9bbc8cde cleanup unnecessary code, move to more clean implementation 2013-08-11 23:34:06 +02:00