Commit Graph

295 Commits

Author SHA1 Message Date
Nate Clark 825fcf804b Issue #362: Only unconfigure if configured
`pytest_unconfigure` can be called even if `pytest_configure` was not.
In order to avoid errors during unconfigure only perform the unconfigure
if the configure was performed. Add a counter which is incremented
before configure to track the number of times pytest started
initialization so that the config is not popped early from the stack.
2023-10-31 10:04:28 -04:00
Daniel Beland 86b6c942d9 test step name cache behavior 2023-07-14 04:53:38 -04:00
Patrick Barna eff9bfa566 Always use clean line for description 2023-02-16 12:16:33 -07:00
Patrick Barna 89b9fde551 Add test 2023-02-09 13:41:47 -07:00
Alessio Bogon 628790921e Fix python 3.12.0a3 syntax error 2023-01-03 12:02:20 +01:00
Alessio Bogon 5f5880328c Fix tests in python 3.12 2023-01-03 12:02:20 +01:00
Alessio Bogon 5d8eda3a30 Remove logic for old unsupported pytest 2022-11-12 15:53:38 +01:00
Alessio Bogon d3e840711b Merge branch '6.x' 2022-11-08 18:19:30 +01:00
Alessio Bogon 4d44c88863 Add regression test 2022-11-08 18:00:51 +01:00
Alessio Bogon 7eaa3fc2c0 Re-add "`parsers.re` now does fullmatch.""
This reverts commit 1d84d291d9.
2022-11-05 15:14:28 +01:00
Alessio Bogon 1d84d291d9 Revert "`parsers.re` now does fullmatch."
This reverts commit 18320bbe
This reverts commit cc1180d1
2022-11-05 15:12:49 +01:00
David Röthlisberger 3243232fb0 bdd_features_base_dir is relative to pytest rootdir
The pytest rootdir is the directory containing pytest.ini (or similar):
https://docs.pytest.org/en/latest/reference/customize.html#rootdir

This allows you to run pytest when the current working directory isn't
the same as the directory containing the tests. I need to do that
because in my system, the directory containing the tests is on a
read-only filesystem.
2022-11-04 10:42:40 +00:00
David Röthlisberger 0bcb4b86b2 tests: Fix typing import 2022-11-04 09:51:48 +00:00
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 49504d4935 Fix typo 2022-07-26 00:26:33 +02:00
Alessio Bogon 18c05bf92b Remove pytest<6 support logic 2022-07-26 00:20:31 +02:00
Alessio Bogon 020c443941 Stub fix for finding the right fixture for step definition 2022-07-24 00:02:52 +02:00
Alessio Bogon 2c8d1552e0 Add decoys to the test, hoping to catch many edge cases 2022-07-23 11:57:02 +02:00
Alessio Bogon a136cf04dc Remove unnecessary defaulting of the param 2022-07-23 10:55:38 +02:00
Alessio Bogon d73fa1edaf
Merge branch 'master' into anonymous-step-funcs 2022-07-15 18:38:38 +02:00
Alessio Bogon 18320bbefc `parsers.re` now does fullmatch.
This makes it work the same way other parsers work (they don't ignore non-matching characters at the end of the string)
2022-07-12 18:56:52 +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 345218dd67 Fix typo 2022-07-10 15:29:46 +02:00
Alessio Bogon a2a94adff1 Fix bug where normal steps would take precedence over other parsers. 2022-07-10 15:26:01 +02:00
Alessio Bogon 36bb1b9f32 Make sure step functions can be reused with converters 2022-07-10 14:20:30 +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 15e1a8aa20 Handle multiple parsers connected to a step function 2022-07-06 18:09:29 +02:00
Alessio Bogon 384c02330d Fix test 2022-07-04 14:49:42 +02:00
Alessio Bogon e5f5b7c9cd Fix test 2022-07-04 14:29:01 +02:00
Alessio Bogon 5fad41f353 Only parse angular brackets in steps only for "Scenario Outline"s 2022-07-03 22:54:08 +02:00
Alessio Bogon 66750f169b
Merge branch 'master' into fix-typos 2022-03-05 16:49:25 +01:00
Alessio Bogon 01c52c9cf6
Merge branch 'master' into fix-typos 2022-03-03 13:57:10 +01:00
Alessio Bogon e378ccbc2c Fix runtime 2022-03-03 13:54:27 +01:00
Alessio Bogon 0bddeae70f Fix types 2022-03-03 13:49:05 +01:00
Alessio Bogon 4a4ad268fd Remove type annotations from tests 2022-03-03 13:47:02 +01:00
Alessio Bogon f2299c39f8 Simplify annotations 2022-03-03 13:43:01 +01:00
Alessio Bogon 9165dcc7a4 Remove dev junk 2022-03-03 13:41:56 +01:00
Alessio Bogon 3e49f3b6df Fix types 2022-02-24 16:53:27 +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