Skip to content

Commit a320d4a

Browse files
authored
tidy (#19833)
* tidy * Update test_data_rpc.py
1 parent 322aba7 commit a320d4a

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

chia/_tests/conftest.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22
from __future__ import annotations
33

44
import asyncio
5-
import cProfile
65
import datetime
76
import functools
87
import json
98
import logging
109
import math
1110
import multiprocessing
1211
import os
13-
import pathlib
1412
import random
15-
import subprocess
16-
import sys
1713
import sysconfig
1814
import tempfile
1915
from collections.abc import AsyncIterator, Iterator
@@ -190,23 +186,6 @@ def task_instrumentation_fixture(node_name_for_file: str, test_time_for_file: st
190186
task_instrumentation_main(args=[target_directory])
191187

192188

193-
@pytest.fixture(name="c_profile")
194-
def c_profile_fixture(node_name_for_file: str, test_time_for_file: str) -> Iterator[cProfile.Profile]:
195-
profile_path = pathlib.Path(f"cProfile-{node_name_for_file}-{test_time_for_file}")
196-
197-
profile = cProfile.Profile()
198-
199-
yield profile
200-
201-
profile_path.mkdir(exist_ok=True, parents=True)
202-
stat_path = profile_path.joinpath("log.profile")
203-
profile.dump_stats(stat_path)
204-
dot_path = profile_path.joinpath("log.dot")
205-
subprocess.run([sys.executable, "-m", "gprof2dot", "-f", "pstats", stat_path, "-o", dot_path], check=False)
206-
png_path = profile_path.joinpath("log.png")
207-
subprocess.run(["dot", "-Tpng", "-o", png_path, dot_path], check=False)
208-
209-
210189
@pytest.fixture(scope="session")
211190
def get_keychain():
212191
with TempKeyring() as keychain:

chia/_tests/core/data_layer/test_data_store.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,6 @@ async def write_tree_to_file_old_format(
13201320
raw_index = hash_to_index[node_hash]
13211321
raw_node = merkle_blob.get_raw_node(raw_index)
13221322

1323-
to_write = b""
13241323
if isinstance(raw_node, chia_rs.datalayer.InternalNode):
13251324
left_hash = merkle_blob.get_hash_at_index(raw_node.left)
13261325
right_hash = merkle_blob.get_hash_at_index(raw_node.right)
@@ -2016,7 +2015,6 @@ async def test_insert_key_already_present(data_store: DataStore, store_id: bytes
20162015
await data_store.insert(
20172016
key=key, value=value, store_id=store_id, reference_node_hash=None, side=None, status=Status.COMMITTED
20182017
)
2019-
# TODO: this exception should just be more specific to avoid the case sensitivity concerns
20202018
with pytest.raises(KeyAlreadyPresentError):
20212019
await data_store.insert(key=key, value=value, store_id=store_id, reference_node_hash=None, side=None)
20222020

@@ -2032,7 +2030,6 @@ async def test_batch_insert_key_already_present(
20322030
value = b"bar"
20332031
changelist = [{"action": "insert", "key": key, "value": value}]
20342032
await data_store.insert_batch(store_id, changelist, Status.COMMITTED, use_batch_autoinsert)
2035-
# TODO: this exception should just be more specific to avoid the case sensitivity concerns
20362033
with pytest.raises(KeyAlreadyPresentError):
20372034
await data_store.insert_batch(store_id, changelist, Status.COMMITTED, use_batch_autoinsert)
20382035

0 commit comments

Comments
 (0)