David Röthlisberger
c8677a7783
tests: Use `pytester` fixture instead of `testdir`
...
`testdir` is deprecated. It's identical to `pytester`, except that
`testdir` returns `py.path` objects whereas `pytester` returns Python
stdlib `Path` objects. So I had to update usages of those paths.
`pytester` was added in pytest 6.2, which is our minimum supported
version.
2022-11-04 08:53:07 +00:00
Alessio Bogon
0cb89f451e
better name, parametrizable stacklevel
2022-08-13 11:11:07 +02:00
Alessio Bogon
d5112d8a87
Simplify test
2022-07-30 11:54:03 +02:00
Alessio Bogon
0be758e5ba
Add unit test for step delegation
2022-07-30 11:49:25 +02:00
Alessio Bogon
d149e3926c
Test @step(...)
2022-07-30 11:30:10 +02:00
Alessio Bogon
62d6726eec
add docstring
2022-07-30 11:24:25 +02:00
Alessio Bogon
a16d246842
Add stacklevel param to the steps, implement a test that makes use of it
2022-07-29 16:23:31 +02:00
Alessio Bogon
63a4268b9c
Fix bug when 2 steps have the same step name...
...
... but only one step impl was kept.
2022-07-27 17:02:35 +02:00
Alessio Bogon
478e21bcdf
Use `_` as step function name. It should not matter what the name is.
...
Inspired by the `ward` testing framework
2022-07-10 17:41:12 +02:00
Alessio Bogon
f4a7bdfaf1
lazy_step_function -> step_function_marker and make it return None
...
And fix tests, remove useless ones.
2022-07-10 17:28:02 +02:00
Alessio Bogon
1a831b79b8
Add test
2022-07-10 17:14:12 +02:00
Alessio Bogon
81c1bef7aa
Partially revert changes, just attach 1 parser to the lazy_step_func, and all the parsers to the actual function
2022-07-07 18:57:41 +02:00
Alessio Bogon
6e1566bb68
Removing clutter from the step_func
2022-07-07 16:30:25 +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
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
Alessio Bogon
fc9adba38b
Blackify code
2020-09-05 20:17:25 +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
Oleg Pidsadnyi
bfefabeb27
Some more test cleanup ( #375 )
...
* Some more test cleanup
* Docs updated
2020-06-24 09:24:04 +02:00
Oleg Pidsadnyi
76ed2ece2a
Cleanuptests2 ( #370 )
...
* Cleaning up tests
* Changelog entry
2020-06-18 08:36:12 +02:00
Oleg Pidsadnyi
6ba231fbe3
Converting tests ( #367 )
...
* Converting tests to use the correct pytest methodology for plugins
2020-06-14 12:16:09 +02:00
Alessio Bogon
6047a35ef1
Apply `black` formatter to the codebase
2019-08-27 17:54:58 +02:00
Blaise Kal
d8ebeeed1c
Add test for given names with unicode types
2019-07-07 14:41:57 +02:00
Alessio Bogon
ee05a101e9
drop compatibility with pytest < 3.0.0
2019-02-18 10:26:14 +01:00
Anthony Sottile
ce63d93152
Fix invalid escape sequences
2018-06-30 08:35:52 -07: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
Florian Bruhin
27553d8222
Make fixture code pytest 3.0 compatible
2016-08-05 13:32:40 +02: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
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
455c81aed0
Fix unicode issue with scenario name
2014-10-22 11:19:43 +00:00
Anatoly Bubenkov
2dd81a5ba7
translate unicode tests to the right language
2014-10-22 07:28:48 +00:00
Anatoly Bubenkov
002c517093
Fix unicode regex argumented steps issue, reimplements #75
2014-10-21 16:08:42 +00:00
Anatoly Bubenkov
c0ae33a241
move to single decorator
2014-03-14 14:15:04 +01:00
Andrey Makhnach
2e3357aa9d
extra fix for encoding
2013-11-10 11:24:19 +01:00
Anatoly Bubenkov
abc4ab0d47
less strict parametrization checks. preserve docstring for steps.
2013-08-17 17:57:50 +02:00
Oleg Podsadny
ac2abfa89b
test added
2013-04-16 10:42:06 +02:00
Oleg Podsadny
b4e9b48d9d
fixes fixtures usage
2013-04-15 17:44:26 +02:00
Oleg Podsadny
e17e91d2c8
given reuse implemented
2013-04-10 00:54:38 +02:00