2
2
3
3
import random
4
4
5
+ import pytest
6
+
5
7
from chia .full_node .sync_store import SyncStore
6
8
from chia .types .blockchain_format .sized_bytes import bytes32
7
9
from chia .util .hash import std_hash
8
10
9
11
10
- def test_basic_store ():
12
+ @pytest .mark .anyio
13
+ async def test_basic_store ():
11
14
store = SyncStore ()
12
15
13
16
# Save/get sync
@@ -53,7 +56,8 @@ def test_basic_store():
53
56
assert store .get_heaviest_peak ().weight == 700
54
57
55
58
56
- def test_is_backtrack_syncing_works_when_not_present (seeded_random : random .Random ) -> None :
59
+ @pytest .mark .anyio
60
+ async def test_is_backtrack_syncing_works_when_not_present (seeded_random : random .Random ) -> None :
57
61
store = SyncStore ()
58
62
node_id = bytes32 .random (r = seeded_random )
59
63
@@ -63,7 +67,8 @@ def test_is_backtrack_syncing_works_when_not_present(seeded_random: random.Rando
63
67
assert node_id not in store ._backtrack_syncing
64
68
65
69
66
- def test_increment_backtrack_syncing_adds (seeded_random : random .Random ) -> None :
70
+ @pytest .mark .anyio
71
+ async def test_increment_backtrack_syncing_adds (seeded_random : random .Random ) -> None :
67
72
store = SyncStore ()
68
73
node_id = bytes32 .random (r = seeded_random )
69
74
@@ -73,7 +78,8 @@ def test_increment_backtrack_syncing_adds(seeded_random: random.Random) -> None:
73
78
assert node_id in store ._backtrack_syncing
74
79
75
80
76
- def test_increment_backtrack_syncing_increments (seeded_random : random .Random ) -> None :
81
+ @pytest .mark .anyio
82
+ async def test_increment_backtrack_syncing_increments (seeded_random : random .Random ) -> None :
77
83
store = SyncStore ()
78
84
node_id = bytes32 .random (r = seeded_random )
79
85
@@ -82,7 +88,10 @@ def test_increment_backtrack_syncing_increments(seeded_random: random.Random) ->
82
88
assert store ._backtrack_syncing [node_id ] == 2
83
89
84
90
85
- def test_decrement_backtrack_syncing_does_nothing_when_not_present (seeded_random : random .Random ) -> None :
91
+ @pytest .mark .anyio
92
+ async def test_decrement_backtrack_syncing_does_nothing_when_not_present (
93
+ seeded_random : random .Random ,
94
+ ) -> None :
86
95
store = SyncStore ()
87
96
node_id = bytes32 .random (r = seeded_random )
88
97
@@ -92,7 +101,8 @@ def test_decrement_backtrack_syncing_does_nothing_when_not_present(seeded_random
92
101
assert node_id not in store ._backtrack_syncing
93
102
94
103
95
- def test_decrement_backtrack_syncing_decrements (seeded_random : random .Random ) -> None :
104
+ @pytest .mark .anyio
105
+ async def test_decrement_backtrack_syncing_decrements (seeded_random : random .Random ) -> None :
96
106
store = SyncStore ()
97
107
node_id = bytes32 .random (r = seeded_random )
98
108
@@ -101,7 +111,8 @@ def test_decrement_backtrack_syncing_decrements(seeded_random: random.Random) ->
101
111
assert store ._backtrack_syncing [node_id ] == 1
102
112
103
113
104
- def test_decrement_backtrack_syncing_removes_at_0 (seeded_random : random .Random ) -> None :
114
+ @pytest .mark .anyio
115
+ async def test_decrement_backtrack_syncing_removes_at_0 (seeded_random : random .Random ) -> None :
105
116
store = SyncStore ()
106
117
node_id = bytes32 .random (r = seeded_random )
107
118
@@ -110,7 +121,8 @@ def test_decrement_backtrack_syncing_removes_at_0(seeded_random: random.Random)
110
121
assert node_id not in store ._backtrack_syncing
111
122
112
123
113
- def test_backtrack_syncing_removes_on_disconnect (seeded_random : random .Random ) -> None :
124
+ @pytest .mark .anyio
125
+ async def test_backtrack_syncing_removes_on_disconnect (seeded_random : random .Random ) -> None :
114
126
store = SyncStore ()
115
127
node_id = bytes32 .random (r = seeded_random )
116
128
0 commit comments