Skip to content

Commit f461a34

Browse files
committed
pytest-xdist updates
1 parent 422811a commit f461a34

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

tests/core/caching-utils/test_request_caching.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_all_providers_do_not_cache_by_default_and_can_set_caching_properties(pr
204204
"threshold",
205205
(RequestCacheValidationThreshold.FINALIZED, RequestCacheValidationThreshold.SAFE),
206206
)
207-
@pytest.mark.parametrize("endpoint", BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT)
207+
@pytest.mark.parametrize("endpoint", sorted(BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT))
208208
@pytest.mark.parametrize(
209209
"blocknum,should_cache",
210210
(
@@ -254,7 +254,7 @@ def test_blocknum_validation_against_validation_threshold_when_caching_mainnet(
254254
"threshold",
255255
(RequestCacheValidationThreshold.FINALIZED, RequestCacheValidationThreshold.SAFE),
256256
)
257-
@pytest.mark.parametrize("endpoint", BLOCKNUM_IN_PARAMS)
257+
@pytest.mark.parametrize("endpoint", sorted(BLOCKNUM_IN_PARAMS))
258258
@pytest.mark.parametrize(
259259
"block_id,blocknum,should_cache",
260260
(
@@ -297,7 +297,7 @@ def test_block_id_param_caching_mainnet(
297297
"threshold",
298298
(RequestCacheValidationThreshold.FINALIZED, RequestCacheValidationThreshold.SAFE),
299299
)
300-
@pytest.mark.parametrize("endpoint", BLOCKHASH_IN_PARAMS)
300+
@pytest.mark.parametrize("endpoint", sorted(BLOCKHASH_IN_PARAMS))
301301
@pytest.mark.parametrize(
302302
"blocknum,should_cache",
303303
(
@@ -360,7 +360,7 @@ def test_request_caching_validation_threshold_defaults(
360360

361361

362362
@pytest.mark.parametrize(
363-
"endpoint", BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS
363+
"endpoint", sorted(BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS)
364364
)
365365
@pytest.mark.parametrize(
366366
"time_from_threshold,should_cache",
@@ -436,7 +436,7 @@ def test_sync_validation_against_validation_threshold_time_based(
436436
),
437437
)
438438
@pytest.mark.parametrize(
439-
"endpoint", BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS
439+
"endpoint", sorted(BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS)
440440
)
441441
def test_validation_against_validation_threshold_time_based_configured(
442442
time_from_threshold, should_cache, chain_id, endpoint, sync_provider, request_mocker
@@ -642,7 +642,7 @@ async def test_async_request_caching_does_not_share_state_between_providers(
642642
"threshold",
643643
(RequestCacheValidationThreshold.FINALIZED, RequestCacheValidationThreshold.SAFE),
644644
)
645-
@pytest.mark.parametrize("endpoint", BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT)
645+
@pytest.mark.parametrize("endpoint", sorted(BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT))
646646
@pytest.mark.parametrize(
647647
"blocknum,should_cache",
648648
(
@@ -689,7 +689,7 @@ async def test_async_blocknum_validation_against_validation_threshold_mainnet(
689689
"threshold",
690690
(RequestCacheValidationThreshold.FINALIZED, RequestCacheValidationThreshold.SAFE),
691691
)
692-
@pytest.mark.parametrize("endpoint", BLOCKNUM_IN_PARAMS)
692+
@pytest.mark.parametrize("endpoint", sorted(BLOCKNUM_IN_PARAMS))
693693
@pytest.mark.parametrize(
694694
"block_id,blocknum,should_cache",
695695
(
@@ -735,7 +735,7 @@ async def test_async_block_id_param_caching_mainnet(
735735
"threshold",
736736
(RequestCacheValidationThreshold.FINALIZED, RequestCacheValidationThreshold.SAFE),
737737
)
738-
@pytest.mark.parametrize("endpoint", BLOCKHASH_IN_PARAMS)
738+
@pytest.mark.parametrize("endpoint", sorted(BLOCKHASH_IN_PARAMS))
739739
@pytest.mark.parametrize(
740740
"blocknum,should_cache",
741741
(
@@ -794,7 +794,7 @@ async def test_async_request_caching_validation_threshold_defaults(
794794

795795
@pytest.mark.asyncio
796796
@pytest.mark.parametrize(
797-
"endpoint", BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS
797+
"endpoint", sorted(BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS)
798798
)
799799
@pytest.mark.parametrize(
800800
"time_from_threshold,should_cache",
@@ -856,7 +856,7 @@ async def test_async_validation_against_validation_threshold_time_based(
856856

857857
@pytest.mark.asyncio
858858
@pytest.mark.parametrize(
859-
"endpoint", BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS
859+
"endpoint", sorted(BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS)
860860
)
861861
@pytest.mark.parametrize("blocknum", ("0x0", "0x1", "0x2", "0x3", "0x4", "0x5"))
862862
async def test_async_request_caching_with_validation_threshold_set_to_none(
@@ -901,7 +901,7 @@ async def test_async_request_caching_with_validation_threshold_set_to_none(
901901
),
902902
)
903903
@pytest.mark.parametrize(
904-
"endpoint", BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS
904+
"endpoint", sorted(BLOCKNUM_IN_PARAMS | BLOCK_IN_RESULT | BLOCKHASH_IN_PARAMS)
905905
)
906906
async def test_async_validation_against_validation_threshold_time_based_configured(
907907
time_from_threshold,

tests/core/middleware/test_eth_tester_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
SAMPLE_ADDRESS = "0x0000000000000000000000000000000000000004"
1919

2020

21-
@pytest.mark.parametrize("block_number", {0, "0x0", "earliest"})
21+
@pytest.mark.parametrize("block_number", (0, "0x0", "earliest"))
2222
def test_get_transaction_count_formatters(w3, block_number):
2323
tx_counts = w3.eth.get_transaction_count(w3.eth.accounts[-1], block_number)
2424
assert tx_counts == 0

tox.ini

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ envlist=
1010
windows-wheel
1111

1212
[flake8]
13-
exclude= venv*,.tox,docs,build
14-
extend-ignore=E203,W503
15-
max-line-length=88
16-
per-file-ignores=__init__.py:F401
13+
exclude = venv*,.tox,docs,build
14+
extend-ignore = E203,W503
15+
max-line-length = 88
16+
per-file-ignores = __init__.py:F401
1717

1818
[blocklint]
19-
max_issue_threshold=1
19+
max_issue_threshold = 1
2020

2121
[testenv]
2222
allowlist_externals=make,pre-commit
@@ -41,7 +41,7 @@ commands=
4141
docs: make check-docs-ci
4242
deps =
4343
.[test]
44-
; install both `docs` and `test` dependencies for the `docs` environment
44+
; install both `docs` and `test` dependencies for the `docs` environment
4545
docs: .[docs]
4646
passenv =
4747
GETH_BINARY
@@ -60,37 +60,37 @@ basepython =
6060
py313: python3.13
6161

6262
[testenv:py{38,39,310,311,312,313}-lint]
63-
deps=pre-commit
64-
extras=dev
65-
commands=
63+
deps = pre-commit
64+
extras = dev
65+
commands =
6666
pre-commit install
6767
pre-commit run --all-files --show-diff-on-failure
6868

6969
[testenv:benchmark]
70-
basepython=python
71-
commands=
70+
basepython = python
71+
commands =
7272
python {toxinidir}/web3/tools/benchmark/main.py --num-calls 5
7373
python {toxinidir}/web3/tools/benchmark/main.py --num-calls 50
7474
python {toxinidir}/web3/tools/benchmark/main.py --num-calls 100
7575

7676

7777
[testenv:py{38,39,310,311,312,313}-wheel]
78-
deps=
78+
deps =
7979
wheel
8080
build[virtualenv]
81-
allowlist_externals=
81+
allowlist_externals =
8282
/bin/rm
8383
/bin/bash
84-
commands=
84+
commands =
8585
/bin/bash {toxinidir}/web3/scripts/release/test_wheel_install.sh
86-
skip_install=true
86+
skip_install = true
8787

8888
[testenv:windows-wheel]
89-
deps=
89+
deps =
9090
wheel
9191
build[virtualenv]
92-
allowlist_externals=
92+
allowlist_externals =
9393
bash.exe
94-
commands=
94+
commands =
9595
bash.exe {toxinidir}/web3/scripts/release/test_windows_wheel_install.sh
96-
skip_install=true
96+
skip_install = true

0 commit comments

Comments
 (0)