Commit Graph

30 Commits

Author SHA1 Message Date
Sourcery AI f1ba44ca3e 'Refactored by Sourcery' 2023-11-12 22:20:15 +00:00
Alessio Bogon 034b6dc96f Remove useless var 2023-11-12 23:08:13 +01:00
Alessio Bogon 8f5d70808f Simplify method 2023-11-12 23:00:16 +01:00
Alessio Bogon c23282819b No need to keep a counter, just try to pop from the stack if any 2023-11-11 20:35:24 +01:00
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
Alessio Bogon c52a5fac59
Merge branch 'master' into parser_performance 2023-07-23 12:52:17 +02:00
pre-commit-ci[bot] 40f58490d8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-07-23 10:38:43 +00:00
pre-commit-ci[bot] d5f3664ee5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-07-23 10:36:48 +00:00
Daniel Beland 86b6c942d9 test step name cache behavior 2023-07-14 04:53:38 -04:00
Daniel Beland c4a041d4ba use cached_property 2023-07-13 11:26:38 -04:00
Daniel Beland d37913f5ec
improve performance 2023-07-06 13:34:35 -04:00
Alessio Bogon 84aa72a1d5
Simplify check 2023-02-27 19:51:59 +01:00
Patrick Barna eff9bfa566 Always use clean line for description 2023-02-16 12:16:33 -07:00
pre-commit-ci[bot] ce87c51380 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-09 21:08:28 +00:00
Patrick Barna 8212c5a8a9 Remove unncessary string type 2023-02-09 13:48:06 -07:00
Patrick Barna 487e952b6d Add scenario descriptions 2023-02-09 10:59:06 -07:00
Sherzod Karimov ec243313c8 call after scenario hook after all steps 2022-11-07 16:29:10 -05: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 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
David Röthlisberger 8123f7ab83 Drop dependency on glob2
The standard library's `glob` supports "**" since Python 3.5.
pytest-bdd requires Python >= 3.7.
2022-11-03 21:25:14 +00:00
David Röthlisberger 72d49f35b6 Don't fall back to importing from `py.io`
We require pytest>=6.2; `_pytest._io.TerminalWriter` exists since
6.0.0rc1. See the previous commit for details.
2022-11-03 13:01:35 +00:00
David Röthlisberger 36e81cb924 Drop dependency on py.io
Pytest 7.2.0 dropped its dependency on the `py` package. We don't
specify `py` explicitly as a dependency, so tests starting failing since
the release of pytest 7.2.0.

To drop this dependency, pytest vendored `py.io.TerminalWriter` into
`_pytest._io` in pytest commit 276405a03 (6.0.0rc1). It looks like we
still support pytest 5.0 —at least it's listed in tox.ini— so I fall
back to importing from `py.io` if it isn't present in `_pytest`.

This was our only direct use of the `py` library.
2022-11-03 12:58:24 +00:00
Alessio Bogon c6a4bffb49 Make the package PEP 561 compatible...
... by adding the `py.typed` file.
2022-09-24 14:15:10 +02:00
Gaëtan Lehmann 64e2086cdf hide pytest-bdd internal method in user traceback 2022-08-26 14:24:14 +02:00
Alessio Bogon bf5817948a Remove useless docstrings 2022-08-20 12:25:54 +02:00
Alessio Bogon 5ffe96c81d Simplify code by using dataclasses 2022-08-20 12:11:45 +02:00
Alessio Bogon 070541d707 Do not use eagerly load into a set if not necessary 2022-08-20 11:52:29 +02:00
Alessio Bogon 9301e97dce Use src/ based directory structure 2022-08-14 10:34:33 +02:00