Skip to content

Commit 0cf221b

Browse files
committed
refactor(plugins/forks): Validity markers as classes
1 parent 270870b commit 0cf221b

File tree

5 files changed

+271
-160
lines changed

5 files changed

+271
-160
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Release tarball changes:
7878
- 🐞 fix(consume): allow absolute paths with `--evm-bin` ([#1052](https://github.com/ethereum/execution-spec-tests/pull/1052)).
7979
- ✨ Disable EIP-7742 framework changes for Prague ([#1023](https://github.com/ethereum/execution-spec-tests/pull/1023)).
8080
- ✨ Allow verification of the transaction receipt on executed test transactions ([#1068](https://github.com/ethereum/execution-spec-tests/pull/1068)).
81-
-Add the `fork_transition_test` marker to fill a test using multiple transition forks ([#1081](https://github.com/ethereum/execution-spec-tests/pull/1081)).
81+
-Modify `valid_at_transition_to` marker to add keyword arguments `subsequent_transitions` and `until` to fill a test using multiple transition forks ([#1081](https://github.com/ethereum/execution-spec-tests/pull/1081)).
8282

8383
### 🔧 EVM Tools
8484

docs/writing_tests/test_markers.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,23 @@ This marker is used to specify that a test is only meant to be filled at the tra
5252

5353
The test usually starts at the fork prior to the specified fork at genesis and at block 5 (for pre-merge forks) or at timestamp 15,000 (for post-merge forks) the fork transition occurs.
5454

55-
### `@pytest.mark.fork_transition_test()`
55+
This marker also accepts the following keyword arguments:
5656

57-
This marker is used to signal (in combination with `valid_from` and/or `valid_until`) that a test must be filled starting from the transition fork that transitions to the `valid_from` fork and every transition fork until the last fork specified.
57+
- `subsequent_transitions`: Force the test to also fill for subsequent fork transitions.
58+
- `until`: Implies `subsequent_transitions` and puts a limit on which transition fork will the test filling will be limited to.
5859

5960
```python
60-
@pytest.mark.fork_transition_test
61-
@pytest.mark.valid_from("Cancun")
61+
@pytest.mark.valid_at_transition_to("Cancun", subsequent_transitions=True)
6262
```
6363

6464
produces tests on `ShanghaiToCancunAtTime15k` and `CancunToPragueAtTime15k`, and any transition for after that.
6565

66+
```python
67+
@pytest.mark.valid_at_transition_to("Cancun", subsequent_transitions=True, until="Prague")
68+
```
69+
70+
produces tests on `ShanghaiToCancunAtTime15k` and `CancunToPragueAtTime15k`, but no forks after Prague.
71+
6672
## Fork Covariant Markers
6773

6874
These markers are used in conjunction with the fork validity markers to automatically parameterize tests with values that are valid for the fork being tested.

0 commit comments

Comments
 (0)