Skip to content

Commit e13c592

Browse files
chore(deps,pytest): update pytest to v8 (#1433)
* chore(deps,pytest): update pytest to v8 * fix(consume): remove mark from fixture; it has no effect And causes a deprecation warning in pytest v8 https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function * fix(plugins/static_filler): Fix static test filling in pytest 8 * chore(tests): fix duplicate IDs in access list tests * docs: update changelog --------- Co-authored-by: Mario Vega <marioevz@gmail.com>
1 parent e4e958c commit e13c592

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The output behavior of `fill` has changed ([#1608](https://github.com/ethereum/e
3232
- ✨ Added [Post-Mortems of Missed Test Scenarios](https://eest.ethereum.org/main/writing_tests/post_mortems/) to the documentation that serves as a reference list of all cases that were missed during the test implementation phase of a new EIP, and includes the steps taken in order to prevent similar test cases to be missed in the future ([#1327](https://github.com/ethereum/execution-spec-tests/pull/1327)).
3333
- ✨ Added a new `eest` sub-command, `eest info`, to easily print a cloned EEST repository's version and the versions of relevant tools, e.g., `python`, `uv` ([#1621](https://github.com/ethereum/execution-spec-tests/pull/1621)).
3434
- ✨ Add `CONTRIBUTING.md` for execution-spec-tests and improve coding standards documentation ([#1604](https://github.com/ethereum/execution-spec-tests/pull/1604)).
35+
- 🔀 Updated from pytest 7 to [pytest 8](https://docs.pytest.org/en/stable/changelog.html#features-and-improvements), benefits include improved type hinting and hook typing, stricter mark handling, and clearer error messages for plugin and metadata development [#1433](https://github.com/ethereum/execution-spec-tests/pull/1433).
3536

3637
### 🧪 Test Cases
3738

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies = [
2828
"requests>=2.31.0,<3",
2929
"requests_unixsocket2>=0.4.0",
3030
"colorlog>=6.7.0,<7",
31-
"pytest>7.3.2,<8",
31+
"pytest>=8,<9",
3232
"pytest-custom-report>=1.0.1,<2",
3333
"pytest-html>=4.1.0,<5",
3434
"pytest-metadata>=3,<4",

src/pytest_plugins/consume/hive_simulators/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ def total_timing_data(request) -> Generator[TimingData, None, None]:
235235

236236

237237
@pytest.fixture(scope="function")
238-
@pytest.mark.usefixtures("total_timing_data")
239238
def client_genesis(fixture: BlockchainFixtureCommon) -> dict:
240239
"""Convert the fixture genesis block header and pre-state to a client genesis state."""
241240
genesis = to_json(fixture.genesis)

src/pytest_plugins/filler/static_filler.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212

1313
import pytest
1414
import yaml
15-
from _pytest.fixtures import FixtureRequest
15+
from _pytest.fixtures import TopRequest
1616
from _pytest.mark import ParameterSet
17+
from _pytest.python import Module
1718

1819
from ethereum_test_fixtures import BaseFixture, LabeledFixtureFormat
1920
from ethereum_test_forks import Fork
@@ -129,7 +130,13 @@ def pytest_collect_file(file_path: Path, parent) -> pytest.Collector | None:
129130
# No formats registered, so no need to collect any files.
130131
return None
131132
if file_path.suffix in (".json", ".yml", ".yaml"):
132-
return FillerFile.from_parent(parent, path=file_path)
133+
init_file = file_path.parent / "__init__.py"
134+
module = Module.from_parent(
135+
parent=parent,
136+
path=init_file,
137+
nodeid=str(init_file),
138+
)
139+
return FillerFile.from_parent(module, path=file_path)
133140
return None
134141

135142

@@ -315,9 +322,8 @@ def setup(self):
315322
self,
316323
None,
317324
None,
318-
funcargs=False,
319325
)
320-
request = FixtureRequest(self, _ispytest=True)
326+
request = TopRequest(self, _ispytest=True)
321327
for fixture_name in self.fixturenames:
322328
self.params[fixture_name] = request.getfixturevalue(fixture_name)
323329

tests/berlin/eip2930_access_list/test_tx_intrinsic_gas.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
pytest.param(Bytes(b"0x00FF"), id="data_1_zero_byte_1_non_zero_byte"),
3636
pytest.param(Bytes(b"0xFE00"), id="data_1_zero_byte_1_non_zero_byte_reversed"),
3737
pytest.param(Bytes(b"0x0102030405060708090A0B0C0D0E0F10"), id="data_set_1"),
38-
pytest.param(
39-
Bytes(b"0x0102030405060708090A0B0C0D0E0F101112131415161718191a1b1c1d1e1f20"),
40-
id="data_set_1",
41-
),
4238
pytest.param(
4339
Bytes(b"0x00010203040506000708090A0B0C0D0E0F10111200131415161718191a1b1c1d1e1f"),
4440
id="data_set_2",
4541
),
42+
pytest.param(
43+
Bytes(b"0x0102030405060708090A0B0C0D0E0F101112131415161718191a1b1c1d1e1f20"),
44+
id="data_set_3",
45+
),
4646
pytest.param(
4747
Bytes(b"0x01020304050607080910111213141516171819202122232425262728293031"),
4848
id="data_set_31_bytes",

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)