diff --git a/chia/_tests/conftest.py b/chia/_tests/conftest.py index 3afc3c0603dd..c01042c453c1 100644 --- a/chia/_tests/conftest.py +++ b/chia/_tests/conftest.py @@ -2,7 +2,6 @@ from __future__ import annotations import asyncio -import cProfile import datetime import functools import json @@ -10,10 +9,7 @@ import math import multiprocessing import os -import pathlib import random -import subprocess -import sys import sysconfig import tempfile from collections.abc import AsyncIterator, Iterator @@ -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: diff --git a/chia/_tests/core/data_layer/test_data_store.py b/chia/_tests/core/data_layer/test_data_store.py index 0c6725c70657..35c2c1557e9f 100644 --- a/chia/_tests/core/data_layer/test_data_store.py +++ b/chia/_tests/core/data_layer/test_data_store.py @@ -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) @@ -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) @@ -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)