Skip to content
Merged

tidy #19833

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions chia/_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
from __future__ import annotations

import asyncio
import cProfile
import datetime
import functools
import json
import logging
import math
import multiprocessing
import os
import pathlib
import random
import subprocess
import sys
import sysconfig
import tempfile
from collections.abc import AsyncIterator, Iterator
Expand Down Expand Up @@ -190,23 +186,6 @@ def task_instrumentation_fixture(node_name_for_file: str, test_time_for_file: st
task_instrumentation_main(args=[target_directory])


@pytest.fixture(name="c_profile")
def c_profile_fixture(node_name_for_file: str, test_time_for_file: str) -> Iterator[cProfile.Profile]:
profile_path = pathlib.Path(f"cProfile-{node_name_for_file}-{test_time_for_file}")

profile = cProfile.Profile()

yield profile

profile_path.mkdir(exist_ok=True, parents=True)
stat_path = profile_path.joinpath("log.profile")
profile.dump_stats(stat_path)
dot_path = profile_path.joinpath("log.dot")
subprocess.run([sys.executable, "-m", "gprof2dot", "-f", "pstats", stat_path, "-o", dot_path], check=False)
png_path = profile_path.joinpath("log.png")
subprocess.run(["dot", "-Tpng", "-o", png_path, dot_path], check=False)


@pytest.fixture(scope="session")
def get_keychain():
with TempKeyring() as keychain:
Expand Down
3 changes: 0 additions & 3 deletions chia/_tests/core/data_layer/test_data_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,6 @@ async def write_tree_to_file_old_format(
raw_index = hash_to_index[node_hash]
raw_node = merkle_blob.get_raw_node(raw_index)

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

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

Expand Down
Loading