repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_filesink_retention.py
test_exception_during_retention_at_rotation_not_caught
pytest.raises
complex_expr
23
import datetime import os from unittest.mock import Mock import pytest from loguru import logger from .conftest import check_dir @pytest.mark.parametrize("delay", [True, False]) def test_exception_during_retention_at_rotation_not_caught(freeze_time, tmp_path, capsys, delay): with freeze_time("2022-02-22") as fr...
Exception, match=r"Retention error")
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_opt.py
test_record_not_in_extra
assert
collection
22
import sys from unittest.mock import MagicMock import pytest from loguru import logger from .conftest import parse def test_record_not_in_extra(): extra = None def sink(message): nonlocal extra extra = message.record["extra"] logger.add(sink, catch=False) logger.opt(record=True).i...
{}
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_parse.py
test_parse_without_group
assert
collection
19
import io import pathlib import re from datetime import datetime import pytest from loguru import logger TEXT = "This\nIs\nRandom\nText\n123456789\nABC!DEF\nThis Is The End\n" def fileobj(): with io.StringIO(TEXT) as file: yield file def test_parse_without_group(fileobj): result, *_ = list(logger.p...
{}
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_exceptions_catch.py
test_decorate_generator_with_error
assert
collection
19
import asyncio import site import sys import sysconfig import types import pytest from loguru import logger def test_decorate_generator_with_error(): @logger.catch def foo(): for i in range(3): 1 / (2 - i) yield i assert list(foo()) ==
[0, 1]
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_add_option_serialize.py
test_serialize_with_record_option
assert
collection
15
import json import re import sys from loguru import logger def test_serialize_with_record_option(): sink = JsonSink() logger.add(sink, format="{message}", serialize=True, catch=False) logger.opt(record=True).info("Test", foo=123) assert sink.json["text"] == "Test\n" assert sink.dict["extra"] ==...
{"foo": 123}
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_opt.py
test_kwargs_in_extra_of_record
assert
collection
23
import sys from unittest.mock import MagicMock import pytest from loguru import logger from .conftest import parse def test_kwargs_in_extra_of_record(): message = None def sink(message_): nonlocal message message = message_ logger.add(sink, format="{message}", catch=False) logger....
{"foo": 123}
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_parse.py
test_positive_lookbehind_pattern
assert
collection
22
import io import pathlib import re from datetime import datetime import pytest from loguru import logger TEXT = "This\nIs\nRandom\nText\n123456789\nABC!DEF\nThis Is The End\n" def fileobj(): with io.StringIO(TEXT) as file: yield file def test_positive_lookbehind_pattern(): text = "ab" * 100 pat...
[dict(b="b")] * 100
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_parse.py
test_greedy_pattern
assert
collection
22
import io import pathlib import re from datetime import datetime import pytest from loguru import logger TEXT = "This\nIs\nRandom\nText\n123456789\nABC!DEF\nThis Is The End\n" def fileobj(): with io.StringIO(TEXT) as file: yield file def test_greedy_pattern(): text = ("\n" + "a" * 100) * 1000 p...
[dict(a="a" * 100)] * 1000
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_filesink_rotation.py
test_time_rotation
assert
collection
81
import datetime import os import pathlib import tempfile import time from unittest.mock import Mock import pytest import loguru from loguru import logger from loguru._ctime_functions import load_ctime_functions from .conftest import check_dir def tmp_path_local(reset_logger): # Pytest 'tmp_path' creates directo...
["a\n", "b\nc\n", "d\n", "e\n"]
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_contextualize.py
test_contextualize_thread
assert
collection
37
import asyncio import sys import threading from unittest.mock import MagicMock import pytest from loguru import logger from loguru._contextvars import load_contextvar_class def test_contextualize_thread(writer): logger.add(writer, format="{message} {extra[i]}") def task(): logger.info("Processing") ...
["Processing %d" % i for i in range(5)]
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_contextualize.py
test_contextualize_reset
assert
collection
30
import asyncio import sys import threading from unittest.mock import MagicMock import pytest from loguru import logger from loguru._contextvars import load_contextvar_class def test_contextualize_reset(): contexts = [] output = [] def sink(message): contexts.append(message.record["extra"]) ...
[{}, {"abc": "def"}, {"abc": "def"}, {}]
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_defaults.py
test_bool_positive
assert
bool_literal
10
import pytest from loguru._defaults import env @pytest.mark.parametrize("value", ["y", "1", "TRUE"]) def test_bool_positive(value, monkeypatch): key = "VALID_BOOL_POS" monkeypatch.setenv(key, value) assert env(key, bool) is
True
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_filesink_watch.py
test_file_deleted_before_rotation
assert
bool_literal
24
import os from unittest.mock import Mock import pytest from loguru import logger from .conftest import check_dir @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use") def test_file_deleted_before_rotation(tmp_path): exists = None file = tmp_path / "test.log" def rotate(_, __):...
True
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
Delgan/loguru
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
train
train
tests/test_standard_handler.py
test_exception
assert
bool_literal
24
import sys from logging import FileHandler, Formatter, Handler, NullHandler, StreamHandler import pytest from loguru import logger def test_exception(capsys): result = None class ExceptionHandler(Handler): def emit(self, record): nonlocal result result = bool(record.exc_info)...
True
7ef57c3e6d8ad7dc2bcebf6d32465d306d3f0acb
329
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_default
assert
collection
24
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultContexts: def bot(self) -> commands.InteractionBot: return commands.InteractionBot( defa...
[1]
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_decorator_override
assert
collection
25
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultContexts: def bot(self) -> commands.InteractionBot: return commands.InteractionBot( defa...
[2]
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_annotation_override
assert
collection
24
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultContexts: def bot(self) -> commands.InteractionBot: return commands.InteractionBot( defa...
[0]
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_attrs
assert
none_literal
33
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultPermissions: def test_attrs(self, meta: DecoratorMeta) -> None: kwargs = {meta.attr_key: {"default_m...
None
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_dm_permission
assert
bool_literal
28
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultContexts: def bot(self) -> commands.InteractionBot: return commands.InteractionBot( defa...
False
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_attrs
assert
func_call
34
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultPermissions: def test_attrs(self, meta: DecoratorMeta) -> None: kwargs = {meta.attr_key: {"default_m...
Permissions(32)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_attrs
assert
func_call
37
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultPermissions: def test_attrs(self, meta: DecoratorMeta) -> None: kwargs = {meta.attr_key: {"default_m...
Permissions(64)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_default
assert
func_call
25
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultContexts: def bot(self) -> commands.InteractionBot: return commands.InteractionBot( defa...
c.body.to_dict()
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_contexts_guildcommandinteraction
assert
func_call
23
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) def test_contexts_guildcommandinteraction(meta: DecoratorMeta) -> None: class Cog(commands.Cog): # this shouldn't rais...
disnake.InteractionContextTypes(guild=True)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_contexts_guildcommandinteraction
assert
func_call
24
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) def test_contexts_guildcommandinteraction(meta: DecoratorMeta) -> None: class Cog(commands.Cog): # this shouldn't rais...
disnake.ApplicationInstallTypes(guild=True)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_base_core.py
test_decorator_overwrite
pytest.raises
complex_expr
17
import warnings import pytest import disnake from disnake import Permissions from disnake.ext import commands def meta(request) -> DecoratorMeta: return DecoratorMeta(request.param) class TestDefaultPermissions: def test_decorator_overwrite(self, meta: DecoratorMeta) -> None: # putting the decorato...
ValueError, match="Cannot set `default_member_permissions`")
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_core.py
_test_typing_cls
assert_*
variable
60
from typing_extensions import assert_type from disnake.ext import commands from tests.helpers import reveal_type class TestDecorators: def _test_typing_defaults(self) -> None: base = commands.GroupMixin[None]() # no cog async def f1(ctx: CustomContext, a: int, b: str) -> bool: ... ...
CustomGroup)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_core.py
_test_typing_cls
assert_*
variable
57
from typing_extensions import assert_type from disnake.ext import commands from tests.helpers import reveal_type class TestDecorators: def _test_typing_defaults(self) -> None: base = commands.GroupMixin[None]() # no cog async def f1(ctx: CustomContext, a: int, b: str) -> bool: ... ...
CustomCommand)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_params.py
test_ellipsis
assert
numeric_literal
20
import math import sys from typing import Any, Optional, Union from unittest import mock import pytest import disnake from disnake import Member, Role, User from disnake.ext import commands OptionType = disnake.OptionType class TestBaseRange: @pytest.mark.parametrize("empty", [None, ...]) def test_ellipsis...
1
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_params.py
test_optional
assert
numeric_literal
38
import math import sys from typing import Any, Optional, Union from unittest import mock import pytest import disnake from disnake import Member, Role, User from disnake.ext import commands OptionType = disnake.OptionType class TestRangeStringParam: @pytest.mark.parametrize( "annotation_str", [...
2
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_params.py
test_ellipsis
assert
numeric_literal
26
import math import sys from typing import Any, Optional, Union from unittest import mock import pytest import disnake from disnake import Member, Role, User from disnake.ext import commands OptionType = disnake.OptionType class TestBaseRange: @pytest.mark.parametrize("empty", [None, ...]) def test_ellipsis...
-10
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_params.py
test_valid
assert
variable
19
import math import sys from typing import Any, Optional, Union from unittest import mock import pytest import disnake from disnake import Member, Role, User from disnake.ext import commands OptionType = disnake.OptionType class TestRange: def test_valid(self) -> None: x: Any = commands.Range[int, -1, 2...
int
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_params.py
test_ellipsis
assert
none_literal
21
import math import sys from typing import Any, Optional, Union from unittest import mock import pytest import disnake from disnake import Member, Role, User from disnake.ext import commands OptionType = disnake.OptionType class TestBaseRange: @pytest.mark.parametrize("empty", [None, ...]) def test_ellipsis...
None
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_parents
assert
collection
24
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
()
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_qualified_name
assert
string_literal
24
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
"a"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_parent
assert
none_literal
24
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
None
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_parent
assert
complex_expr
25
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
cog.a
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_qualified_name
assert
string_literal
25
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
"a sub"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_parents
assert
collection
25
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
(cog.a,)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_parent
assert
complex_expr
27
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
cog.group
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_qualified_name
assert
string_literal
26
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
"a group"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_qualified_name
assert
string_literal
27
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
"a group subsub"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_slash_core.py
test_parents
assert
collection
27
from disnake.ext import commands class TestParents: def _create_cog(self): class Cog(commands.Cog): @commands.slash_command() async def a(self, _) -> None: ... @a.sub_command() async def sub(self, _) -> None: ... @a.sub_command_group() ...
(cog.group, cog.a)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_view.py
test_get_quoted_word_raises
pytest.raises
variable
25
import pytest from disnake.ext.commands.errors import ( ExpectedClosingQuoteError, InvalidEndOfQuotedStringError, UnexpectedQuoteError, ) from disnake.ext.commands.view import StringView class TestStringView: @pytest.mark.parametrize( ("text", "exception"), [ ('hone"stl"y,...
exception)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/commands/test_view.py
test_get_word
assert
variable
28
import pytest from disnake.ext.commands.errors import ( ExpectedClosingQuoteError, InvalidEndOfQuotedStringError, UnexpectedQuoteError, ) from disnake.ext.commands.view import StringView class TestStringView: @pytest.mark.parametrize( ("text", "expected_word"), [ ("hello", ...
expected_word
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/tasks/test_loops.py
test_decorator
assert
numeric_literal
17
import datetime from typing import Any, Tuple import pytest from disnake.ext import commands from disnake.ext.tasks import LF, Loop, loop class TestLoops: def test_decorator(self) -> None: class Cog(commands.Cog): @loop(seconds=30, minutes=0, hours=0) async def task(self) -> None:...
30
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/tasks/test_loops.py
test_inheritance
assert
collection
43
import datetime from typing import Any, Tuple import pytest from disnake.ext import commands from disnake.ext.tasks import LF, Loop, loop class TestLoops: def test_inheritance(self) -> None: class HyperLoop(Loop[LF]): def __init__(self, coro: LF, time_tup: Tuple[float, float, float]) -> None...
(1, 2, 3)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/tasks/test_loops.py
test_mixing_time
pytest.raises
variable
16
import datetime from typing import Any, Tuple import pytest from disnake.ext import commands from disnake.ext.tasks import LF, Loop, loop class TestLoops: def test_mixing_time(self) -> None: async def callback() -> None: pass with pytest.raises(
TypeError)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/tasks/test_loops.py
test_inheritance
pytest.raises
complex_expr
45
import datetime from typing import Any, Tuple import pytest from disnake.ext import commands from disnake.ext.tasks import LF, Loop, loop class TestLoops: def test_inheritance(self) -> None: class HyperLoop(Loop[LF]): def __init__(self, coro: LF, time_tup: Tuple[float, float, float]) -> None...
TypeError, match="subclass of Loop")
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/ext/tasks/test_loops.py
test_decorator
pytest.raises
complex_expr
19
import datetime from typing import Any, Tuple import pytest from disnake.ext import commands from disnake.ext.tasks import LF, Loop, loop class TestLoops: def test_decorator(self) -> None: class Cog(commands.Cog): @loop(seconds=30, minutes=0, hours=0) async def task(self) -> None:...
TypeError, match="must be a coroutine")
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/interactions/test_base.py
test_init_member
assert
numeric_literal
49
from __future__ import annotations from typing import TYPE_CHECKING from unittest import mock import pytest import disnake from disnake import Interaction, InteractionResponseType as ResponseType # shortcut from disnake.state import ConnectionState from disnake.utils import MISSING class TestInteractionDataResolve...
0
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/interactions/test_base.py
test_init_member
assert
numeric_literal
50
from __future__ import annotations from typing import TYPE_CHECKING from unittest import mock import pytest import disnake from disnake import Interaction, InteractionResponseType as ResponseType # shortcut from disnake.state import ConnectionState from disnake.utils import MISSING class TestInteractionDataResolve...
1
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/interactions/test_base.py
test_defer
assert_*
complex_expr
84
from __future__ import annotations from typing import TYPE_CHECKING from unittest import mock import pytest import disnake from disnake import Interaction, InteractionResponseType as ResponseType # shortcut from disnake.state import ConnectionState from disnake.utils import MISSING class TestInteractionResponse: ...
response._parent.token)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/interactions/test_base.py
test_channel
assert
func_call
54
from __future__ import annotations from typing import TYPE_CHECKING from unittest import mock import pytest import disnake from disnake import Interaction, InteractionResponseType as ResponseType # shortcut from disnake.state import ConnectionState from disnake.utils import MISSING class TestInteractionDataResolve...
channel_type in (14, 99)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/interactions/test_base.py
test_defer_invalid_parent
pytest.raises
complex_expr
31
from __future__ import annotations from typing import TYPE_CHECKING from unittest import mock import pytest import disnake from disnake import Interaction, InteractionResponseType as ResponseType # shortcut from disnake.state import ConnectionState from disnake.utils import MISSING class TestInteractionResponse: ...
TypeError, match="This interaction must be of type")
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_abc.py
test_all
assert_*
numeric_literal
57
from typing import cast from unittest import mock import pytest import disnake from disnake.abc import GuildChannel from disnake.utils import MISSING class TestGuildChannelEdit: def channel(self) -> mock.Mock: ch = mock.Mock(GuildChannel, id=123, category_id=456) ch._state = mock.Mock(http=mock....
10)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_abc.py
test_move_only
assert_*
numeric_literal
31
from typing import cast from unittest import mock import pytest import disnake from disnake.abc import GuildChannel from disnake.utils import MISSING class TestGuildChannelEdit: def channel(self) -> mock.Mock: ch = mock.Mock(GuildChannel, id=123, category_id=456) ch._state = mock.Mock(http=mock....
42)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_abc.py
test_none
assert
none_literal
26
from typing import cast from unittest import mock import pytest import disnake from disnake.abc import GuildChannel from disnake.utils import MISSING class TestGuildChannelEdit: def channel(self) -> mock.Mock: ch = mock.Mock(GuildChannel, id=123, category_id=456) ch._state = mock.Mock(http=mock....
None
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_abc.py
test_all
assert_*
complex_expr
60
from typing import cast from unittest import mock import pytest import disnake from disnake.abc import GuildChannel from disnake.utils import MISSING class TestGuildChannelEdit: def channel(self) -> mock.Mock: ch = mock.Mock(GuildChannel, id=123, category_id=456) ch._state = mock.Mock(http=mock....
channel.id)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_abc.py
test_sync_permissions
assert_*
complex_expr
29
from typing import cast from unittest import mock import pytest import disnake from disnake.abc import GuildChannel from disnake.utils import MISSING class TestGuildChannelEdit: def channel(self) -> mock.Mock: ch = mock.Mock(GuildChannel, id=123, category_id=456) ch._state = mock.Mock(http=mock....
channel.category_id)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_abc.py
test_all
assert
complex_expr
55
from typing import cast from unittest import mock import pytest import disnake from disnake.abc import GuildChannel from disnake.utils import MISSING class TestGuildChannelEdit: def channel(self) -> mock.Mock: ch = mock.Mock(GuildChannel, id=123, category_id=456) ch._state = mock.Mock(http=mock....
channel._state.http.edit_channel.return_value
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_activity.py
test_none
assert
none_literal
28
from typing import TYPE_CHECKING import pytest from disnake import activity as _activity def activity() -> _activity.Activity: return _activity.Activity() def game() -> _activity.Game: return _activity.Game(name="Celeste") def custom_activity() -> _activity.CustomActivity: return _activity.CustomActivi...
None
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_activity.py
test_text
assert
string_literal
34
from typing import TYPE_CHECKING import pytest from disnake import activity as _activity def activity() -> _activity.Activity: return _activity.Activity() def game() -> _activity.Game: return _activity.Game(name="Celeste") def custom_activity() -> _activity.CustomActivity: return _activity.CustomActivi...
"hi"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_activity.py
test_text
assert
string_literal
35
from typing import TYPE_CHECKING import pytest from disnake import activity as _activity def activity() -> _activity.Activity: return _activity.Activity() def game() -> _activity.Game: return _activity.Game(name="Celeste") def custom_activity() -> _activity.CustomActivity: return _activity.CustomActivi...
"hello"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_activity.py
test_mp
assert
string_literal
35
from typing import TYPE_CHECKING import pytest from disnake import activity as _activity def activity() -> _activity.Activity: return _activity.Activity() def game() -> _activity.Game: return _activity.Game(name="Celeste") def custom_activity() -> _activity.CustomActivity: return _activity.CustomActivi...
"https://media.discordapp.net/external/stuff/large"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_activity.py
test_mp
assert
string_literal
36
from typing import TYPE_CHECKING import pytest from disnake import activity as _activity def activity() -> _activity.Activity: return _activity.Activity() def game() -> _activity.Game: return _activity.Game(name="Celeste") def custom_activity() -> _activity.CustomActivity: return _activity.CustomActivi...
"https://media.discordapp.net/external/stuff/small"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_activity.py
test_asset_id_activity
assert
string_literal
33
from typing import TYPE_CHECKING import pytest from disnake import activity as _activity def activity() -> _activity.Activity: return _activity.Activity() def game() -> _activity.Game: return _activity.Game(name="Celeste") def custom_activity() -> _activity.CustomActivity: return _activity.CustomActivi...
"https://cdn.discordapp.com/app-assets/1010/1234.png"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_activity.py
test_asset_id_activity
assert
string_literal
34
from typing import TYPE_CHECKING import pytest from disnake import activity as _activity def activity() -> _activity.Activity: return _activity.Activity() def game() -> _activity.Game: return _activity.Game(name="Celeste") def custom_activity() -> _activity.CustomActivity: return _activity.CustomActivi...
"https://cdn.discordapp.com/app-assets/1010/5678.png"
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_colour.py
test_to_rgb
assert
variable
15
import math from typing import Tuple import pytest from disnake import Color, Colour @pytest.mark.parametrize( ("value", "parts"), [(0, (0, 0, 0)), (0xA00233, (0xA0, 0x02, 0x33)), (0x123456, (0x12, 0x34, 0x56))], ) def test_to_rgb(value: int, parts: Tuple[int, int, int]) -> None: c = Colour(value) a...
parts
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_colour.py
test_from_rgb
assert
variable
14
import math from typing import Tuple import pytest from disnake import Color, Colour @pytest.mark.parametrize( ("value", "parts"), [(0, (0, 0, 0)), (0xA00233, (0xA0, 0x02, 0x33)), (0x123456, (0x12, 0x34, 0x56))], ) def test_from_rgb(value: int, parts: Tuple[int, int, int]) -> None: assert Colour.from_rg...
value
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_colour.py
test_str
assert
variable
13
import math from typing import Tuple import pytest from disnake import Color, Colour @pytest.mark.parametrize( ("value", "string"), [(0, "#000000"), (0x123, "#000123"), (0x12AB34, "#12ab34")] ) def test_str(value: int, string: str) -> None: assert str(Colour(value)) ==
string
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_colour.py
test_alias
assert
variable
10
import math from typing import Tuple import pytest from disnake import Color, Colour def test_alias() -> None: assert Color is
Colour
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_colour.py
test_compare
assert
func_call
10
import math from typing import Tuple import pytest from disnake import Color, Colour def test_compare() -> None: assert Colour(123) ==
Colour(123)
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_colour.py
test_init
pytest.raises
complex_expr
10
import math from typing import Tuple import pytest from disnake import Color, Colour def test_init() -> None: with pytest.raises(
TypeError, match=r"Expected int parameter, received str instead.")
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_attr_proxy
assert
numeric_literal
29
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
0
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_attr_proxy
assert
numeric_literal
33
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
1
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_attr_proxy
assert
numeric_literal
39
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
2
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_init_empty
assert
collection
36
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
[]
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_len
assert
numeric_literal
27
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
20
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_len
assert
numeric_literal
30
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
23
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_len
assert
numeric_literal
33
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
30
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_len
assert
numeric_literal
37
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
69
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_image_init
assert
collection
29
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
{}
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_embeds.py
test_init_empty
assert
none_literal
28
import io from datetime import datetime, timedelta import pytest from disnake import Color, Embed, File, embeds from disnake.utils import MISSING, utcnow _BASE = {"type": "rich"} def embed() -> Embed: time = utcnow() + timedelta(days=42) return Embed( type="link", title="wow", descri...
None
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_events.py
test_wait_for
assert
numeric_literal
25
from typing import Any import pytest import disnake from disnake import Event from disnake.ext import commands def client() -> disnake.Client: return disnake.Client() def bot() -> commands.Bot: return commands.Bot( command_prefix=commands.when_mentioned, command_sync_flags=commands.CommandSy...
1
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_events.py
test_addremove_listener
assert
numeric_literal
29
from typing import Any import pytest import disnake from disnake import Event from disnake.ext import commands def client() -> disnake.Client: return disnake.Client() def bot() -> commands.Bot: return commands.Bot( command_prefix=commands.when_mentioned, command_sync_flags=commands.CommandSy...
0
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_events.py
test_event
assert
variable
28
from typing import Any import pytest import disnake from disnake import Event from disnake.ext import commands def client() -> disnake.Client: return disnake.Client() def bot() -> commands.Bot: return commands.Bot( command_prefix=commands.when_mentioned, command_sync_flags=commands.CommandSy...
on_message_edit
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_flag_creation
assert
numeric_literal
19
from __future__ import annotations import re import pytest from disnake import flags def test_flag_creation() -> None: assert TestFlags.VALID_FLAGS == { "one": 1, "two": 2, "three": 3, "four": 4, "sixteen": 16, } assert TestFlags.DEFAULT_VALUE ==
0
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_flag_value_or
assert
numeric_literal
16
from __future__ import annotations import re import pytest from disnake import flags class TestFlagValue: def test_flag_value_or(self) -> None: ins = TestFlags.four | TestFlags.one assert isinstance(ins, TestFlags) assert ins.value ==
5
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_flag_value_or
assert
numeric_literal
17
from __future__ import annotations import re import pytest from disnake import flags class TestFlagValue: def test_flag_value_or(self) -> None: ins = TestFlags.four | TestFlags.one assert isinstance(ins, TestFlags) assert ins.value == 5 assert (TestFlags.two | ins).value ==
7
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_flag_value_or
assert
numeric_literal
25
from __future__ import annotations import re import pytest from disnake import flags class TestFlagValue: def test_flag_value_or(self) -> None: ins = TestFlags.four | TestFlags.one assert isinstance(ins, TestFlags) assert ins.value == 5 assert (TestFlags.two | ins).value == 7 ...
1
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_flag_value_xor
assert
numeric_literal
19
from __future__ import annotations import re import pytest from disnake import flags class TestFlagValue: def test_flag_value_xor(self) -> None: ins = TestFlags(one=True, two=True) ins ^= TestFlags.two assert ins.value == 1 ins ^= TestFlags.three assert ins.value ==
2
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_flag_value_xor
assert
numeric_literal
21
from __future__ import annotations import re import pytest from disnake import flags class TestFlagValue: def test_flag_value_xor(self) -> None: ins = TestFlags(one=True, two=True) ins ^= TestFlags.two assert ins.value == 1 ins ^= TestFlags.three assert ins.value == 2 ...
6
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_iter
assert
numeric_literal
15
from __future__ import annotations import re import pytest from disnake import flags class TestBaseFlags: def test_iter(self) -> None: ins = TestFlags(one=True, two=False) assert len(list(iter(ins))) ==
4
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test_flag_value_or
assert
numeric_literal
21
from __future__ import annotations import re import pytest from disnake import flags class TestFlagValue: def test_flag_value_or(self) -> None: ins = TestFlags.four | TestFlags.one assert isinstance(ins, TestFlags) assert ins.value == 5 assert (TestFlags.two | ins).value == 7 ...
21
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_flags.py
test__eq__flag_value
assert
variable
17
from __future__ import annotations import re import pytest from disnake import flags class TestBaseFlags: def test__eq__flag_value(self) -> None: ins = TestFlags(one=True) other = TestFlags(one=True, two=True) assert ins == TestFlags.one assert TestFlags.one ==
ins
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_http.py
test_format_gateway_url
assert
variable
45
import pytest from disnake.http import HTTPClient @pytest.mark.parametrize( ("url", "encoding", "zlib", "expected"), [ ( "wss://gateway.discord.com", "json", False, "wss://gateway.discord.com/?v=10&encoding=json", ), ( "wss://...
expected
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_mentions.py
test_classmethod_all
assert
bool_literal
11
from typing import Dict, Union from unittest import mock import pytest from disnake import AllowedMentions, Message, MessageType, Object def test_classmethod_all() -> None: all_mentions = AllowedMentions.all() assert all_mentions.everyone is
True
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_mentions.py
test_classmethod_none
assert
bool_literal
11
from typing import Dict, Union from unittest import mock import pytest from disnake import AllowedMentions, Message, MessageType, Object def test_classmethod_none() -> None: none = AllowedMentions.none() assert none.everyone is
False
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_mentions.py
test_from_message
assert
variable
23
from typing import Dict, Union from unittest import mock import pytest from disnake import AllowedMentions, Message, MessageType, Object def test_from_message() -> None: # as we don't have a message mock yet we are faking a message here with the necessary components msg = mock.NonCallableMock() msg.menti...
users
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor
DisnakeDev/disnake
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
train
train
tests/test_mentions.py
test_from_message
assert
variable
26
from typing import Dict, Union from unittest import mock import pytest from disnake import AllowedMentions, Message, MessageType, Object def test_from_message() -> None: # as we don't have a message mock yet we are faking a message here with the necessary components msg = mock.NonCallableMock() msg.menti...
roles
b990afcf994276ce10320c1f5ce381ad33b7a9f3
77
v2_extractor_at_anchor