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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/inputs/test_option.py | test_optional_value_with_default | assert | string_literal | 17 | from __future__ import annotations
import pytest
from cleo.exceptions import LogicException
from cleo.exceptions import ValueException
from cleo.io.inputs.option import Option
def test_optional_value_with_default() -> None:
opt = Option("option", flag=False, requires_value=False, default="Default")
assert n... | "Default" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/inputs/test_option.py | test_multiple_shortcuts | assert | string_literal | 13 | from __future__ import annotations
import pytest
from cleo.exceptions import LogicException
from cleo.exceptions import ValueException
from cleo.io.inputs.option import Option
def test_multiple_shortcuts() -> None:
opt = Option("option", "-o|oo|-ooo")
assert opt.shortcut == | "o|oo|ooo" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/inputs/test_option.py | test_list | assert | complex_expr | 17 | from __future__ import annotations
import pytest
from cleo.exceptions import LogicException
from cleo.exceptions import ValueException
from cleo.io.inputs.option import Option
def test_list() -> None:
opt = Option("option", flag=False, is_list=True)
assert not opt.is_flag()
assert opt.accepts_value()
... | opt.default | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/inputs/test_option.py | test_fail_if_name_is_empty | pytest.raises | variable | 11 | from __future__ import annotations
import pytest
from cleo.exceptions import LogicException
from cleo.exceptions import ValueException
from cleo.io.inputs.option import Option
def test_fail_if_name_is_empty() -> None:
with pytest.raises( | ValueException) | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/inputs/test_option.py | test_fail_if_default_value_provided_for_flag | pytest.raises | variable | 11 | from __future__ import annotations
import pytest
from cleo.exceptions import LogicException
from cleo.exceptions import ValueException
from cleo.io.inputs.option import Option
def test_fail_if_default_value_provided_for_flag() -> None:
with pytest.raises( | LogicException) | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/inputs/test_token_parser.py | test_create | assert | variable | 44 | from __future__ import annotations
import pytest
from cleo.io.inputs.token_parser import TokenParser
@pytest.mark.parametrize(
"string, tokens",
[
("", []),
("foo", ["foo"]),
(" foo bar ", ["foo", "bar"]),
('"quoted"', ["quoted"]),
("'quoted'", ["quoted"]),
... | tokens | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_add_multiple_sections | assert | numeric_literal | 25 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | 2 | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_clear_all | assert | string_literal | 28 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | "Foo\nBar\n\x1b[2A\x1b[0J" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_overwrite | assert | string_literal | 28 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | "Foo\n\x1b[1A\x1b[0JBar\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_overwrite_multiple_lines | assert | string_literal | 28 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | "Foo\nBar\nBaz\n\x1b[3A\x1b[0JBar\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_clear_with_number_of_lines | assert | string_literal | 28 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | "Foo\nBar\nBaz\nFooBar\n\x1b[2A\x1b[0J" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_clear_preserves_empty_lines | assert | string_literal | 31 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | "\nFoo\n\x1b[1A\x1b[0J\x1b[1A\x1b[0JBar\n\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_clear_with_number_of_lines_and_multiple_sections | assert | string_literal | 32 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | "Foo\nBar\n\x1b[1A\x1b[0J\x1b[1A\x1b[0JBaz\nFoo\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/io/outputs/test_section_output.py | test_multiple_sections_output | assert | string_literal | 33 | from __future__ import annotations
from io import StringIO
import pytest
from cleo.io.outputs.section_output import SectionOutput
def stream() -> StringIO:
return StringIO()
def sections() -> list[SectionOutput]:
return []
def output(stream: StringIO, sections: list[SectionOutput]) -> SectionOutput:
r... | "Foo\nBar\n\x1b[2A\x1b[0JBar\n\x1b[1A\x1b[0JBaz\nBar\n\x1b[1A\x1b[0JFoobar\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/loaders/test_factory_command_loader.py | test_names | assert | collection | 21 | from __future__ import annotations
import pytest
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.loaders.factory_command_loader import FactoryCommandLoader
def command(name: str) -> Command:
command_ = Command()
command_.name = name
return command... | ["foo", "bar"] | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/loaders/test_factory_command_loader.py | test_get_invalid_command_raises_error | pytest.raises | variable | 21 | from __future__ import annotations
import pytest
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.loaders.factory_command_loader import FactoryCommandLoader
def command(name: str) -> Command:
command_ = Command()
command_.name = name
return command... | CommandNotFoundException) | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_all | assert | numeric_literal | 43 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | 1 | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_run_with_input | assert | numeric_literal | 44 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | 0 | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_silent_help | assert | string_literal | 42 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | "" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_has_get | assert | variable | 45 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | foo | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_name_version_getters | assert | string_literal | 39 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | "foo" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_name_version_getters | assert | string_literal | 40 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | "Foo" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_name_version_getters | assert | string_literal | 41 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | "bar" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_name_version_setter | assert | string_literal | 43 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | "Bar" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_name_version_setter | assert | string_literal | 48 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | "Baz" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_application.py | test_add | assert | collection | 41 | from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.exceptions import CommandNotFoundException
from cleo.exceptions import NamespaceNotFoundException
from cleo.io.io import IO
from... | [foo] | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_color.py | test_ansi_colors | assert | variable | 23 | from __future__ import annotations
import os
import pytest
from cleo.color import Color
@pytest.mark.parametrize(
["foreground", "background", "options", "expected"],
[
("", "", [], " "),
("red", "yellow", [], "\033[31;43m \033[39;49m"),
("red", "yellow", ["underline"], "\033[31;43;4... | expected | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_helpers.py | test_option | assert | collection | 37 | from __future__ import annotations
from cleo.helpers import argument
from cleo.helpers import option
def test_option() -> None:
opt = option("foo", "f", "Foo")
assert opt.description == "Foo"
assert not opt.accepts_value()
assert not opt.requires_value()
assert not opt.is_list()
assert opt.de... | [] | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_helpers.py | test_argument | assert | none_literal | 13 | from __future__ import annotations
from cleo.helpers import argument
from cleo.helpers import option
def test_argument() -> None:
arg = argument("foo", "Foo")
assert arg.description == "Foo"
assert arg.is_required()
assert not arg.is_list()
assert arg.default is | None | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_helpers.py | test_argument | assert | string_literal | 10 | from __future__ import annotations
from cleo.helpers import argument
from cleo.helpers import option
def test_argument() -> None:
arg = argument("foo", "Foo")
assert arg.description == | "Foo" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_helpers.py | test_argument | assert | string_literal | 19 | from __future__ import annotations
from cleo.helpers import argument
from cleo.helpers import option
def test_argument() -> None:
arg = argument("foo", "Foo")
assert arg.description == "Foo"
assert arg.is_required()
assert not arg.is_list()
assert arg.default is None
arg = argument("foo", "F... | "bar" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_helpers.py | test_option | assert | bool_literal | 14 | from __future__ import annotations
from cleo.helpers import argument
from cleo.helpers import option
def test_option() -> None:
opt = option("foo", "f", "Foo")
assert opt.description == "Foo"
assert not opt.accepts_value()
assert not opt.requires_value()
assert not opt.is_list()
assert opt.d... | False | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_helpers.py | test_argument | assert | complex_expr | 25 | from __future__ import annotations
from cleo.helpers import argument
from cleo.helpers import option
def test_argument() -> None:
arg = argument("foo", "Foo")
assert arg.description == "Foo"
assert arg.is_required()
assert not arg.is_list()
assert arg.default is None
arg = argument("foo", "F... | arg.default | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/test_utils.py | test_format_time | assert | variable | 26 | from __future__ import annotations
import pytest
from cleo._utils import find_similar_names
from cleo._utils import format_time
@pytest.mark.parametrize(
["input_secs", "expected"],
[
(0.1, "< 1 sec"),
(1.0, "1 sec"),
(2.0, "2 secs"),
(59.0, "59 secs"),
(60.0, "1 min")... | expected | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/testers/test_application_tester.py | test_execute | assert | numeric_literal | 23 | from __future__ import annotations
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.helpers import argument
from cleo.helpers import option
from cleo.testers.application_tester import ApplicationTester
def app() -> Application:
app = Application()
app... | 0 | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/testers/test_application_tester.py | test_execute | assert | string_literal | 25 | from __future__ import annotations
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.helpers import argument
from cleo.helpers import option
from cleo.testers.application_tester import ApplicationTester
def app() -> Application:
app = Application()
app... | "baz\n--bar activated\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/testers/test_application_tester.py | test_execute_namespace_command | assert | string_literal | 26 | from __future__ import annotations
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.helpers import argument
from cleo.helpers import option
from cleo.testers.application_tester import ApplicationTester
def app() -> Application:
app = Application()
app... | "baz\n--baz activated\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/testers/test_command_tester.py | test_execute | assert | numeric_literal | 15 | from __future__ import annotations
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.helpers import argument
from cleo.testers.command_tester import CommandTester
def tester() -> CommandTester:
return CommandTester(FooCommand())
def test_execute(tester: C... | 0 | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/testers/test_command_tester.py | test_execute | assert | string_literal | 17 | from __future__ import annotations
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.helpers import argument
from cleo.testers.command_tester import CommandTester
def tester() -> CommandTester:
return CommandTester(FooCommand())
def test_execute(tester: C... | "bar\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/testers/test_command_tester.py | test_execute_namespace_command | assert | string_literal | 21 | from __future__ import annotations
import pytest
from cleo.application import Application
from cleo.commands.command import Command
from cleo.helpers import argument
from cleo.testers.command_tester import CommandTester
def tester() -> CommandTester:
return CommandTester(FooCommand())
def test_execute_namespace... | "foo bar called\n" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_choice_question.py | test_ask_choice | assert | none_literal | 51 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from cleo.exceptions import ValueException
from cleo.ui.choice_question import ChoiceQuestion
def test_ask_choice(io: BufferedIO) -> None:
io.set_user_input(
"\n"
"1\n"
" 1 \n"
"John\n"
"1... | None | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_choice_question.py | test_ask_choice | assert | string_literal | 40 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from cleo.exceptions import ValueException
from cleo.ui.choice_question import ChoiceQuestion
def test_ask_choice(io: BufferedIO) -> None:
io.set_user_input(
"\n"
"1\n"
" 1 \n"
"John\n"
"1... | "Batman" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_choice_question.py | test_ask_choice | assert | collection | 65 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from cleo.exceptions import ValueException
from cleo.ui.choice_question import ChoiceQuestion
def test_ask_choice(io: BufferedIO) -> None:
io.set_user_input(
"\n"
"1\n"
" 1 \n"
"John\n"
"1... | ["Batman"] | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_confirmation_question.py | test_ask | assert | variable | 24 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from cleo.ui.confirmation_question import ConfirmationQuestion
@pytest.mark.parametrize(
("input", "expected", "default"),
[
("", True, True),
("", False, False),
("y", True, True),
("yes", True... | expected | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_exception_trace.py | test_render_debug_better_error_message_recursion_error | assert | none_literal | 56 | from __future__ import annotations
import re
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.outputs.output import Verbosity
from cleo.ui.exception_trace import ExceptionTrace
from tests.fixtures.exceptions import nested1
from tests.fixtures.exceptions import nested2
from tests.fixtures.excepti... | None | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_exception_trace.py | test_render_debug_better_error_message | assert | variable | 50 | from __future__ import annotations
import re
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.outputs.output import Verbosity
from cleo.ui.exception_trace import ExceptionTrace
from tests.fixtures.exceptions import nested1
from tests.fixtures.exceptions import nested2
from tests.fixtures.excepti... | expected | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_exception_trace.py | test_render_can_ignore_given_files | pytest.raises | variable | 21 | from __future__ import annotations
import re
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.outputs.output import Verbosity
from cleo.ui.exception_trace import ExceptionTrace
from tests.fixtures.exceptions import nested1
from tests.fixtures.exceptions import nested2
from tests.fixtures.excepti... | Exception) | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_exception_trace.py | test_render_debug_better_error_message_recursion_error_with_multiple_duplicated_frames | pytest.raises | variable | 27 | from __future__ import annotations
import re
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.outputs.output import Verbosity
from cleo.ui.exception_trace import ExceptionTrace
from tests.fixtures.exceptions import nested1
from tests.fixtures.exceptions import nested2
from tests.fixtures.excepti... | RecursionError) | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_exception_trace.py | test_render_better_error_message | assert | func_call | 38 | from __future__ import annotations
import re
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.outputs.output import Verbosity
from cleo.ui.exception_trace import ExceptionTrace
from tests.fixtures.exceptions import nested1
from tests.fixtures.exceptions import nested2
from tests.fixtures.excepti... | io.fetch_output() | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_exception_trace.py | test_render_supports_solutions | pytest.raises | complex_expr | 24 | from __future__ import annotations
import re
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.outputs.output import Verbosity
from cleo.ui.exception_trace import ExceptionTrace
from tests.fixtures.exceptions import nested1
from tests.fixtures.exceptions import nested2
from tests.fixtures.excepti... | solution.CustomError) | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_progress_bar.py | test_display_with_quiet_verbosity | assert | string_literal | 39 | from __future__ import annotations
import time
from typing import TYPE_CHECKING
import pytest
from cleo.io.outputs.output import Verbosity
from cleo.ui.progress_bar import ProgressBar
def bar(io: BufferedIO) -> ProgressBar:
return ProgressBar(io, min_seconds_between_redraws=0)
def ansi_bar(ansi_io: BufferedIO... | "" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_progress_bar.py | test_display_without_start | assert | variable | 40 | from __future__ import annotations
import time
from typing import TYPE_CHECKING
import pytest
from cleo.io.outputs.output import Verbosity
from cleo.ui.progress_bar import ProgressBar
def bar(io: BufferedIO) -> ProgressBar:
return ProgressBar(io, min_seconds_between_redraws=0)
def ansi_bar(ansi_io: BufferedIO... | expected | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_progress_bar.py | test_non_decorated_output | assert | func_call | 59 | from __future__ import annotations
import time
from typing import TYPE_CHECKING
import pytest
from cleo.io.outputs.output import Verbosity
from cleo.ui.progress_bar import ProgressBar
def bar(io: BufferedIO) -> ProgressBar:
return ProgressBar(io, min_seconds_between_redraws=0)
def ansi_bar(ansi_io: BufferedIO... | io.fetch_error() | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_progress_bar.py | test_multiple_start | assert | func_call | 47 | from __future__ import annotations
import time
from typing import TYPE_CHECKING
import pytest
from cleo.io.outputs.output import Verbosity
from cleo.ui.progress_bar import ProgressBar
def bar(io: BufferedIO) -> ProgressBar:
return ProgressBar(io, min_seconds_between_redraws=0)
def ansi_bar(ansi_io: BufferedIO... | ansi_io.fetch_error() | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_progress_indicator.py | test_default_indicator | assert | func_call | 64 | from __future__ import annotations
import time
from typing import TYPE_CHECKING
from cleo.ui.progress_indicator import ProgressIndicator
def test_default_indicator(ansi_io: BufferedIO) -> None:
bar = ProgressIndicator(ansi_io)
bar.start("Starting...")
time.sleep(0.101)
bar.advance()
time.sleep(0... | ansi_io.fetch_error() | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask | assert | string_literal | 23 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "2PM" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask | assert | string_literal | 27 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "8AM" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask_and_validate | assert | variable | 41 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | error | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask_question_with_special_characters | assert | string_literal | 23 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "2PMë" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask_and_validate | assert | string_literal | 33 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "white" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask_and_validate | assert | string_literal | 34 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "black" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_no_interaction | assert | string_literal | 23 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "not yet" | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask_and_validate | pytest.raises | variable | 38 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | Exception) | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask | assert | string_literal | 28 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "What time is it? " | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_question.py | test_ask_question_with_special_characters | assert | string_literal | 24 | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
import pytest
from cleo.ui.question import Question
def has_tty_available() -> bool:
with open(os.devnull, "w") as devnull:
exit_code = subprocess.call(["stty", "2"], stdout=devnull, stderr=devnull)
ret... | "What time is it, Sébastien? " | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_table.py | test_style_for_side_effects | assert | variable | 45 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from cleo.ui.table import Table
from cleo.ui.table_cell import TableCell
from cleo.ui.table_separator import TableSeparator
from cleo.ui.table_style import TableStyle
books = [
["99921-58-10-7", "Divine Comedy", "Dante Alighieri"]... | output2 | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/cleo | e7687e99288f013400293236b113a1010d9a57ee | 99 | train | train | tests/ui/test_table.py | test_render | assert | variable | 423 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from cleo.ui.table import Table
from cleo.ui.table_cell import TableCell
from cleo.ui.table_separator import TableSeparator
from cleo.ui.table_style import TableStyle
books = [
["99921-58-10-7", "Divine Comedy", "Dante Alighieri"]... | expected | e7687e99288f013400293236b113a1010d9a57ee | 99 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/generic/test_constraint.py | test_difference | assert | variable | 18 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.generic import AnyConstraint
from poetry.core.constraints.generic import Constraint
from poetry.core.constraints.generic import EmptyConstraint
from poetry.core.constraints.generic import MultiConstraint
fr... | c | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version.py | test_union | assert | variable | 17 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.version.exceptions import InvalidVersion
from poe... | v | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version_range.py | test_intersect | assert | variable | 85 | from __future__ import annotations
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.constraints.version import parse_constraint
def v003() -> Version:
return Vers... | a | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/test_markers.py | test_union_should_drop_markers_if_their_complement_is_present | assert | variable | 45 | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.generic import UnionConstraint
from poetry.core.constraints.generic import parse_constraint as parse_generic_constraint
from poetry.core.constraints.version import parse_constraint as parse_versi... | m | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/masonry/builders/test_sdist.py | test_default_with_excluded_data | assert | variable | 77 | from __future__ import annotations
import ast
import gzip
import hashlib
import shutil
import tarfile
from email.parser import Parser
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Iterator
import pytest
from packaging.utils import canonicalize_name
from poetry.... | ns | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_package.py | test_package_equality_source_type | assert | variable | 40 | from __future__ import annotations
import random
from pathlib import Path
from typing import TYPE_CHECKING
from typing import cast
import pytest
from poetry.core.constraints.version import Version
from poetry.core.constraints.version.exceptions import ParseConstraintError
from poetry.core.factory import Factory
fro... | a1 | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/test_markers.py | test_single_marker_normalisation | assert | variable | 31 | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.generic import UnionConstraint
from poetry.core.constraints.generic import parse_constraint as parse_generic_constraint
from poetry.core.constraints.version import parse_constraint as parse_versi... | m2 | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version.py | test_parse_valid | assert | variable | 39 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.version.exceptions import InvalidVersion
from poe... | text | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version_range.py | test_intersect | assert | variable | 79 | from __future__ import annotations
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.constraints.version import parse_constraint
def v003() -> Version:
return Vers... | v124 | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version_range.py | test_intersect | assert | variable | 84 | from __future__ import annotations
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.constraints.version import parse_constraint
def v003() -> Version:
return Vers... | open | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version_range.py | test_intersect | assert | variable | 88 | from __future__ import annotations
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.constraints.version import parse_constraint
def v003() -> Version:
return Vers... | v123 | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_directory_dependency.py | _test_directory_dependency_pep_508 | assert | variable | 25 | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from typing import cast
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.directory_dependency import DirectoryDependency
DIST_PATH = Path(__file__).parent.parent / "fixtures" / ... | name | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_directory_dependency.py | _test_directory_dependency_pep_508 | assert | variable | 26 | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from typing import cast
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.directory_dependency import DirectoryDependency
DIST_PATH = Path(__file__).parent.parent / "fixtures" / ... | path | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_file_dependency.py | _test_file_dependency_pep_508 | assert | variable | 36 | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from typing import cast
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.file_dependency import FileDependency
from poetry.core.version.markers import SingleMarker
DIST_PATH = P... | name | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_file_dependency.py | _test_file_dependency_pep_508 | assert | variable | 37 | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from typing import cast
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.file_dependency import FileDependency
from poetry.core.version.markers import SingleMarker
DIST_PATH = P... | path | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_main.py | test_dependency_from_pep_508 | assert | variable | 16 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import cast
import pytest
from poetry.core.constraints.version import Version
from poetry.core.packages.dependency import Dependency
def test_dependency_from_pep_508() -> None:
name = "requests"
dep = Dependency.create_from_pep_... | name | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/pyproject/test_pyproject_toml.py | test_pyproject_toml_simple | assert | variable | 17 | from __future__ import annotations
from pathlib import Path
import pytest
from poetry.core.pyproject.exceptions import PyProjectException
from poetry.core.pyproject.toml import PyProjectTOML
from poetry.core.utils._compat import tomllib
def test_pyproject_toml_simple(
pyproject_toml: Path, build_system_section:... | data | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/test_requirements.py | test_requirement | assert_* | variable | 128 | from __future__ import annotations
import re
from typing import Any
import pytest
from poetry.core.constraints.version import parse_constraint
from poetry.core.version.requirements import InvalidRequirement
from poetry.core.version.requirements import Requirement
def assert_requirement(
req: Requirement,
n... | req) | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version.py | test_union | assert | variable | 25 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.version.exceptions import InvalidVersion
from poe... | range | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_version_range.py | test_union | assert | variable | 70 | from __future__ import annotations
import pytest
from poetry.core.constraints.version import EmptyConstraint
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionRange
from poetry.core.constraints.version import parse_constraint
def v003() -> Version:
return Vers... | range | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/masonry/builders/test_complete.py | test_package_with_include | assert | variable | 74 | from __future__ import annotations
import csv
import os
import platform
import re
import shutil
import sys
import tarfile
import tempfile
import zipfile
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Iterator
import pytest
from poetry.core import __version__
from poetry.core.factory im... | names | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/masonry/builders/test_sdist.py | test_default_with_excluded_data | assert | variable | 95 | from __future__ import annotations
import ast
import gzip
import hashlib
import shutil
import tarfile
from email.parser import Parser
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Iterator
import pytest
from packaging.utils import canonicalize_name
from poetry.... | names | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/masonry/builders/test_sdist.py | test_setup_py_context | assert | variable | 57 | from __future__ import annotations
import ast
import gzip
import hashlib
import shutil
import tarfile
from email.parser import Parser
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Iterator
import pytest
from packaging.utils import canonicalize_name
from poetry.... | setup | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/masonry/builders/test_wheel.py | test_default_src_with_excluded_data | assert | variable | 89 | from __future__ import annotations
import importlib.machinery
import os
import re
import shutil
import zipfile
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Iterator
from typing import TextIO
import pytest
from poetry.core.factory import Factory
from poetry.core... | names | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_specification.py | test_equal_specifications_have_same_hash | assert | variable | 41 | from __future__ import annotations
import pytest
from poetry.core.packages.specification import PackageSpecification
@pytest.mark.parametrize(
"spec1, spec2",
[
(
# nothing except for name and features matters if no source
PackageSpecification("a", None, "url1", "ref1", "resre... | spec2 | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/packages/test_specification.py | test_equal_specifications_have_same_hash | assert | variable | 42 | from __future__ import annotations
import pytest
from poetry.core.packages.specification import PackageSpecification
@pytest.mark.parametrize(
"spec1, spec2",
[
(
# nothing except for name and features matters if no source
PackageSpecification("a", None, "url1", "ref1", "resre... | spec1 | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/pep440/test_segments.py | test_release_from_parts_to_parts | assert | variable | 22 | from __future__ import annotations
import pytest
from poetry.core.version.pep440 import Release
from poetry.core.version.pep440 import ReleaseTag
from poetry.core.version.pep440.segments import RELEASE_PHASE_NORMALIZATIONS
@pytest.mark.parametrize(
"parts,result",
[
((1,), Release(1)),
((1, 2... | parts | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/pep440/test_version.py | test_properties | assert | variable | 33 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.version.exceptions import InvalidVersion
from poetry.core.version.pep440 import PEP440Version
from poetry.core.version.pep440 import Release
from poetry.core.version.pep440 import ReleaseTag
@pytest.mark.parametrize(
... | major | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/pep440/test_version.py | test_properties | assert | variable | 34 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.version.exceptions import InvalidVersion
from poetry.core.version.pep440 import PEP440Version
from poetry.core.version.pep440 import Release
from poetry.core.version.pep440 import ReleaseTag
@pytest.mark.parametrize(
... | minor | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/pep440/test_version.py | test_properties | assert | variable | 35 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.version.exceptions import InvalidVersion
from poetry.core.version.pep440 import PEP440Version
from poetry.core.version.pep440 import Release
from poetry.core.version.pep440 import ReleaseTag
@pytest.mark.parametrize(
... | patch | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/pep440/test_version.py | test_properties | assert | variable | 37 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.version.exceptions import InvalidVersion
from poetry.core.version.pep440 import PEP440Version
from poetry.core.version.pep440 import Release
from poetry.core.version.pep440 import ReleaseTag
@pytest.mark.parametrize(
... | parts | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/version/test_markers.py | test_union_of_a_single_marker_is_the_single_marker | assert | variable | 31 | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.generic import UnionConstraint
from poetry.core.constraints.generic import parse_constraint as parse_generic_constraint
from poetry.core.constraints.version import parse_constraint as parse_versi... | union | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
python-poetry/poetry-core | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | train | train | tests/constraints/version/test_parse_constraint.py | test_parse_constraint_multi_with_epochs | assert | variable | 39 | from __future__ import annotations
import pytest
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import VersionConstraint
from poetry.core.constraints.version import VersionRange
from poetry.core.constraints.version import VersionUnion
from poetry.core.constraints.version impo... | output | 4eb24d9fe5eb6d8861c5ffd14f88328409587d3c | 352 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.