repo_id
stringclasses
409 values
prefix
large_stringlengths
34
36.3k
target
large_stringlengths
1
498
assertion_type
stringclasses
31 values
difficulty
stringclasses
8 values
test_file
stringlengths
10
121
test_function
stringlengths
1
104
test_class
stringlengths
0
51
lineno
int32
2
11.3k
commit_idx
int32
redis/redis-py
import threading from typing import Tuple from unittest.mock import patch, Mock import pytest from redis.exceptions import ResponseError import redis from redis import CrossSlotTransactionError, ConnectionPool, RedisClusterException from redis.backoff import NoBackoff from redis.client import Redis from redis.cluster...
None
assert
none_literal
tests/test_cluster_transaction.py
test_transaction_execute_records_metric
TestClusterTransactionMetricsRecording
492
null
redis/redis-py
import platform import queue import socket import threading import time from collections import defaultdict from unittest import mock from unittest.mock import patch import pytest import redis from redis.client import PubSub from redis.event import EventDispatcher from redis.exceptions import ConnectionError from redi...
0
assert
numeric_literal
tests/test_pubsub.py
test_pubsub_execute_records_metric
TestPubSubMetricsRecording
1,522
null
redis/redis-py
import os import re import time from contextlib import closing from threading import Thread from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.cache import CacheConfig from redis.connection import CacheProxyConnection, Connection, to_bool from redis.event import ( A...
1
assert
numeric_literal
tests/test_connection_pool.py
test_release_not_owned_connection
TestConnectionPool
129
null
redis/redis-py
import socket import threading from typing import List, Union from unittest.mock import patch import pytest from time import sleep from redis import Redis from redis.cache import CacheConfig from redis.connection import ( AbstractConnection, Connection, ConnectionPool, BlockingConnectionPool, Main...
True
assert
bool_literal
tests/maint_notifications/test_maint_notifications_handling.py
validate_free_connections_state
Helpers
132
null
redis/redis-py
from math import inf import pytest import redis.commands.bf from redis.exceptions import RedisError from .conftest import ( _get_client, assert_resp_response, is_resp2_connection, skip_ifmodversion_lt, ) def decoded_r(request, stack_url): with _get_client( redis.Redis, request, decode_res...
5
assert
numeric_literal
tests/test_bloom.py
do_verify
134
null
redis/redis-py
import threading from typing import Tuple from unittest.mock import patch, Mock import pytest from redis.exceptions import ResponseError import redis from redis import CrossSlotTransactionError, ConnectionPool, RedisClusterException from redis.backoff import NoBackoff from redis.client import Redis from redis.cluster...
b"2"
assert
string_literal
tests/test_cluster_transaction.py
my_transaction
TestClusterTransaction
384
null
redis/redis-py
import binascii import datetime import select import socket import socketserver import threading from typing import List import warnings from queue import LifoQueue, Queue from time import sleep from unittest.mock import DEFAULT, Mock, call, patch import pytest import redis from redis import Redis from redis._parsers ...
1
assert
numeric_literal
tests/test_cluster.py
test_execute_command_node_flag_random
TestRedisClusterObj
460
null
redis/redis-py
import pytest import redis from redis import exceptions from redis.commands.core import Script from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt multiply_script = """ local value = redis.call('GET', KEYS[1]) value = tonumber(value) return value * ARGV[1]""" msgpack_hello_script = """ loca...
b"b"
assert
string_literal
tests/test_scripting.py
test_eval_ro
TestScripting
71
null
redis/redis-py
import pytest import redis from redis import exceptions from redis.commands.core import Script from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt multiply_script = """ local value = redis.call('GET', KEYS[1]) value = tonumber(value) return value * ARGV[1]""" msgpack_hello_script = """ loca...
[True]
assert
collection
tests/test_scripting.py
test_script_loading
TestScripting
180
null
redis/redis-py
from typing import Tuple from unittest.mock import patch, Mock import pytest import redis from redis import CrossSlotTransactionError, RedisClusterException from redis.asyncio import RedisCluster, Connection from redis.asyncio.cluster import ClusterNode, NodesManager from redis.asyncio.retry import Retry from redis.b...
b"4"
assert
string_literal
tests/test_asyncio/test_cluster_transaction.py
test_transaction_callable
TestClusterTransaction
388
null
redis/redis-py
import random from unittest.mock import Mock, patch import pytest from redis import ResponseError from redis._parsers import CommandsParser from redis._parsers.commands import CommandPolicies, RequestPolicy, ResponsePolicy from redis.commands.policies import DynamicPolicyResolver, StaticPolicyResolver from redis.com...
"idx"
assert
string_literal
tests/test_command_policies.py
test_resolves_correctly_policies
TestClusterWithPolicies
121
null
redis/redis-py
import math import time from datetime import datetime, timedelta import pytest from redis import exceptions from redis.commands.core import HashDataPersistOptions from tests.conftest import skip_if_server_version_lt from tests.test_utils import redis_server_time @skip_if_server_version_lt("7.9.0") def test_hsetex_no_...
1
assert
numeric_literal
tests/test_hash.py
test_hsetex_no_expiration
472
null
redis/redis-py
import string from redis.commands.helpers import ( delist, list_or_args, nativestr, parse_to_list, random_string, ) def test_list_or_args(): k = ["hello, world"] a = ["some", "argument", "list"] assert list_or_args(k, a) ==
k + a
assert
complex_expr
tests/test_helpers.py
test_list_or_args
15
null
redis/redis-py
import string from redis.commands.helpers import ( delist, list_or_args, nativestr, parse_to_list, random_string, ) def test_parse_to_list(): assert parse_to_list(None) ==
[]
assert
collection
tests/test_helpers.py
test_parse_to_list
22
null
redis/redis-py
import json import gzip from io import BytesIO from typing import Any, Dict from urllib.error import HTTPError from urllib.parse import urlparse, parse_qs import pytest from redis.backoff import ExponentialWithJitterBackoff from redis.http.http_client import HttpClient, HttpError from redis.retry import Retry class ...
headers
assert
variable
tests/test_http/test_http_client.py
test_request_low_level_headers_auth_and_timeout_default
TestHttpClient
371
null
redis/redis-py
import binascii import datetime import select import socket import socketserver import threading from typing import List import warnings from queue import LifoQueue, Queue from time import sleep from unittest.mock import DEFAULT, Mock, call, patch import pytest import redis from redis import Redis from redis._parsers ...
2
assert
numeric_literal
tests/test_cluster.py
test_cluster_countkeysinslot
TestClusterRedisCommands
1,347
null
redis/redis-py
import json import random import numpy as np import pytest import redis from redis.commands.vectorset.commands import QuantizationOptions from .conftest import ( _get_client, skip_if_server_version_lt, ) def d_client(request): r = _get_client(redis.Redis, request, decode_responses=True) r.flushdb() ...
3
assert
numeric_literal
tests/test_vsets.py
test_add_elem_reduced_dim
65
null
redis/redis-py
import pytest from redis._parsers import CommandsParser from redis._parsers.commands import RequestPolicy, ResponsePolicy from tests.helpers import get_expected_command_policies from .conftest import ( assert_resp_response, skip_if_redis_enterprise, skip_if_server_version_gte, skip_if_server_version_lt...
0
assert
numeric_literal
tests/test_command_parser.py
test_get_command_policies
TestCommandsParser
122
null
redis/redis-py
import functools import random import string import threading from time import sleep from typing import Optional, Tuple, Union from unittest.mock import Mock, call import pytest import redis from redis import AuthenticationError, DataError, Redis, ResponseError from redis.auth.err import RequestTokenErr from redis.bac...
""
assert
string_literal
tests/test_credentials.py
test_user_pass_provider_only_password
TestUsernamePasswordCredentialProvider
292
null
redis/redis-py
import pytest from .conftest import ( skip_if_redis_enterprise, skip_ifnot_redis_enterprise, wait_for_command, ) class TestMonitor: @skip_if_redis_enterprise() def test_lua_script(self, r): with r.monitor() as m: script = 'return redis.call("GET", "foo")' assert r....
"lua"
assert
string_literal
tests/test_monitor.py
test_lua_script
TestMonitor
57
null
redis/redis-py
import threading from typing import Tuple from unittest.mock import patch, Mock import pytest from redis.exceptions import ResponseError import redis from redis import CrossSlotTransactionError, ConnectionPool, RedisClusterException from redis.backoff import NoBackoff from redis.client import Redis from redis.cluster...
[]
assert
collection
tests/test_cluster_transaction.py
test_pipeline_empty_transaction
TestClusterTransaction
54
null
redis/redis-py
import json import gzip from io import BytesIO from typing import Any, Dict from urllib.error import HTTPError from urllib.parse import urlparse, parse_qs import pytest from redis.backoff import ExponentialWithJitterBackoff from redis.http.http_client import HttpClient, HttpError from redis.retry import Retry class ...
payload
assert
variable
tests/test_http/test_http_client.py
test_get_returns_parsed_json_and_uses_timeout
TestHttpClient
78
null
redis/redis-py
import socket import threading from typing import List, Union from unittest.mock import patch import pytest from time import sleep from redis import Redis from redis.cache import CacheConfig from redis.connection import ( AbstractConnection, Connection, ConnectionPool, BlockingConnectionPool, Main...
4
assert
numeric_literal
tests/maint_notifications/test_maint_notifications_handling.py
test_migrating_after_moving_multiple_proxies
TestMaintenanceNotificationsHandlingMultipleProxies
2,100
null
redis/redis-py
import time from time import sleep import pytest import pytest_asyncio import redis.asyncio as redis from tests.conftest import ( assert_resp_response, is_resp2_connection, skip_if_server_version_gte, skip_if_server_version_lt, skip_ifmodversion_lt, ) async def decoded_r(create_redis, stack_url): ...
res[1]
assert
complex_expr
tests/test_asyncio/test_timeseries.py
test_add_duplicate_policy
149
null
redis/redis-py
import bz2 import csv import os import random import time from io import TextIOWrapper import numpy as np import pytest from redis import ResponseError import redis import redis.commands.search.aggregation as aggregations from redis.commands.search.hybrid_query import ( CombinationMethods, CombineResultsMetho...
3
assert
numeric_literal
tests/test_search.py
test_spell_check
TestBaseSearchFunctionality
918
null
redis/redis-py
from unittest.mock import patch import pytest from redis.asyncio.retry import Retry as AsyncRetry from redis.backoff import ( AbstractBackoff, ConstantBackoff, DecorrelatedJitterBackoff, EqualJitterBackoff, ExponentialBackoff, ExponentialWithJitterBackoff, FullJitterBackoff, NoBackoff, ...
[]
assert
collection
tests/test_retry.py
test_retry_on_error_empty_value
TestConnectionConstructorWithRetry
71
null
redis/redis-py
from math import inf import pytest import redis.commands.bf from redis.exceptions import RedisError from .conftest import ( _get_client, assert_resp_response, is_resp2_connection, skip_ifmodversion_lt, ) def decoded_r(request, stack_url): with _get_client( redis.Redis, request, decode_res...
0
assert
numeric_literal
tests/test_bloom.py
test_bf_card
202
null
redis/redis-py
import binascii import datetime import re import threading import time from asyncio import CancelledError from string import ascii_letters from unittest import mock from unittest.mock import patch import pytest from redis import DataError, RedisClusterException, ResponseError import redis from redis import exceptions ...
1
assert
numeric_literal
tests/test_commands.py
get_stream_message
60
null
redis/redis-py
import os import re import time from contextlib import closing from threading import Thread from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.cache import CacheConfig from redis.connection import CacheProxyConnection, Connection, to_bool from redis.event import ( A...
0
assert
numeric_literal
tests/test_connection_pool.py
test_health_check_in_pubsub_after_subscribed
TestHealthCheck
927
null
redis/redis-py
from unittest.mock import patch import pytest from redis.asyncio.retry import Retry as AsyncRetry from redis.backoff import ( AbstractBackoff, ConstantBackoff, DecorrelatedJitterBackoff, EqualJitterBackoff, ExponentialBackoff, ExponentialWithJitterBackoff, FullJitterBackoff, NoBackoff, ...
0
assert
numeric_literal
tests/test_retry.py
test_retry_on_error_empty_value
TestConnectionConstructorWithRetry
73
null
redis/redis-py
import socket import ssl from urllib.parse import urlparse import pytest import redis from redis.exceptions import ConnectionError, RedisError from .conftest import ( skip_if_cryptography, skip_if_nocryptography, skip_if_server_version_lt, ) from .ssl_utils import CertificateType, get_tls_certificates, CN...
1
assert
numeric_literal
tests/test_ssl.py
test_ssl_verify_flags_applied_to_context
TestSSL
373
null
redis/redis-py
from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.event import ( EventDispatcher, ) from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsCollector class TestRed...
"SET"
assert
string_literal
tests/test_client.py
test_execute_command_records_metrics
TestRedisClientMetricsRecording
134
null
redis/redis-py
import asyncio import functools import socket import sys from typing import Optional from unittest.mock import patch from unittest import mock import pytest import pytest_asyncio import redis.asyncio as redis from redis.exceptions import ConnectionError from redis.typing import EncodableT from tests.conftest import g...
{}
assert
collection
tests/test_asyncio/test_pubsub.py
test_context_manager
TestPubSubAutoDecoding
642
null
redis/redis-py
from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.event import ( EventDispatcher, ) from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsCollector class TestRed...
3
assert
numeric_literal
tests/test_client.py
test_multiple_commands_record_multiple_metrics
TestRedisClientMetricsRecording
264
null
redis/redis-py
import threading from unittest.mock import Mock, call, patch, MagicMock import pytest from redis.connection import ConnectionInterface, MaintNotificationsAbstractConnection from redis.maint_notifications import ( MaintenanceNotification, NodeMovingNotification, NodeMigratingNotification, NodeMigratedN...
5
assert
numeric_literal
tests/maint_notifications/test_maint_notifications.py
test_default_ttl
TestNodeMigratedNotification
277
null
redis/redis-py
from contextlib import closing from unittest import mock import pytest from redis import RedisClusterException import redis from redis.client import Pipeline from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsColle...
b"1"
assert
string_literal
tests/test_pipeline.py
test_exec_error_in_no_transaction_pipeline
TestPipeline
360
null
redis/redis-py
import socket import threading from typing import List, Union from unittest.mock import patch import pytest from time import sleep from redis import Redis from redis.cache import CacheConfig from redis.connection import ( AbstractConnection, Connection, ConnectionPool, BlockingConnectionPool, Main...
2
assert
numeric_literal
tests/maint_notifications/test_maint_notifications_handling.py
test_migrating_after_moving_multiple_proxies
TestMaintenanceNotificationsHandlingMultipleProxies
2,099
null
redis/redis-py
import socket import threading from typing import List, Union from unittest.mock import patch import pytest from time import sleep from redis import Redis from redis.cache import CacheConfig from redis.connection import ( AbstractConnection, Connection, ConnectionPool, BlockingConnectionPool, Main...
1
assert
numeric_literal
tests/maint_notifications/test_maint_notifications_handling.py
test_migrating_after_moving_multiple_proxies
TestMaintenanceNotificationsHandlingMultipleProxies
2,142
null
redis/redis-py
import socket from unittest import mock import pytest import pytest_asyncio from redis.asyncio.client import StrictRedis import redis.asyncio.sentinel from redis import exceptions from redis.asyncio.sentinel import ( MasterNotFoundError, Sentinel, SentinelConnectionPool, SlaveNotFoundError, ) from tes...
pool
assert
variable
tests/test_asyncio/test_sentinel.py
test_repr_correctly_represents_connection_object
313
null
redis/redis-py
import pytest from redis._parsers import CommandsParser from redis._parsers.commands import RequestPolicy, ResponsePolicy from tests.helpers import get_expected_command_policies from .conftest import ( assert_resp_response, skip_if_redis_enterprise, skip_if_server_version_gte, skip_if_server_version_lt...
[]
assert
collection
tests/test_command_parser.py
test_get_eval_keys_with_0_keys
TestCommandsParser
100
null
redis/redis-py
from typing import Tuple from unittest.mock import patch, Mock import pytest import redis from redis import CrossSlotTransactionError, RedisClusterException from redis.asyncio import RedisCluster, Connection from redis.asyncio.cluster import ClusterNode, NodesManager from redis.asyncio.retry import Retry from redis.b...
[]
assert
collection
tests/test_asyncio/test_cluster_transaction.py
test_pipeline_empty_transaction
TestClusterTransaction
50
null
redis/redis-py
from contextlib import closing from unittest import mock import pytest from redis import RedisClusterException import redis from redis.client import Pipeline from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsColle...
"0"
assert
string_literal
tests/test_pipeline.py
test_pipeline_execute_records_metric
TestPipelineMetricsRecording
598
null
redis/redis-py
import contextlib import multiprocessing import platform import pytest import redis from redis.connection import Connection, ConnectionPool from redis.exceptions import ConnectionError from .conftest import _get_client def exit_callback(callback, *args): try: yield finally: callback(*args) c...
True
assert
bool_literal
tests/test_multiprocessing.py
test_redis_client
TestMultiprocessing
208
null
redis/redis-py
import binascii import datetime import re import threading import time from asyncio import CancelledError from string import ascii_letters from unittest import mock from unittest.mock import patch import pytest from redis import DataError, RedisClusterException, ResponseError import redis from redis import exceptions ...
2
assert
numeric_literal
tests/test_commands.py
test_acl_getuser_setuser
TestRedisCommands
310
null
redis/redis-py
from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.event import ( EventDispatcher, ) from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsCollector class TestRed...
attrs
assert
variable
tests/test_client.py
test_no_batch_size_for_single_command
TestRedisClientMetricsRecording
351
null
redis/redis-py
import asyncio import re from unittest import mock import pytest import pytest_asyncio import redis.asyncio as redis from redis.asyncio.connection import Connection, to_bool from redis.auth.token import TokenInterface from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt from .compat import a...
True
assert
bool_literal
tests/test_asyncio/test_connection_pool.py
test_auto_release_override_true_manual_created_pool
TestRedisAutoReleaseConnectionPool
64
null
redis/redis-py
import asyncio import socket import types from unittest import mock from errno import ECONNREFUSED from unittest.mock import patch import pytest import redis from redis._parsers import ( _AsyncHiredisParser, _AsyncRESP2Parser, _AsyncRESP3Parser, _AsyncRESPBase, ) from redis.asyncio import ConnectionPoo...
True
assert
bool_literal
tests/test_asyncio/test_connection.py
test_can_run_concurrent_commands
133
null
redis/redis-py
import socket import ssl from urllib.parse import urlparse import pytest import redis from redis.exceptions import ConnectionError, RedisError from .conftest import ( skip_if_cryptography, skip_if_nocryptography, skip_if_server_version_lt, ) from .ssl_utils import CertificateType, get_tls_certificates, CN...
2
assert
numeric_literal
tests/test_ssl.py
test_ssl_verify_flags_applied_to_context
TestSSL
370
null
redis/redis-py
import pytest import pytest_asyncio import redis.asyncio as redis from redis.exceptions import DataError class TestMemoryviewsAreNotPacked: async def test_memoryviews_are_not_packed(self, r): arg = memoryview(b"some_arg") arg_list = ["SOME_COMMAND", arg] c = r.connection or await r.connecti...
arg
assert
variable
tests/test_asyncio/test_encoding.py
test_memoryviews_are_not_packed
TestMemoryviewsAreNotPacked
79
null
redis/redis-py
import threading from typing import Tuple from unittest.mock import patch, Mock import pytest from redis.exceptions import ResponseError import redis from redis import CrossSlotTransactionError, ConnectionPool, RedisClusterException from redis.backoff import NoBackoff from redis.client import Redis from redis.cluster...
2
assert
numeric_literal
tests/test_cluster_transaction.py
test_multiple_transaction_executions_record_multiple_metrics
TestClusterTransactionMetricsRecording
583
null
redis/redis-py
import math import time from time import sleep import pytest import redis from .conftest import ( _get_client, assert_resp_response, is_resp2_connection, skip_if_server_version_gte, skip_if_server_version_lt, skip_ifmodversion_lt, ) def decoded_r(request, stack_url): with _get_client( ...
2
assert
numeric_literal
tests/test_timeseries.py
test_madd_missing_timeseries
183
null
redis/redis-py
import asyncio import pytest from redis.data_structure import WeightedList from redis.multidb.circuit import State as CBState from redis.multidb.exception import ( NoValidDatabaseException, TemporaryUnavailableException, ) from redis.asyncio.multidb.failover import ( WeightBasedFailoverStrategy, Defau...
mock_db
assert
variable
tests/test_asyncio/test_multidb/test_failover.py
test_execute_returns_valid_database_with_failover_attempts
TestDefaultStrategyExecutor
98
null
redis/redis-py
import time from time import sleep import pytest import pytest_asyncio import redis.asyncio as redis from tests.conftest import ( assert_resp_response, is_resp2_connection, skip_if_server_version_gte, skip_if_server_version_lt, skip_ifmodversion_lt, ) async def decoded_r(create_redis, stack_url): ...
""
assert
string_literal
tests/test_asyncio/test_timeseries.py
test_del_range
243
null
redis/redis-py
import random from unittest.mock import Mock, patch import pytest from redis import ResponseError from redis._parsers import CommandsParser from redis._parsers.commands import CommandPolicies, RequestPolicy, ResponsePolicy from redis.commands.policies import DynamicPolicyResolver, StaticPolicyResolver from redis.com...
None
assert
none_literal
tests/test_command_policies.py
test_resolve
TestBasePolicyResolver
45
null
redis/redis-py
import socket from unittest import mock import pytest from redis.client import StrictRedis import redis.sentinel from redis import exceptions from redis.sentinel import ( MasterNotFoundError, Sentinel, SentinelConnectionPool, SlaveNotFoundError, ) from tests.conftest import is_resp2_connection def ma...
[]
assert
collection
tests/test_sentinel.py
test_discover_slaves
189
null
redis/redis-py
import pytest import redis from .conftest import _get_client class TestEncoding: def r(self, request): return _get_client(redis.Redis, request=request, decode_responses=True) def r_no_decode(self, request): return _get_client(redis.Redis, request=request, decode_responses=False) def tes...
result
assert
variable
tests/test_encoding.py
test_list_encoding
TestEncoding
51
null
redis/redis-py
import re import socket import socketserver import ssl import threading import pytest from redis.connection import Connection, SSLConnection, UnixDomainSocketConnection from redis.exceptions import RedisError from .ssl_utils import CertificateType, get_tls_certificates _CLIENT_NAME = "test-suite-client" _CMD_SEP = b...
0
assert
numeric_literal
tests/test_connect.py
test_unix_socket_with_timeout
119
null
redis/redis-py
import binascii import datetime import select import socket import socketserver import threading from typing import List import warnings from queue import LifoQueue, Queue from time import sleep from unittest.mock import DEFAULT, Mock, call, patch import pytest import redis from redis import Redis from redis._parsers ...
7
assert
numeric_literal
tests/test_cluster.py
test_cluster_nodes
TestClusterRedisCommands
1,441
null
redis/redis-py
import os import re import time from contextlib import closing from threading import Thread from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.cache import CacheConfig from redis.connection import CacheProxyConnection, Connection, to_bool from redis.event import ( A...
None
assert
none_literal
tests/test_connection_pool.py
test_health_check_in_pubsub_after_subscribed
TestHealthCheck
931
null
redis/redis-py
import asyncio import contextlib import pytest from redis.asyncio import Redis from redis.asyncio.cluster import RedisCluster from redis.asyncio.connection import async_timeout @pytest.mark.onlynoncluster @pytest.mark.parametrize("delay", argvalues=[0.05, 0.5, 1, 2]) async def test_standalone_pipeline(delay, master_h...
[]
assert
collection
tests/test_asyncio/test_cwe_404.py
test_standalone_pipeline
184
null
redis/redis-py
import asyncio from unittest.mock import Mock import pytest from redis.asyncio.multidb.command_executor import AsyncCommandExecutor from redis.asyncio.multidb.database import Database from redis.asyncio.multidb.failure_detector import FailureDetectorAsyncWrapper from redis.multidb.circuit import State as CBState from...
CBState.OPEN
assert
complex_expr
tests/test_asyncio/test_multidb/test_failure_detector.py
test_failure_detector_do_not_open_circuit_on_interval_exceed
TestFailureDetectorAsyncWrapper
100
null
redis/redis-py
import pytest import pytest_asyncio import redis.asyncio as redis from redis.exceptions import DataError class TestEncoding: async def r(self, create_redis): redis = await create_redis(decode_responses=True) yield redis await redis.flushall() async def r_no_decode(self, create_redis):...
result
assert
variable
tests/test_asyncio/test_encoding.py
test_list_encoding
TestEncoding
56
null
redis/redis-py
from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.event import ( EventDispatcher, ) from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsCollector class TestRed...
"0"
assert
string_literal
tests/test_client.py
test_execute_command_records_metrics
TestRedisClientMetricsRecording
137
null
redis/redis-py
import asyncio import functools import socket import sys from typing import Optional from unittest.mock import patch from unittest import mock import pytest import pytest_asyncio import redis.asyncio as redis from redis.exceptions import ConnectionError from redis.typing import EncodableT from tests.conftest import g...
p
assert
variable
tests/test_asyncio/test_pubsub.py
exception_handler_callback
TestPubSubRun
907
null
redis/redis-py
import pybreaker import pytest from redis.multidb.circuit import ( PBCircuitBreakerAdapter, State as CbState, CircuitBreaker, ) class TestPBCircuitBreaker: @pytest.mark.parametrize( "mock_db", [ {"weight": 0.7, "circuit": {"state": CbState.CLOSED}}, ], indir...
mock_db
assert
variable
tests/test_multidb/test_circuit.py
test_cb_correctly_configured
TestPBCircuitBreaker
40
null
redis/redis-py
import json import gzip from io import BytesIO from typing import Any, Dict from urllib.error import HTTPError from urllib.parse import urlparse, parse_qs import pytest from redis.backoff import ExponentialWithJitterBackoff from redis.http.http_client import HttpClient, HttpError from redis.retry import Retry class ...
"1"
assert
string_literal
tests/test_http/test_http_client.py
fake_urlopen
TestHttpClient
219
null
redis/redis-py
import time from time import sleep import pytest import pytest_asyncio import redis.asyncio as redis from tests.conftest import ( assert_resp_response, is_resp2_connection, skip_if_server_version_gte, skip_if_server_version_lt, skip_ifmodversion_lt, ) async def decoded_r(create_redis, stack_url): ...
len(res)
assert
func_call
tests/test_asyncio/test_timeseries.py
test_multi_range
358
null
redis/redis-py
import pytest import redis from redis import Redis, exceptions from redis.commands.json.decoders import decode_list, unstring from redis.commands.json.path import Path from .conftest import _get_client, assert_resp_response, skip_ifmodversion_lt def client(request, stack_url): r = _get_client(Redis, request, deco...
3
assert
numeric_literal
tests/test_json.py
test_json_delete_with_dollar
372
null
redis/redis-py
from contextlib import closing from unittest import mock import pytest from redis import RedisClusterException import redis from redis.client import Pipeline from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsColle...
"a"
assert
string_literal
tests/test_pipeline.py
test_transaction_callable_returns_value_from_callable
TestPipeline
345
null
redis/redis-py
import threading from typing import Tuple from unittest.mock import patch, Mock import pytest from redis.exceptions import ResponseError import redis from redis import CrossSlotTransactionError, ConnectionPool, RedisClusterException from redis.backoff import NoBackoff from redis.client import Redis from redis.cluster...
0
assert
numeric_literal
tests/test_cluster_transaction.py
test_transaction_execute_records_metric
TestClusterTransactionMetricsRecording
497
null
redis/redis-py
import binascii import datetime import select import socket import socketserver import threading from typing import List import warnings from queue import LifoQueue, Queue from time import sleep from unittest.mock import DEFAULT, Mock, call, patch import pytest import redis from redis import Redis from redis._parsers ...
0
assert
numeric_literal
tests/test_cluster.py
test_cluster_get_set_retry_object
TestRedisClusterObj
967
null
redis/redis-py
from contextlib import closing from unittest import mock import pytest from redis import RedisClusterException import redis from redis.client import Pipeline from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsColle...
1
assert
numeric_literal
tests/test_pipeline.py
test_close_is_reset
TestPipeline
306
null
redis/redis-py
from math import inf import pytest import pytest_asyncio import redis.asyncio as redis from redis.exceptions import RedisError from tests.conftest import ( assert_resp_response, is_resp2_connection, skip_ifmodversion_lt, ) async def decoded_r(create_redis, stack_url): return await create_redis(decode_...
res
assert
variable
tests/test_asyncio/test_bloom.py
test_topk
328
null
redis/redis-py
import pytest import pytest_asyncio from redis import exceptions from tests.conftest import skip_if_server_version_lt multiply_script = """ local value = redis.call('GET', KEYS[1]) value = tonumber(value) return value * ARGV[1]""" msgpack_hello_script = """ local message = cmsgpack.unpack(ARGV[1]) local name = messag...
[True]
assert
collection
tests/test_asyncio/test_scripting.py
test_script_loading
TestScripting
81
null
redis/redis-py
import os import re import time from contextlib import closing from threading import Thread from unittest import mock from unittest.mock import MagicMock import pytest import redis from redis.cache import CacheConfig from redis.connection import CacheProxyConnection, Connection, to_bool from redis.event import ( A...
c2
assert
variable
tests/test_connection_pool.py
test_multiple_connections
TestConnectionPool
99
null
redis/redis-py
from unittest import mock import pytest from redis import RedisClusterException import redis from tests.conftest import skip_if_server_version_lt from .compat import aclosing from .conftest import wait_for_command class TestPipeline: async def test_exec_error_in_response(self, r): """ an invalid...
b"2"
assert
string_literal
tests/test_asyncio/test_pipeline.py
test_exec_error_in_response
TestPipeline
104
null
redis/redis-py
import threading from unittest.mock import Mock, call, patch, MagicMock import pytest from redis.connection import ConnectionInterface, MaintNotificationsAbstractConnection from redis.maint_notifications import ( MaintenanceNotification, NodeMovingNotification, NodeMigratingNotification, NodeMigratedN...
2
assert
numeric_literal
tests/maint_notifications/test_maint_notifications.py
test_in_set
TestOSSNodeMigratingNotification
485
null
redis/redis-py
import pytest from .conftest import ( skip_if_redis_enterprise, skip_ifnot_redis_enterprise, wait_for_command, ) class TestMonitor: def test_wait_command_not_found(self, r): "Make sure the wait_for_command func works when command is not found" with r.monitor() as m: respons...
None
assert
none_literal
tests/test_monitor.py
test_wait_command_not_found
TestMonitor
16
null
redis/redis-py
import pytest from redis.asyncio import Redis from redis.asyncio.connection import Connection, UnixDomainSocketConnection from redis.asyncio.retry import Retry from redis.backoff import AbstractBackoff, ExponentialBackoff, NoBackoff from redis.exceptions import ConnectionError, TimeoutError class TestConnectionConstru...
retries
assert
variable
tests/test_asyncio/test_retry.py
test_retry_with_retry_on_timeout
TestConnectionConstructorWithRetry
59
null
redis/redis-py
import pytest import redis from redis import exceptions from redis.commands.core import Script from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt multiply_script = """ local value = redis.call('GET', KEYS[1]) value = tonumber(value) return value * ARGV[1]""" msgpack_hello_script = """ loca...
8
assert
numeric_literal
tests/test_scripting.py
test_eval_same_slot
TestScripting
97
null
redis/redis-py
import math import time from datetime import datetime, timedelta import pytest from redis import exceptions from redis.commands.core import HashDataPersistOptions from tests.conftest import skip_if_server_version_lt from tests.test_utils import redis_server_time @skip_if_server_version_lt("7.9.0") def test_hsetex_exp...
0
assert
numeric_literal
tests/test_hash.py
test_hsetex_expiration_pxat_and_fnx
532
null
redis/redis-py
import time import pytest from redis.client import Redis from redis.exceptions import LockError, LockNotOwnedError from redis.lock import Lock from .conftest import _get_client class TestLock: def r_decoded(self, request): return _get_client(Redis, request=request, decode_responses=True) def get_lo...
None
assert
none_literal
tests/test_lock.py
test_lock
TestLock
26
null
redis/redis-py
import json import random import numpy as np import pytest import redis from redis.commands.vectorset.commands import QuantizationOptions from .conftest import ( _get_client, skip_if_server_version_lt, ) def d_client(request): r = _get_client(redis.Redis, request, decode_responses=True) r.flushdb() ...
1
assert
numeric_literal
tests/test_vsets.py
test_add_elem_with_values
34
null
redis/redis-py
import asyncio import re from unittest import mock import pytest import pytest_asyncio import redis.asyncio as redis from redis.asyncio.connection import Connection, to_bool from redis.auth.token import TokenInterface from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt from .compat import a...
c2
assert
variable
tests/test_asyncio/test_connection_pool.py
test_multiple_connections
TestConnectionPool
169
null
redis/redis-py
import pytest from redis.asyncio import Redis from redis.asyncio.connection import Connection, UnixDomainSocketConnection from redis.asyncio.retry import Retry from redis.backoff import AbstractBackoff, ExponentialBackoff, NoBackoff from redis.exceptions import ConnectionError, TimeoutError class TestRetry: def s...
1 + retries
assert
complex_expr
tests/test_asyncio/test_retry.py
test_retry
TestRetry
102
null
redis/redis-py
from redis.observability.config import OTelConfig, MetricGroup, TelemetryOption class TestOTelConfigHistogramBuckets: def test_empty_buckets_list_is_allowed(self): """Test that empty bucket lists are allowed (OTel SDK will use defaults).""" config = OTelConfig(buckets_operation_duration=[]) ...
[]
assert
collection
tests/test_observability/test_config.py
test_empty_buckets_list_is_allowed
TestOTelConfigHistogramBuckets
310
null
redis/redis-py
from redis._parsers.helpers import parse_info, parse_client_list def test_parse_info_list(): info_output = """ list_one:a, list_two:a b,,c,10,1.1 """ info = parse_info(info_output) assert isinstance(info["list_one"], list) assert info["list_one"] ==
["a"]
assert
collection
tests/test_parsers/test_helpers.py
test_parse_info_list
46
null
redis/redis-py
from unittest import mock import pytest from redis import RedisClusterException import redis from tests.conftest import skip_if_server_version_lt from .compat import aclosing from .conftest import wait_for_command class TestPipeline: async def test_exec_error_in_no_transaction_pipeline(self, r): await r...
b"1"
assert
string_literal
tests/test_asyncio/test_pipeline.py
test_exec_error_in_no_transaction_pipeline
TestPipeline
357
null
redis/redis-py
from math import inf import pytest import redis.commands.bf from redis.exceptions import RedisError from .conftest import ( _get_client, assert_resp_response, is_resp2_connection, skip_ifmodversion_lt, ) def decoded_r(request, stack_url): with _get_client( redis.Redis, request, decode_res...
info["count"]
assert
complex_expr
tests/test_bloom.py
test_cms
266
null
redis/redis-py
import copy import platform import socket import sys import threading import types from errno import ECONNREFUSED from typing import Any from unittest import mock from unittest.mock import call, patch, MagicMock, Mock import pytest import redis from redis import ConnectionPool, Redis from redis._parsers import _Hiredi...
1
assert
numeric_literal
tests/test_connection.py
test_redis_from_pool
338
null
redis/redis-py
import time from unittest.mock import MagicMock import pytest import redis from redis.cache import ( CacheConfig, CacheEntry, CacheEntryStatus, CacheKey, CacheProxy, DefaultCache, EvictionPolicy, EvictionPolicyType, LRUPolicy, ) from redis.event import ( EventDispatcher, ) from...
5
assert
numeric_literal
tests/test_cache.py
test_get_max_size
TestUnitDefaultCache
1,066
null
redis/redis-py
from contextlib import closing from unittest import mock import pytest from redis import RedisClusterException import redis from redis.client import Pipeline from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsColle...
[]
assert
collection
tests/test_pipeline.py
test_empty_pipeline_does_not_record_metric
TestPipelineMetricsRecording
778
null
redis/redis-py
from contextlib import closing from unittest import mock import pytest from redis import RedisClusterException import redis from redis.client import Pipeline from redis.observability import recorder from redis.observability.config import OTelConfig, MetricGroup from redis.observability.metrics import RedisMetricsColle...
2
assert
numeric_literal
tests/test_pipeline.py
test_multiple_pipeline_executions_record_multiple_metrics
TestPipelineMetricsRecording
745
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import pytest from dedalus_labs._utils import required_args def test_positional_param() -> None: @required_args(["a"]) def foo(a: str | None = None) -> str | None: return a assert foo("a") == "a" assert foo(None) is None assert foo(a="b") ==
"b"
assert
string_literal
tests/test_required_args.py
test_positional_param
24
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
"f"
assert
string_literal
tests/lib/chat/test_completions_streaming.py
test_stream_pydantic_model
TestSyncStream
117
null
dedalus-labs/dedalus-sdk-python
import json from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone from typing_extensions import Literal, Annotated, TypeAliasType import pytest import pydantic from pydantic import Field from dedalus_labs._utils import PropertyInfo from dedalus_labs._compat i...
3
assert
numeric_literal
tests/test_models.py
test_nested_union_invalid_data
302
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
1
assert
numeric_literal
tests/lib/chat/test_completions_streaming.py
test_stream_pydantic_tool
TestSyncStream
150
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Iterator, AsyncIterator import httpx import pytest from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs._streaming import Stream, AsyncStream, ServerSentEvent @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])...
iterator)
assert_*
variable
tests/test_streaming.py
test_basic
26
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Sequence import pytest from dedalus_labs._types import FileTypes from dedalus_labs._utils import extract_files def test_removes_files_from_input() -> None: query = {"foo": "bar"} assert extract_files(query, paths=[]) ==
[]
assert
collection
tests/test_extract_files.py
test_removes_files_from_input
13
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from urllib.parse import parse_qs, urlparse import httpx import pytest from dedalus_labs._exceptions import APIError, APIStatusError, BadRequestError from dedalus_labs.lib._bug_report import generate_bug_report_url, get_bug_report_url_from_error class TestPlatformInfo: def te...
2
assert
numeric_literal
tests/test__bug_report.py
test_platform_info_format
TestPlatformInfo
152
null