ethereum / ethereum/execution-specs

Add correct typing to test examples

Open
#1,476 2 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
1.2k
Forks
505
Avg merge
2d 14h
Merged PRs (30d)
116

Description

After ethereum/execution-spec-tests#2281, all python functions in this repository will require to have their return type defined, which means that all pytest test functions, which do not return anything, need to specify `-> None`.

Example:
```python
@pytest.mark.with_all_tx_types
@pytest.mark.valid_from("Berlin")
def test_something_with_all_tx_types(
state_test: StateTestFiller,
pre: Alloc,
tx_type: int
):
pass
```
should now be:
```python
@pytest.mark.with_all_tx_types
@pytest.mark.valid_from("Berlin")
def test_something_with_all_tx_types(
state_test: StateTestFiller,
pre: Alloc,
tx_type: int
) -> None:
pass
```

An easy way to identify these to grep for `def test` in files that are not `*.py`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.