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
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poe_config.py
test_setting_default_task_type
assert
string_literal
13
poetry_vars = {"POETRY_VIRTUALENVS_CREATE": "false"} def test_setting_default_task_type(run_poe_subproc, projects, esc_prefix): # Also tests passing of extra_args to sys.argv result = run_poe_subproc( "echo-args", "nat,", r"welcome to " + esc_prefix + "${POE_ROOT}", project="scr...
f"Poe => echo-args nat, 'welcome to {projects['scripts']}'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poe_config.py
test_setting_default_array_item_task_type
assert
string_literal
8
poetry_vars = {"POETRY_VIRTUALENVS_CREATE": "false"} def test_setting_default_array_item_task_type(run_poe_subproc): result = run_poe_subproc( "composite_task", project="scripts", env={"POETRY_VIRTUALENVS_CREATE": "false"} ) assert (
"Poe => poe_test_echo Hello\nPoe => poe_test_echo 'World!'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poe_tasks_file.py
test_prefer_valid_pyproject
assert
string_literal
16
def test_prefer_valid_pyproject(run_poe_subproc, projects): # and import the poe_tasks from elsewhere result = run_poe_subproc(project="poe_tasks_file") assert ( "Configured tasks:\n" " main_pyproject \n" " main_poetasks_toml \n" " sub1_poetasks_toml \n" ...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poe_tasks_file.py
test_prefer_valid_pyproject
assert
complex_expr
5
def test_prefer_valid_pyproject(run_poe_subproc, projects): # and import the poe_tasks from elsewhere result = run_poe_subproc(project="poe_tasks_file") asser
result.capture
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poetry_plugin_v1.py
test_poetry_help
assert
complex_expr
26
import os import re import pytest def _setup_poetry_project(run_poetry_1, projects): run_poetry_1(["install"], cwd=projects["poetry_plugin"]) def _setup_poetry_project_empty_prefix(run_poetry_1, projects): run_poetry_1( ["install"], cwd=projects["poetry_plugin/empty_prefix"].parent, ) de...
result.stdout
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poetry_plugin_v1.py
test_task_with_lib_dependency
assert
string_literal
30
import os import re import pytest def _setup_poetry_project(run_poetry_1, projects): run_poetry_1(["install"], cwd=projects["poetry_plugin"]) def _setup_poetry_project_empty_prefix(run_poetry_1, projects): run_poetry_1( ["install"], cwd=projects["poetry_plugin/empty_prefix"].parent, ) de...
"Poe => from cowpy import cow; print(list(cow.COWACTERS)[5])\ncheese\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poetry_plugin_v1.py
test_task_accepts_any_args
assert
string_literal
29
import os import re import pytest def _setup_poetry_project(run_poetry_1, projects): run_poetry_1(["install"], cwd=projects["poetry_plugin"]) def _setup_poetry_project_empty_prefix(run_poetry_1, projects): run_poetry_1( ["install"], cwd=projects["poetry_plugin/empty_prefix"].parent, ) de...
"Poe => poe_test_echo --lol=:D --version --help\n--lol=:D --version --help\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poetry_plugin_v2.py
test_poetry_help
assert
complex_expr
26
import os import re import pytest def _setup_poetry_project(run_poetry_2, projects): run_poetry_2(["install"], cwd=projects["poetry_plugin"]) def _setup_poetry_project_empty_prefix(run_poetry_2, projects): run_poetry_2( ["install"], cwd=projects["poetry_plugin/empty_prefix"].parent, ) de...
result.stdout
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poetry_plugin_v2.py
test_task_with_lib_dependency
assert
string_literal
30
import os import re import pytest def _setup_poetry_project(run_poetry_2, projects): run_poetry_2(["install"], cwd=projects["poetry_plugin"]) def _setup_poetry_project_empty_prefix(run_poetry_2, projects): run_poetry_2( ["install"], cwd=projects["poetry_plugin/empty_prefix"].parent, ) de...
"Poe => from cowpy import cow; print(list(cow.COWACTERS)[5])\ncheese\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_poetry_plugin_v2.py
test_task_accepts_any_args
assert
string_literal
29
import os import re import pytest def _setup_poetry_project(run_poetry_2, projects): run_poetry_2(["install"], cwd=projects["poetry_plugin"]) def _setup_poetry_project_empty_prefix(run_poetry_2, projects): run_poetry_2( ["install"], cwd=projects["poetry_plugin/empty_prefix"].parent, ) de...
"Poe => poe_test_echo --lol=:D --version --help\n--lol=:D --version --help\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_task
assert
string_literal
20
def test_ref_task(run_poe_subproc, projects, esc_prefix, is_windows): # This should be exactly the same as calling the echo task directly result = run_poe_subproc( "also_echo", "foo", "!", env={"POETRY_VIRTUALENVS_CREATE": "false"} ) if is_windows: assert result.capture == ( # windows p...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_passes_named_args_in_definition
assert
string_literal
5
def test_ref_passes_named_args_in_definition(run_poe_subproc): result = run_poe_subproc("greet-dave", project="refs") assert result.capture == "Poe => poe_test_echo hi dave\n" assert result.stdout ==
"hi dave\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_passes_extra_args_in_definition
assert
string_literal
5
def test_ref_passes_extra_args_in_definition(run_poe_subproc): result = run_poe_subproc("greet-funny", project="refs") assert result.capture == "Poe => poe_test_echo hi 'lol!'\n" assert result.stdout ==
"hi lol!\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_forwards_arguments
assert
string_literal
26
def test_ref_forwards_arguments(run_poe_subproc): result = run_poe_subproc( "sorry-dave", "I", "cant", "do", "that", "--", "--", ",", "anything", "else?", project="refs", ) assert ( result.capture == """P...
"hi lol! OK\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_passes_named_args_in_definition
assert
string_literal
4
def test_ref_passes_named_args_in_definition(run_poe_subproc): result = run_poe_subproc("greet-dave", project="refs") assert result.capture ==
"Poe => poe_test_echo hi dave\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_passes_extra_args_in_definition
assert
string_literal
4
def test_ref_passes_extra_args_in_definition(run_poe_subproc): result = run_poe_subproc("greet-funny", project="refs") assert result.capture ==
"Poe => poe_test_echo hi 'lol!'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_forwards_arguments
assert
string_literal
25
def test_ref_forwards_arguments(run_poe_subproc): result = run_poe_subproc( "sorry-dave", "I", "cant", "do", "that", "--", "--", ",", "anything", "else?", project="refs", ) assert ( result.capture == """P...
"Poe => poe_test_echo hi 'lol!' OK\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_parses_named_args
assert
string_literal
9
def test_ref_parses_named_args(run_poe_subproc): result = run_poe_subproc( "apologize", "--name=Davey", "--explain=Ah cannae dae that", project="refs" ) assert ( result.capture == """Poe => echo 'I'"'"'m sorry Davey, Ah cannae dae that'\n""" ) assert result.stdout ==
"I'm sorry Davey, Ah cannae dae that\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_forwards_arguments
assert
string_literal
20
def test_ref_forwards_arguments(run_poe_subproc): result = run_poe_subproc( "sorry-dave", "I", "cant", "do", "that", "--", "--", ",", "anything", "else?", project="refs", ) assert ( result.capture == """P...
"I'm sorry Dave, I cant do that , anything else?\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_forwards_arguments_if_none_defined
assert
string_literal
17
def test_ref_forwards_arguments_if_none_defined(run_poe_subproc): result = run_poe_subproc( "say-sorry", "--name=Davey", "--explain=Ah cannae dae that", "--", ",", "anything", "else?", project="refs", ) assert result.capture == ( """Poe...
"I'm sorry Davey, Ah cannae dae that , anything else?\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_parses_named_args
assert
string_literal
6
def test_ref_parses_named_args(run_poe_subproc): result = run_poe_subproc( "apologize", "--name=Davey", "--explain=Ah cannae dae that", project="refs" ) assert (
"""Poe => echo 'I'"'"'m sorry Davey, Ah cannae dae that'\n"""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_task
assert
string_literal
17
def test_ref_task(run_poe_subproc, projects, esc_prefix, is_windows): # This should be exactly the same as calling the echo task directly result = run_poe_subproc( "also_echo", "foo", "!", env={"POETRY_VIRTUALENVS_CREATE": "false"} ) if is_windows: assert result.capture == ( # windows p...
f"POE_ROOT:{projects['example']} Password1, task_args: foo !\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_forwards_arguments_if_none_defined
assert
string_literal
13
def test_ref_forwards_arguments_if_none_defined(run_poe_subproc): result = run_poe_subproc( "say-sorry", "--name=Davey", "--explain=Ah cannae dae that", "--", ",", "anything", "else?", project="refs", ) asse
"""Poe => echo 'I'"'"'m sorry Davey, Ah cannae dae that'""" """ , anything 'else?'\n"""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_ref_task.py
test_ref_task
assert
string_literal
13
def test_ref_task(run_poe_subproc, projects, esc_prefix, is_windows): # This should be exactly the same as calling the echo task directly result = run_poe_subproc( "also_echo", "foo", "!", env={"POETRY_VIRTUALENVS_CREATE": "false"} ) if is_windows: assert result.capture == ( # windows p...
"Poe => poe_test_echo " f"POE_ROOT:{projects['example']} Password1, task_args: foo '!'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_script_tasks.py
test_script_task_with_hard_coded_args
assert
string_literal
26
import difflib no_venv = {"POETRY_VIRTUALENVS_CREATE": "false"} def test_script_task_with_hard_coded_args(run_poe_subproc, projects, esc_prefix): result = run_poe_subproc("static-args-test", project="scripts", env=no_venv) assert result.capture == "Poe => static-args-test\n" assert result.stdout == ( ...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_scripts.py
test_rm_dry_mode
assert
string_literal
31
import os from pathlib import Path from shutil import rmtree import pytest from poethepoet.scripts import rm _test_file_tree = { "pkg": { "__pycache__": {"foo.pyc": "XXX"}, "foo.py": "XXX", "bar": { "baz.py": "XXX", "__pycache__": {"baz.pyc": "XXX"}, }, ...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_scripts.py
test_rm_dry_mode
assert
string_literal
30
import os from pathlib import Path from shutil import rmtree import pytest from poethepoet.scripts import rm _test_file_tree = { "pkg": { "__pycache__": {"foo.pyc": "XXX"}, "foo.py": "XXX", "bar": { "baz.py": "XXX", "__pycache__": {"baz.pyc": "XXX"}, }, ...
"Deleting paths matching './**/__pycache__'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_scripts.py
test_rm_innert_patterns_verbose
assert
string_literal
30
import os from pathlib import Path from shutil import rmtree import pytest from poethepoet.scripts import rm _test_file_tree = { "pkg": { "__pycache__": {"foo.pyc": "XXX"}, "foo.py": "XXX", "bar": { "baz.py": "XXX", "__pycache__": {"baz.pyc": "XXX"}, }, ...
"No files or directories to delete matching 'nee'\n" "No files or directories to delete matching 'shrubbery'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_scripts.py
test_rm_dry_mode_verbose
assert
string_literal
42
import os from pathlib import Path from shutil import rmtree import pytest from poethepoet.scripts import rm _test_file_tree = { "pkg": { "__pycache__": {"foo.pyc": "XXX"}, "foo.py": "XXX", "bar": { "baz.py": "XXX", "__pycache__": {"baz.pyc": "XXX"}, }, ...
"Deleting file '.mypy_cache'\n" "Deleting file '.pytest_cache'\n" "Deleting paths matching './**/__pycache__'\n" "Deleting directory '__pycache__'\n" "Deleting directory 'pkg/__pycache__'\n" "Deleting directory 'pkg/bar/__pycache__'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_scripts.py
test_rm_dry_mode_verbose
assert
string_literal
33
import os from pathlib import Path from shutil import rmtree import pytest from poethepoet.scripts import rm _test_file_tree = { "pkg": { "__pycache__": {"foo.pyc": "XXX"}, "foo.py": "XXX", "bar": { "baz.py": "XXX", "__pycache__": {"baz.pyc": "XXX"}, }, ...
"Deleting file '.mypy_cache'\n" "Deleting file '.pytest_cache'\n" "Deleting paths matching './**/__pycache__'\n" "Deleting directory '__pycache__'\n" "Deleting directory 'pkg\\__pycache__'\n" "Deleting directory 'pkg\\bar\\__pycache__'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_sequence_task
assert
string_literal
10
def test_sequence_task(run_poe_subproc, esc_prefix): result = run_poe_subproc("composite_task", project="sequences") assert result.capture == ( "Poe => poe_test_echo Hello\n" "Poe => poe_test_echo 'World!'\n" "Poe => poe_test_echo ':)!'\n" ) assert result.stdout == "Hello\nWorld!...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_sequence_task
assert
string_literal
9
def test_sequence_task(run_poe_subproc, esc_prefix): result = run_poe_subproc("composite_task", project="sequences") assert result.capture == ( "Poe => poe_test_echo Hello\n" "Poe => poe_test_echo 'World!'\n" "Poe => poe_test_echo ':)!'\n" ) assert result.stdout ==
"Hello\nWorld!\n:)!\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_a_script_sequence_task_with_args
assert
string_literal
9
def test_a_script_sequence_task_with_args(run_poe_subproc, esc_prefix): # This should be exactly the same as calling the composite_task task directly result = run_poe_subproc("greet-multiple", "--mouse=Jerry", project="sequences") assert result.capture == ( """Poe => 'my_package:main(environ.get('"'...
"hello Tom\nhello Jerry\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_sequence_task_with_multiple_value_arg
assert
string_literal
10
def test_sequence_task_with_multiple_value_arg(run_poe_subproc): result = run_poe_subproc( "multiple-value-arg", "hey", "1", "2", "3", project="sequences" ) assert result.capture == ( "Poe => poe_test_echo first: hey\nPoe => poe_test_echo second: '1 2 3'\n" "Poe => poe_test_echo Done...
"first: hey\nsecond: 1 2 3\nDone.\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_subtasks_inherit_cwd_option_as_default
assert
string_literal
4
def test_subtasks_inherit_cwd_option_as_default(run_poe_subproc, is_windows): result = run_poe_subproc("all_cwd", project="sequences") asse
"Poe => os.getcwd()\n" "Poe => os.getcwd()\n" "Poe => 'all_cwd[2]'\n" "Poe => 'all_cwd[3]'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_sequence_task
assert
string_literal
4
def test_sequence_task(run_poe_subproc, esc_prefix): result = run_poe_subproc("composite_task", project="sequences") asse
"Poe => poe_test_echo Hello\n" "Poe => poe_test_echo 'World!'\n" "Poe => poe_test_echo ':)!'\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_sequence_task_with_multiple_value_arg
assert
string_literal
6
def test_sequence_task_with_multiple_value_arg(run_poe_subproc): result = run_poe_subproc( "multiple-value-arg", "hey", "1", "2", "3", project="sequences" ) asse
"Poe => poe_test_echo first: hey\nPoe => poe_test_echo second: '1 2 3'\n" "Poe => poe_test_echo Done.\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_sequence_tasks.py
test_a_script_sequence_task_with_args
assert
string_literal
5
def test_a_script_sequence_task_with_args(run_poe_subproc, esc_prefix): # This should be exactly the same as calling the composite_task task directly result = run_poe_subproc("greet-multiple", "--mouse=Jerry", project="sequences") asse
"""Poe => 'my_package:main(environ.get('"'"'cat'"'"'))'\n""" """Poe => 'my_package:main(environ['"'"'mouse'"'"'])'\n"""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_completion.py
test_zsh_completion
assert
numeric_literal
5
def test_zsh_completion(run_poe_main): result = run_poe_main("_zsh_completion") # some lines to stdout and none for stderr assert len(result.stdout.split("\n")) >
5
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_completion.py
test_describe_tasks
assert
string_literal
9
def test_describe_tasks(run_poe_main): result = run_poe_main("_describe_tasks") # expect an ordered listing of non-hidden tasks defined in the dummy_project assert result.stdout == ( "echo show_env greet greet-shouty count also_echo sing part1 composite_task " "also_composite_task greet-mult...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_completion.py
test_zsh_completion
assert
complex_expr
7
def test_zsh_completion(run_poe_main): result = run_poe_main("_zsh_completion") # some lines to stdout and none for stderr assert len(result.stdout.split("\n")) > 5 assert result.stderr == "" assert "Error: Unrecognised task" not in
result.stdout
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_completion.py
test_describe_tasks
assert
string_literal
5
def test_describe_tasks(run_poe_main): result = run_poe_main("_describe_tasks") # expect an ordered listing of non-hidden tasks defined in the dummy_project asse
"echo show_env greet greet-shouty count also_echo sing part1 composite_task " "also_composite_task greet-multiple travel\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_completion.py
test_list_tasks
assert
string_literal
5
def test_list_tasks(run_poe_main): result = run_poe_main("_list_tasks") # expect an ordered listing of non-hidden tasks defined in the dummy_project asse
"echo show_env greet greet-shouty count also_echo sing part1 composite_task" " also_composite_task greet-multiple travel\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_task.py
test_shell_task
assert
string_literal
13
import shutil import pytest def test_shell_task(run_poe_subproc): result = run_poe_subproc("count", project="shells") assert result.capture == ( "Poe => poe_test_echo 1 && poe_test_echo 2 " "&& poe_test_echo $(python -c 'print(1 + 2)')\n" ) assert result.stdout == "1\n2\n3\n" asse...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_task.py
test_shell_task
assert
string_literal
12
import shutil import pytest def test_shell_task(run_poe_subproc): result = run_poe_subproc("count", project="shells") assert result.capture == ( "Poe => poe_test_echo 1 && poe_test_echo 2 " "&& poe_test_echo $(python -c 'print(1 + 2)')\n" ) assert result.stdout ==
"1\n2\n3\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_task.py
test_shell_task_with_dash_case_arg
assert
string_literal
11
import shutil import pytest def test_shell_task_with_dash_case_arg(run_poe_subproc): result = run_poe_subproc( "greet", "--formal-greeting=hey", "--subject=you", project="shells" ) assert result.capture == ("Poe => poe_test_echo $formal_greeting $subject\n") assert result.stdout ==
"hey you\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_shell_task.py
test_interpreter_sh
assert
complex_expr
10
import shutil import pytest @pytest.mark.skipif(not shutil.which("sh"), reason="No sh available") def test_interpreter_sh(run_poe_subproc): result = run_poe_subproc("echo_sh", project="shells") assert result.capture == ("Poe => poe_test_echo $0 $test_var\n") assert "roflcopter" in
result.stdout
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_switch_task.py
test_switch_on_platform
assert
string_literal
33
import sys def test_switch_on_platform(run_poe_subproc): common_prefix = "Poe <= override or sys.platform\n" result = run_poe_subproc("platform_dependent", project="switch") if sys.platform == "win32": assert ( result.capture == f"{common_prefix}Poe => import sys; print('Yo...
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_switch_task.py
test_switch_multivalue_case
assert
string_literal
19
import sys def test_switch_multivalue_case(run_poe_subproc): for num in ("1", "3", "5"): result = run_poe_subproc( "multivalue_case", project="switch", env={"WHATEVER": num} ) assert result.capture == ( f"Poe <= poe_test_echo {num}\nPoe => import sys; print('It is in...
"It is 6\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_switch_task.py
test_switch_capture_out
assert
string_literal
13
import sys def test_switch_capture_out(run_poe_subproc, projects): result = run_poe_subproc("capture_out", project="switch") assert result.capture == ("Poe <= 43\n" "Poe <= echo default\n") assert result.stdout == "" assert result.stderr == "" output_path = projects["switch"].joinpath("out.txt") ...
"default\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_switch_task.py
test_switch_on_env_var
assert
string_literal
16
import sys def test_switch_on_env_var(run_poe_subproc): common_prefix = "Poe <= int(${FOO_VAR}) % 2\n" result = run_poe_subproc("var_dependent", project="switch", env={"FOO_VAR": "42"}) assert result.capture == common_prefix + "Poe => f'{${FOO_VAR}} is even'\n" assert result.stdout == "42 is even\n" ...
"99 is odd\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_switch_task.py
test_switch_on_env_var
assert
string_literal
8
import sys def test_switch_on_env_var(run_poe_subproc): common_prefix = "Poe <= int(${FOO_VAR}) % 2\n" result = run_poe_subproc("var_dependent", project="switch", env={"FOO_VAR": "42"}) assert result.capture == common_prefix + "Poe => f'{${FOO_VAR}} is even'\n" assert result.stdout ==
"42 is even\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_uv_executor.py
test_uv_package_script_task
assert
string_literal
10
import shutil import pytest @pytest.mark.skipif(not shutil.which("uv"), reason="No uv available") def test_uv_package_script_task(run_poe_subproc, projects): result = run_poe_subproc("-q", "script-task", project="uv") assert result.capture ==
""
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_uv_executor.py
test_uv_executor_env
assert
complex_expr
13
import shutil import pytest @pytest.mark.skipif(not shutil.which("uv"), reason="No uv available") def test_uv_executor_env(run_poe_subproc, projects): result = run_poe_subproc("show-env", project="uv") assert result.capture == "Poe => poe_test_env\n" assert result.stderr == "" assert f"VIRTUAL_ENV=...
result.stdout
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_uv_executor.py
test_uv_executor_env
assert
string_literal
10
import shutil import pytest @pytest.mark.skipif(not shutil.which("uv"), reason="No uv available") def test_uv_executor_env(run_poe_subproc, projects): result = run_poe_subproc("show-env", project="uv") assert result.capture ==
"Poe => poe_test_env\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_uv_executor.py
test_uv_package_script_task
assert
string_literal
12
import shutil import pytest @pytest.mark.skipif(not shutil.which("uv"), reason="No uv available") def test_uv_package_script_task(run_poe_subproc, projects): result = run_poe_subproc("-q", "script-task", project="uv") assert result.capture == "" assert result.stderr == "" assert result.stdout ==
"Hello from uv-project 0.0.99\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_uv_executor.py
test_uv_executor_task_with_cwd
assert
string_literal
11
import shutil import pytest @pytest.mark.skipif(not shutil.which("uv"), reason="No uv available") def test_uv_executor_task_with_cwd(run_poe_subproc, projects, poe_project_path): subproject_path = f"{projects['uv']}/subproject" result = run_poe_subproc("-C", subproject_path, "test-cwd", "../..") asse
"Poe => echo UV_RUN_RECURSION_DEPTH: $UV_RUN_RECURSION_DEPTH\n" "echo VIRTUAL_ENV: $VIRTUAL_ENV\n" "echo pwd: $(pwd)\n"
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nat-n/poethepoet
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
train
train
tests/test_version.py
test_version
assert
complex_expr
5
from poethepoet import __version__ def test_version(pyproject): assert (
pyproject["project"]["version"]
55e994c75c4fde5794525bdaf5c90ec3d04380f6
103
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_configs_work.py
test_configs_work
assert
variable
35
from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING from nbqa.__main__ import main def test_configs_work(capsys: "CaptureFixture") -> None: """ Check a flake8 cfg file is picked up by nbqa. Parameters ---------- capsys Pytest fixture to capture stdout and...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_deprecated.py
test_deprecated
assert
string_literal
12
import os from typing import TYPE_CHECKING from nbqa.__main__ import main def test_deprecated(capsys: "CaptureFixture") -> None: """Test deprecation errors.""" path = os.path.join("tests", "data", "clean_notebook.ipynb") main(["flake8", path, "--nbqa-skip-bad-cells"]) _, err = capsys.readouterr() ...
"Flag --nbqa-skip-bad-cells was deprecated in 0.13.0\n" "Cells with invalid syntax are now skipped by default\n"
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_file_not_found.py
test_file_not_found
assert
variable
12
from typing import TYPE_CHECKING from nbqa.__main__ import main def test_file_not_found(capsys: "CaptureFixture") -> None: """Check useful error message is raised if file or directory doesn't exist.""" msg = "No such file or directory: I don't exist" main(["isort", "I don't exist", "--profile=black"]) ...
err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_find_root.py
test_find_project_root
assert
variable
27
from pathlib import Path from typing import Sequence import pytest from nbqa.find_root import find_project_root @pytest.mark.parametrize( "src", [ (Path.cwd(),), (Path.cwd() / "tests", Path.cwd() / "tests/data"), ], ) def test_find_project_root(src: Sequence[str]) -> None: """ Che...
expected
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_hash_collision.py
test_hash_collision
assert
variable
15
import os from _pytest.capture import CaptureFixture from _pytest.monkeypatch import MonkeyPatch from nbqa.__main__ import main def test_hash_collision(monkeypatch: MonkeyPatch, capsys: CaptureFixture) -> None: """Check hash collision error message.""" path = os.path.join("tests", "data", "notebook_for_testi...
err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_local_script.py
test_local_nonfound
pytest.raises
variable
13
import os import pytest from nbqa.__main__ import main def test_local_nonfound() -> None: """Test local module is picked up.""" cwd = os.getcwd() os.chdir(os.path.join("tests", "invalid_data")) try: with pytest.raises(
ModuleNotFoundError)
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_map_python_line_to_nb_lines.py
test_map_python_line_to_nb_lines
assert
variable
14
from textwrap import dedent from nbqa.output_parser import map_python_line_to_nb_lines def test_map_python_line_to_nb_lines() -> None: """Check that the output is correctly parsed if there is a warning about line 0.""" out = "notebook.ipynb:0:1: WPS102 Found incorrect module name pattern" err = "" not...
expected
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_nbqa_diff.py
test_invalid_syntax_with_nbqa_diff
assert
variable
43
import os from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = "\N{broken heart}" TESTS_DIR = Path("tests") TEST_DATA_DIR = TESTS_DIR / "data" DIRTY_...
out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_nbqa_diff.py
test_invalid_syntax_with_nbqa_diff
assert
variable
44
import os from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = "\N{broken heart}" TESTS_DIR = Path("tests") TEST_DATA_DIR = TESTS_DIR / "data" DIRTY_...
err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_nbqa_diff.py
test_diff_present
assert
variable
43
import os from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = "\N{broken heart}" TESTS_DIR = Path("tests") TEST_DATA_DIR = TESTS_DIR / "data" DIRTY_...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_nbqa_diff.py
test_diff_present
assert
variable
55
import os from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = "\N{broken heart}" TESTS_DIR = Path("tests") TEST_DATA_DIR = TESTS_DIR / "data" DIRTY_...
expected_err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_non_python_notebook.py
test_non_python_notebook
assert
variable
20
import os from typing import TYPE_CHECKING from nbqa.__main__ import main def test_non_python_notebook(capsys: "CaptureFixture") -> None: """ Should ignore non-Python notebook. Parameters ---------- capsys Pytest fixture to capture stdout and stderr. """ path = os.path.join("tests...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_pyproject_toml.py
test_pyproject_toml_works
assert
variable
35
import os from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING from nbqa.__main__ import main def test_pyproject_toml_works(capsys: "CaptureFixture") -> None: """ Check if config is picked up from pyproject.toml works. Parameters ---------- capsys Pytest f...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_return_code.py
test_flake8_return_code
assert
variable
25
import subprocess from functools import partial from pathlib import Path from typing import Sequence TESTS_DIR = Path("tests") TEST_DATA_DIR = TESTS_DIR / "data" DIRTY_NOTEBOOK = TEST_DATA_DIR / "notebook_for_testing.ipynb" CLEAN_NOTEBOOK = TEST_DATA_DIR / "clean_notebook.ipynb" EMPTY_NOTEBOOK = TEST_DATA_DIR / "empty...
PASSED
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_running_from_different_dir.py
test_running_in_different_dir_works
assert
variable
47
import os from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main @pytest.mark.parametrize( "arg, cwd", [ (Path("tests"), Path.cwd()), (Path("data"), Path.cwd() / "tests"), (Path("notebook_for_testing.ipynb"), ...
out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_remove_all_no_trailing_sc
assert
string_literal
31
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main @pytest.mark.usefixtures("tmp_remove_all") def test_remove_all_no_trailing_sc(capsys: "CaptureFixture") -> None: """Check error message shows if we're unable to ...
""
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_unable_to_reconstruct_message
assert
variable
19
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main @pytest.mark.usefixtures("tmp_remove_comments") def test_unable_to_reconstruct_message(capsys: "CaptureFixture") -> None: """Check error message shows if we're u...
err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_unable_to_parse_with_valid_notebook
assert
variable
27
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main def test_unable_to_parse_with_valid_notebook(capsys: "CaptureFixture") -> None: """Check error message shows if we're unable to parse notebook.""" path_0 = P...
out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_missing_root_dir
pytest.raises
variable
40
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main def test_missing_root_dir(capsys: "CaptureFixture") -> None: """Check useful error message is raised if :code:`nbqa` is called without root_dir.""" prefix = ...
SystemExit)
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_remove_all_no_trailing_sc
assert
variable
30
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main @pytest.mark.usefixtures("tmp_remove_all") def test_remove_all_no_trailing_sc(capsys: "CaptureFixture") -> None: """Check error message shows if we're unable to ...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_unable_to_reconstruct_message_pythonpath
assert
complex_expr
33
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main def test_unable_to_reconstruct_message_pythonpath(monkeypatch: "MonkeyPatch") -> None: """ Same as ``test_unable_to_reconstruct_message`` but we check ``PYTH...
output.stderr
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_unable_to_reconstruct_message_pythonpath
assert
variable
34
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main def test_unable_to_reconstruct_message_pythonpath(monkeypatch: "MonkeyPatch") -> None: """ Same as ``test_unable_to_reconstruct_message`` but we check ``PYTH...
expected_returncode
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_missing_command
pytest.raises
complex_expr
24
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main def test_missing_command() -> None: """Check useful error is raised if :code:`nbqa` is run with an invalid command.""" msg = ( "\x1b\\[1mCommand `som...
ModuleNotFoundError, match=msg)
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_runtime_errors.py
test_directory_without_notebooks
assert
string_literal
24
import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main def test_directory_without_notebooks(capsys: "CaptureFixture") -> None: """ Check sensible error message is returned if none of the directories passed have n...
"No .ipynb notebooks found in given directories: docs\n"
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_skip_bad_cells.py
test_cmdline
assert
variable
23
import os from typing import TYPE_CHECKING from nbqa.__main__ import main def test_cmdline(capsys: "CaptureFixture") -> None: """Check running from command-line.""" file = os.path.join("tests", "invalid_data", "automagic.ipynb") main(["black", file, "--nbqa-diff"]) out, _ = capsys.readouterr() exp...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_skip_celltags.py
test_skip_celltags_cli
assert
variable
25
import os from typing import TYPE_CHECKING from nbqa.__main__ import main def test_skip_celltags_cli(capsys: "CaptureFixture") -> None: """ Check flake8 works. Shouldn't alter the notebook content. Parameters ---------- capsys Pytest fixture to capture stdout and stderr. """ # che...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_skip_celltags.py
test_skip_celltags_cli
assert
variable
26
import os from typing import TYPE_CHECKING from nbqa.__main__ import main def test_skip_celltags_cli(capsys: "CaptureFixture") -> None: """ Check flake8 works. Shouldn't alter the notebook content. Parameters ---------- capsys Pytest fixture to capture stdout and stderr. """ # che...
expected_err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_transformed_magics.py
test_transformed_magics
assert
variable
30
import os from typing import TYPE_CHECKING from nbqa.__main__ import main def test_transformed_magics(capsys: "CaptureFixture") -> None: """ Should ignore cells with transformed magics. Parameters ---------- capsys Pytest fixture to capture stdout and stderr. """ path = os.path.jo...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_version.py
test_version
assert
numeric_literal
13
import subprocess from subprocess import PIPE from nbqa import __version__ def test_version() -> None: """Check you can run :code:`nbqa --version`.""" output = subprocess.run( ["nbqa", "--version"], stdout=PIPE, stderr=PIPE, universal_newlines=True ) assert output.stdout.strip() == f"nbqa {__v...
0
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/test_version.py
test_version
assert
string_literal
12
import subprocess from subprocess import PIPE from nbqa import __version__ def test_version() -> None: """Check you can run :code:`nbqa --version`.""" output = subprocess.run( ["nbqa", "--version"], stdout=PIPE, stderr=PIPE, universal_newlines=True ) assert output.stdout.strip() ==
f"nbqa {__version__}"
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_autopep8.py
test_successive_runs_using_autopep8
assert
string_literal
71
import os from pathlib import Path from shutil import copyfile from typing import TYPE_CHECKING from nbqa.__main__ import main def test_successive_runs_using_autopep8( tmpdir: "LocalPath", capsys: "CaptureFixture" ) -> None: """Check autopep8 returns 0 on the second run given a dirty notebook.""" src_note...
""
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_autopep8.py
test_successive_runs_using_autopep8
assert
variable
65
import os from pathlib import Path from shutil import copyfile from typing import TYPE_CHECKING from nbqa.__main__ import main def test_successive_runs_using_autopep8( tmpdir: "LocalPath", capsys: "CaptureFixture" ) -> None: """Check autopep8 returns 0 on the second run given a dirty notebook.""" src_note...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_black.py
test_black_multiple_files
assert
string_literal
37
import difflib import operator import os import subprocess from pathlib import Path from shutil import copyfile from textwrap import dedent from typing import TYPE_CHECKING, Callable from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = ...
""
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_black.py
test_black_works
assert
variable
67
import difflib import operator import os import subprocess from pathlib import Path from shutil import copyfile from textwrap import dedent from typing import TYPE_CHECKING, Callable from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = ...
err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_black.py
test_black_works_with_commented_magics
assert
variable
56
import difflib import operator import os import subprocess from pathlib import Path from shutil import copyfile from textwrap import dedent from typing import TYPE_CHECKING, Callable from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = ...
out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_black.py
test_black_works
assert
variable
46
import difflib import operator import os import subprocess from pathlib import Path from shutil import copyfile from textwrap import dedent from typing import TYPE_CHECKING, Callable from nbqa.__main__ import main SPARKLES = "\N{sparkles}" SHORTCAKE = "\N{shortcake}" COLLISION = "\N{collision symbol}" BROKEN_HEART = ...
expected
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_doctest.py
test_doctest_works
assert
string_literal
28
import os from typing import TYPE_CHECKING from nbqa.__main__ import main GOOD_EXAMPLE_NOTEBOOK = os.path.join("tests", "data", "notebook_for_testing.ipynb") WRONG_EXAMPLE_NOTEBOOK = os.path.join( "tests", "data", "notebook_for_testing_copy.ipynb" ) INVALID_IMPORT_NOTEBOOK = os.path.join( "tests", "data", "in...
""
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_doctest.py
test_doctest_invalid_import
assert
variable
27
import os from typing import TYPE_CHECKING from nbqa.__main__ import main GOOD_EXAMPLE_NOTEBOOK = os.path.join("tests", "data", "notebook_for_testing.ipynb") WRONG_EXAMPLE_NOTEBOOK = os.path.join( "tests", "data", "notebook_for_testing_copy.ipynb" ) INVALID_IMPORT_NOTEBOOK = os.path.join( "tests", "data", "in...
err
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_doctest.py
test_doctest_works
assert
variable
52
import os from typing import TYPE_CHECKING from nbqa.__main__ import main GOOD_EXAMPLE_NOTEBOOK = os.path.join("tests", "data", "notebook_for_testing.ipynb") WRONG_EXAMPLE_NOTEBOOK = os.path.join( "tests", "data", "notebook_for_testing_copy.ipynb" ) INVALID_IMPORT_NOTEBOOK = os.path.join( "tests", "data", "in...
expected_out
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_doctest.py
test_doctest_works
assert
func_call
56
import os from typing import TYPE_CHECKING from nbqa.__main__ import main GOOD_EXAMPLE_NOTEBOOK = os.path.join("tests", "data", "notebook_for_testing.ipynb") WRONG_EXAMPLE_NOTEBOOK = os.path.join( "tests", "data", "notebook_for_testing_copy.ipynb" ) INVALID_IMPORT_NOTEBOOK = os.path.join( "tests", "data", "in...
expected_out.replace( WRONG_EXAMPLE_NOTEBOOK, os.path.abspath(WRONG_EXAMPLE_NOTEBOOK) )
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_flake8_works.py
test_flake8_works
assert
func_call
71
import os from textwrap import dedent from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main @pytest.mark.parametrize( "path_0, path_1, path_2", ( ( os.path.abspath( os.path.join("tests", "data", "notebook_for_testing.ipynb") ), ...
sorted(expected_out.splitlines())
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor
nbQA-dev/nbQA
547020ccfb0e10801877ab699671636c11e119c1
141
train
train
tests/tools/test_flake8_works.py
test_flake8_works
assert
func_call
72
import os from textwrap import dedent from typing import TYPE_CHECKING import pytest from nbqa.__main__ import main @pytest.mark.parametrize( "path_0, path_1, path_2", ( ( os.path.abspath( os.path.join("tests", "data", "notebook_for_testing.ipynb") ), ...
sorted(expected_err.splitlines())
547020ccfb0e10801877ab699671636c11e119c1
141
v2_extractor_at_anchor