repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from tests.fixtures import import_teamocil as fixtures
from tmuxp._internal import config_reader
from tmuxp.workspace import importers, validation
def multisession_config() -> dict[
str,
dict[str, t.Any],
]:
"""Return loaded multisessio... | expected | assert | variable | tests/workspace/test_import_teamocil.py | test_multisession_config | 137 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | check_cmd("./myconfig.yaml").out | assert | func_call | tests/cli/test_cli.py | test_pass_config_dir_argparse | 144 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import ANSI_BOLD, ANSI_CYAN, ANSI_GREEN, ANSI_MAGENTA
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_convert_colors_disabled_plain_text(colors_never: Colors) -> None:
"""Verify disabled c... | "info" | assert | string_literal | tests/cli/test_convert_colors.py | test_convert_colors_disabled_plain_text | 41 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_output_mode_values() -> None:
"""Verify OutputMode enum values."""
assert OutputMode.HUMAN.value == | "human" | assert | string_literal | tests/cli/test_output.py | test_output_mode_values | 16 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tmuxp._internal.private_path import PrivatePath, collapse_home_in_string
def test_collapse_home_in_string_single_path(monkeypatch: pytest.MonkeyPatch) -> None:
"""collapse_home_in_string handles a single path."""
monkeypatch.setattr(pathli... | "~/.local/bin" | assert | string_literal | tests/_internal/test_private_path.py | test_collapse_home_in_string_single_path | 88 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_output_formatter_json_buffer_initially_empty() -> None:
"""JSON buffer should start empty."""
formatter = OutputFormatter(OutputMode.JSON)
... | [] | assert | collection | tests/cli/test_output.py | test_output_formatter_json_buffer_initially_empty | 65 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | pathlib.Path("~/.tmuxinator").expanduser() | assert | func_call | tests/cli/test_cli.py | test_get_tmuxinator_dir | 95 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import typing as t
import pytest
from tests.constants import EXAMPLE_PATH
from tmuxp import exc
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.workspace import loader, validation
def load_workspace(path: str | pathlib.Path) -> dict[str, t.Any]:
... | sconfig | assert | variable | tests/workspace/test_config.py | test_in_session_scope | 152 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import ANSI_BOLD, ANSI_CYAN, ANSI_GREEN, ANSI_MAGENTA
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_convert_combined_success_format(colors_always: Colors) -> None:
"""Verify combined suc... | output | assert | variable | tests/cli/test_convert_colors.py | test_convert_combined_success_format | 54 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import pytest
from tests._internal.conftest import (
ANSI_BLUE,
ANSI_BOLD,
ANSI_BRIGHT_CYAN,
ANSI_CYAN,
ANSI_GREEN,
ANSI_MAGENTA,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.colors import (
ColorMode,
Colors,
... | "hl" | assert | string_literal | tests/_internal/test_colors.py | test_never_mode_disables | 90 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import subprocess
import pytest
from tmuxp.cli import create_parser
def _get_help_text(subcommand: str | None = None) -> str:
"""Get CLI help text without spawning subprocess.
Parameters
----------
subcommand : str | None
Subcommand name, o... | 0 | assert | numeric_literal | tests/cli/test_help_examples.py | test_main_help_has_examples | 98 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tmuxp import exc
from tmuxp.exc import BeforeLoadScriptError, BeforeLoadScriptNotExists
from tmuxp.util import get_session, run_before_script
from .constants import FIXTURE_PATH
def temp_script(tmp_path: pathlib.Path) -> pathlib.Pa... | first_session | assert | variable | tests/test_util.py | test_get_session_should_return_first_session_if_no_active_session | 168 | null | |
tmux-python/tmuxp | from __future__ import annotations
import re
import typing as t
import pytest
from docutils import nodes
from sphinx_argparse_neo.nodes import (
_generate_argument_id,
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
def ren... | html | assert | variable | tests/docs/_ext/sphinx_argparse_neo/test_nodes.py | test_argument_wrapper_has_id | 511 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import (
ANSI_BLUE,
ANSI_CYAN,
ANSI_GREEN,
ANSI_RED,
ANSI_RESET,
)
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_import_masks_home_in_save_prompt(mock_home: pathlib.Path)... | prompt | assert | variable | tests/cli/test_import_colors.py | test_import_masks_home_in_save_prompt | 117 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_output_mode_members() -> None:
"""Verify all expected members exist."""
members = list(OutputMode)
assert len(members) == | 3 | assert | numeric_literal | tests/cli/test_output.py | test_output_mode_members | 24 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_roles import (
cli_choice_role,
cli_command_role,
cli_default_role,
cli_metavar_role,
cli_option_role,
normalize_options,
register_roles,
)
from docutils import nodes
def test_all_roles_return_correct_types(... | 2 | assert | numeric_literal | tests/docs/_ext/test_argparse_roles.py | test_all_roles_return_correct_types | 334 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from sphinx_argparse_neo.compat import (
MockModule,
get_parser_from_entry_point,
get_parser_from_module,
import_module,
mock_imports,
)
def test_mock_imports_cleanup_on_exception() -> None:
"""Test that mock_impor... | ValueError) | pytest.raises | variable | tests/docs/_ext/sphinx_argparse_neo/test_compat.py | test_mock_imports_cleanup_on_exception | 130 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import json
import pathlib
import pytest
from tmuxp import cli
from tmuxp.cli.ls import (
_get_workspace_info,
create_ls_subparser,
)
def test_ls_json_includes_global_workspace_dirs(
monkeypatch: pytest.MonkeyPatch,
tmp_path: pathlib.Path,
cap... | d | assert | variable | tests/cli/test_ls.py | test_ls_json_includes_global_workspace_dirs | 650 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pytest
from tmuxp.exc import TmuxpPluginException
from .fixtures.pluginsystem.partials.all_pass import AllVersionPassPlugin
from .fixtures.pluginsystem.partials.libtmux_version_fail import (
LibtmuxVersionFailIncompatiblePlugin,
LibtmuxVersionFailMaxPlugin,
Libtm... | str(exc_info.value) | assert | func_call | tests/test_plugin.py | test_tmux_version_fail_min | 41 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import typing as t
import pytest
from tmuxp.workspace.finders import LOCAL_WORKSPACE_FILES, find_local_workspace_files
class TestFindLocalWorkspaceEdgeCases:
def test_yml_precedence_over_json(
self,
tmp_path: pathlib.Path,
monkeypatch: p... | ".tmuxp.yml" | assert | string_literal | tests/workspace/test_finders_local.py | test_yml_precedence_over_json | TestFindLocalWorkspaceEdgeCases | 207 | null |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tmuxp._internal.private_path import PrivatePath, collapse_home_in_string
def test_collapse_home_in_string_empty() -> None:
"""collapse_home_in_string handles empty string."""
result = collapse_home_in_string("")
assert result == | "" | assert | string_literal | tests/_internal/test_private_path.py | test_collapse_home_in_string_empty | 124 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tmuxp import exc
from tmuxp.exc import BeforeLoadScriptError, BeforeLoadScriptNotExists
from tmuxp.util import get_session, run_before_script
from .constants import FIXTURE_PATH
def temp_script(tmp_path: pathlib.Path) -> pathlib.Pa... | exc.BeforeLoadScriptError) | pytest.raises | complex_expr | tests/test_util.py | test_beforeload_returncode | 126 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import pytest
from tests._internal.conftest import (
ANSI_BLUE,
ANSI_BOLD,
ANSI_BRIGHT_CYAN,
ANSI_CYAN,
ANSI_GREEN,
ANSI_MAGENTA,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.colors import (
ColorMode,
Colors,
... | 1 | assert | numeric_literal | tests/_internal/test_colors.py | test_build_description_no_heading_uses_examples | 338 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from tests.fixtures import import_teamocil as fixtures
from tmuxp._internal import config_reader
from tmuxp.workspace import importers, validation
@pytest.mark.parametrize(
list(TeamocilConfigTestFixture._fields),
TEAMOCIL_CONFIG_TEST_FIXTU... | teamocil_dict | assert | variable | tests/workspace/test_import_teamocil.py | test_config_to_dict | 67 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | ("Token.Operator", "=") | assert | collection | tests/docs/_ext/test_cli_usage_lexer.py | test_long_option_with_value | 229 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tests.cli.conftest import ANSI_BLUE, ANSI_CYAN, ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
def test_prompt_empty_input_with_value_proc_no_crash(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""Verify prompt() with value_proc... | "/valid/path" | assert | string_literal | tests/cli/test_prompt_colors.py | test_prompt_empty_input_with_value_proc_no_crash | 118 | null | |
tmux-python/tmuxp | from __future__ import annotations
import re
import typing as t
import pytest
from docutils import nodes
from sphinx_argparse_neo.nodes import (
_generate_argument_id,
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
def tes... | 4 | assert | numeric_literal | tests/docs/_ext/sphinx_argparse_neo/test_nodes.py | test_full_node_tree | 260 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from sphinx_argparse_neo.compat import (
MockModule,
get_parser_from_entry_point,
get_parser_from_module,
import_module,
mock_imports,
)
def test_mock_imports_does_not_override_existing() -> None:
"""Test that mock... | original | assert | variable | tests/docs/_ext/sphinx_argparse_neo/test_compat.py | test_mock_imports_does_not_override_existing | 122 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | value | assert | variable | tests/docs/_ext/test_cli_usage_lexer.py | test_short_option_with_value | 181 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | "'plugin_test_r'" | assert | string_literal | tests/cli/test_cli.py | test_reattach_plugins | 175 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_exemplar import ( # type: ignore[import-not-found]
ExemplarConfig,
_extract_sections_from_container,
_is_examples_section,
_is_usage_block,
_reorder_nodes,
is_base_examples_term,
is_examples_term,
make_s... | 1 | assert | numeric_literal | tests/docs/_ext/test_argparse_exemplar.py | test_transform_definition_list_single_examples | 366 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import pathlib
import typing as t
import libtmux
import pytest
from libtmux.server import Server
from libtmux.session import Session
from tests.constants import FIXTURE_PATH
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp.... | None | assert | none_literal | tests/cli/test_load.py | test_load_workspace_name_match_regression_252 | 137 | null | |
tmux-python/tmuxp | from __future__ import annotations
import json
import pathlib
import re
import typing as t
import pytest
from tmuxp.cli._colors import ColorMode, Colors
from tmuxp.cli._output import OutputFormatter, OutputMode
from tmuxp.cli.search import (
DEFAULT_FIELDS,
InvalidFieldError,
SearchPattern,
SearchTok... | {} | assert | collection | tests/cli/test_search.py | test_evaluate_match_single_pattern_no_match | 473 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from tests.fixtures import import_teamocil as fixtures
from tmuxp._internal import config_reader
from tmuxp.workspace import importers, validation
@pytest.mark.parametrize(
list(TeamocilConfigTestFixture._fields),
TEAMOCIL_CONFIG_TEST_FIXTU... | tmuxp_dict | assert | variable | tests/workspace/test_import_teamocil.py | test_config_to_dict | 69 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
import pytest
from sphinx_argparse_neo.parser import (
ArgumentInfo,
ParserInfo,
SubcommandInfo,
_extract_argument,
_format_default,
_get_action_name,
_get_type_name,
extract_parser,
)
def test_extract_parser_with_n... | "*" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_parser.py | test_extract_parser_with_nargs | 355 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | check_cmd(".").out | assert | func_call | tests/workspace/test_finder.py | test_find_workspace_file_arg | 340 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tmuxp import exc
from tmuxp.exc import BeforeLoadScriptError, BeforeLoadScriptNotExists
from tmuxp.util import get_session, run_before_script
from .constants import FIXTURE_PATH
def temp_script(tmp_path: pathlib.Path) -> pathlib.Pa... | out | assert | variable | tests/test_util.py | test_run_before_script_isatty | 103 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | configs_found | assert | variable | tests/workspace/test_finder.py | test_get_configs_cwd | 64 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import pytest
from tests._internal.conftest import (
ANSI_BLUE,
ANSI_BOLD,
ANSI_BRIGHT_CYAN,
ANSI_CYAN,
ANSI_GREEN,
ANSI_MAGENTA,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.colors import (
ColorMode,
Colors,
... | "red" | assert | string_literal | tests/_internal/test_colors.py | test_semantic_color_names | 226 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
import pytest
from sphinx_argparse_neo.parser import (
ArgumentInfo,
ParserInfo,
SubcommandInfo,
_extract_argument,
_format_default,
_get_action_name,
_get_type_name,
extract_parser,
)
def test_extract_parser_with_n... | "+" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_parser.py | test_extract_parser_with_nargs | 356 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
from docutils import nodes
from sphinx_argparse_neo.nodes import (
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
from sphinx_argparse_neo.parser import (
... | 3 | assert | numeric_literal | tests/docs/_ext/sphinx_argparse_neo/test_renderer.py | test_render_simple_parser | 109 | null | |
tmux-python/tmuxp | from __future__ import annotations
import re
import typing as t
import pytest
from docutils import nodes
from sphinx_argparse_neo.nodes import (
_generate_argument_id,
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
def tes... | "L" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_nodes.py | test_generate_argument_id_short_option | 272 | null | |
tmux-python/tmuxp | from __future__ import annotations
import re
import typing as t
import pytest
from docutils import nodes
from sphinx_argparse_neo.nodes import (
_generate_argument_id,
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
def tes... | 1 | assert | numeric_literal | tests/docs/_ext/sphinx_argparse_neo/test_nodes.py | test_program_can_contain_usage | 95 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tmuxp._internal.private_path import PrivatePath, collapse_home_in_string
def test_private_path_preserves_tmp(monkeypatch: pytest.MonkeyPatch) -> None:
"""PrivatePath preserves /tmp paths."""
monkeypatch.setattr(pathlib.Path, "home", lambda... | "/tmp/example" | assert | string_literal | tests/_internal/test_private_path.py | test_private_path_preserves_tmp | 43 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | path | assert | variable | tests/workspace/test_finder.py | test_get_workspace_dir_candidates_uses_private_path | 515 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_lexer import (
ArgparseHelpLexer,
ArgparseLexer,
ArgparseUsageLexer,
tokenize_argparse,
tokenize_usage,
)
def get_tokens(text: str, lexer_class: type = ArgparseLexer) -> list[tuple[str, str]]:
"""Get tokens as (... | 2 | assert | numeric_literal | tests/docs/_ext/test_argparse_lexer.py | test_short_option_with_value | 510 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | ("Token.Name.Tag", option) | assert | collection | tests/docs/_ext/test_cli_usage_lexer.py | test_long_option_with_value | 228 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import typing as t
import pytest
from tests.constants import EXAMPLE_PATH
from tmuxp import exc
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.workspace import loader, validation
def load_workspace(path: str | pathlib.Path) -> dict[str, t.Any]:
... | sconfig["before_script"] | assert | complex_expr | tests/workspace/test_config.py | test_replaces_env_variables | 308 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tests._internal.conftest import ANSI_BOLD, ANSI_MAGENTA, ANSI_RESET
from tmuxp._internal.colors import ColorMode, Colors, get_color_mode
def test_color_flag_never_disables_colors(monkeypatch: pytest.MonkeyPatch) -> None:
"""Veri... | "test" | assert | string_literal | tests/_internal/test_colors_integration.py | test_color_flag_never_disables_colors | 59 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import pathlib
import typing as t
import libtmux
import pytest
from libtmux.server import Server
from libtmux.session import Session
from tests.constants import FIXTURE_PATH
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp.... | 1 | assert | numeric_literal | tests/cli/test_load.py | test_load_plugins | 506 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import (
ANSI_BLUE,
ANSI_CYAN,
ANSI_GREEN,
ANSI_RED,
ANSI_RESET,
)
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_import_colors_disabled_plain_text(colors_never: Colors) -... | "info" | assert | string_literal | tests/cli/test_import_colors.py | test_import_colors_disabled_plain_text | 65 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_emit_text_json_silent(capsys: pytest.CaptureFixture[str]) -> None:
"""JSON mode should not output text."""
formatter = OutputFormatter(OutputM... | "" | assert | string_literal | tests/cli/test_output.py | test_emit_text_json_silent | 113 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_output_mode_values() -> None:
"""Verify OutputMode enum values."""
assert OutputMode.HUMAN.value == "human"
assert OutputMode.JSON.value ... | "json" | assert | string_literal | tests/cli/test_output.py | test_output_mode_values | 17 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from sphinx_argparse_neo.compat import (
MockModule,
get_parser_from_entry_point,
get_parser_from_module,
import_module,
mock_imports,
)
def test_get_parser_from_entry_point_with_mock() -> None:
"""Test entry point... | "with_mock" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_compat.py | test_get_parser_from_entry_point_with_mock | 328 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | 2 | assert | numeric_literal | tests/docs/_ext/test_cli_usage_lexer.py | test_short_option_with_value | 178 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_output_mode_members() -> None:
"""Verify all expected members exist."""
members = list(OutputMode)
assert len(members) == 3
assert Ou... | members | assert | variable | tests/cli/test_output.py | test_output_mode_members | 25 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import json
import pathlib
import pytest
from tmuxp import cli
from tmuxp.cli.ls import (
_get_workspace_info,
create_ls_subparser,
)
def test_get_workspace_info_no_session_name(tmp_path: pathlib.Path) -> None:
"""Handle workspace without session_name... | None | assert | none_literal | tests/cli/test_ls.py | test_get_workspace_info_no_session_name | 65 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import subprocess
import pytest
from tmuxp.cli import create_parser
def _get_help_text(subcommand: str | None = None) -> str:
"""Get CLI help text without spawning subprocess.
Parameters
----------
subcommand : str | None
Subcommand name, o... | result.stdout | assert | complex_expr | tests/cli/test_help_examples.py | test_search_no_args_shows_help | 250 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import pathlib
import typing as t
import libtmux
import pytest
from libtmux.server import Server
from libtmux.session import Session
from tests.constants import FIXTURE_PATH
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp.... | 6 | assert | numeric_literal | tests/cli/test_load.py | test_load_append_windows_to_current_session | 755 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import (
ANSI_BLUE,
ANSI_CYAN,
ANSI_GREEN,
ANSI_RED,
ANSI_RESET,
)
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_import_combined_success_format(colors_always: Colors) -> ... | output | assert | variable | tests/cli/test_import_colors.py | test_import_combined_success_format | 73 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_emit_json_buffers_data() -> None:
"""JSON mode should buffer data."""
formatter = OutputFormatter(OutputMode.JSON)
formatter.emit({"name":... | 2 | assert | numeric_literal | tests/cli/test_output.py | test_emit_json_buffers_data | 73 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
import pytest
from sphinx_argparse_neo.parser import (
ArgumentInfo,
ParserInfo,
SubcommandInfo,
_extract_argument,
_format_default,
_get_action_name,
_get_type_name,
extract_parser,
)
def test_extract_parser_with_n... | "?" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_parser.py | test_extract_parser_with_nargs | 354 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import typing as t
import pytest
from tmuxp.workspace.finders import LOCAL_WORKSPACE_FILES, find_local_workspace_files
class TestFindLocalWorkspaceEdgeCases:
def test_yaml_precedence_over_json(
self,
tmp_path: pathlib.Path,
monkeypatch: ... | ".tmuxp.yaml" | assert | string_literal | tests/workspace/test_finders_local.py | test_yaml_precedence_over_json | TestFindLocalWorkspaceEdgeCases | 187 | null |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pytest
from tests.cli.conftest import ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
from tmuxp.cli._formatter import (
HelpTheme,
TmuxpHelpFormatter,
create_themed_formatter,
)
def test_create_themed_formatter_with_colors_enabled(
... | None | assert | none_literal | tests/cli/test_formatter.py | test_create_themed_formatter_with_colors_enabled | 33 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | expect.parent | assert | complex_expr | tests/cli/test_cli.py | test_resolve_behavior | 85 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
from tmuxp.plugin import TmuxpPlugin
class MyTestTmuxpPlugin(TmuxpPlugin):
def __init__(self, **config: Unpack[PluginTestConfigSchema]) -> None:
assert isinstance(config, dict)
tmux_version = config.pop("tmux_version", None)
libtmux_v... | config | assert | variable | tests/fixtures/pluginsystem/partials/test_plugin_helpers.py | __init__ | MyTestTmuxpPlugin | 28 | null |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tmuxp import exc
from tmuxp.exc import BeforeLoadScriptError, BeforeLoadScriptNotExists
from tmuxp.util import get_session, run_before_script
from .constants import FIXTURE_PATH
def test_run_before_script_raise_BeforeLoadScriptNotE... | OSError) | pytest.raises | variable | tests/test_util.py | test_run_before_script_raise_BeforeLoadScriptNotExists_if_not_exists | 29 | null | |
tmux-python/tmuxp | from __future__ import annotations
import json
import typing as t
import pytest
from tmuxp import cli
def test_debug_info_json_no_ansi(
monkeypatch: pytest.MonkeyPatch,
capsys: pytest.CaptureFixture[str],
) -> None:
"""JSON output should not contain ANSI escape codes."""
monkeypatch.setenv("SHELL", ... | output | assert | variable | tests/cli/test_debug_info.py | test_debug_info_json_no_ansi | 147 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import subprocess
import typing as t
import pytest
from tmuxp import cli, exc
@pytest.mark.parametrize(
list(CLIShellFixture._fields),
TEST_SHELL_FIXTURES,
ids=[test.test_id for test in TEST_SHELL_FIXTURES],
)
def test_shell(
test_id: st... | None | assert | none_literal | tests/cli/test_shell.py | test_shell | 218 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import typing as t
import pytest
from tests.constants import EXAMPLE_PATH
from tmuxp import exc
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.workspace import loader, validation
def load_workspace(path: str | pathlib.Path) -> dict[str, t.Any]:
... | sconfig["session_name"] | assert | complex_expr | tests/workspace/test_config.py | test_replaces_env_variables | 309 | null | |
tmux-python/tmuxp | from __future__ import annotations
import io
import json
import sys
import pytest
from tmuxp.cli._output import OutputFormatter, OutputMode, get_output_mode
def test_finalize_json_clears_buffer() -> None:
"""JSON mode finalize should clear the buffer."""
formatter = OutputFormatter(OutputMode.JSON)
form... | 1 | assert | numeric_literal | tests/cli/test_output.py | test_finalize_json_clears_buffer | 144 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_roles import (
cli_choice_role,
cli_command_role,
cli_default_role,
cli_metavar_role,
cli_option_role,
normalize_options,
register_roles,
)
from docutils import nodes
@pytest.mark.parametrize(
list(Optio... | 1 | assert | numeric_literal | tests/docs/_ext/test_argparse_roles.py | test_cli_option_role | 97 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import pytest
from tests._internal.conftest import (
ANSI_BLUE,
ANSI_BOLD,
ANSI_BRIGHT_CYAN,
ANSI_CYAN,
ANSI_GREEN,
ANSI_MAGENTA,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.colors import (
ColorMode,
Colors,
... | result | assert | variable | tests/_internal/test_colors.py | test_success_applies_green | 110 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import ANSI_BLUE, ANSI_BOLD, ANSI_CYAN, ANSI_MAGENTA
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_edit_file_path_uses_info(colors_always: Colors) -> None:
"""Verify file paths use info ... | result | assert | variable | tests/cli/test_edit_colors.py | test_edit_file_path_uses_info | 37 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from sphinx_argparse_neo.compat import (
MockModule,
get_parser_from_entry_point,
get_parser_from_module,
import_module,
mock_imports,
)
def test_get_parser_from_entry_point_with_class() -> None:
"""Test entry poin... | "factory" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_compat.py | test_get_parser_from_entry_point_with_class | 304 | null | |
tmux-python/tmuxp | from __future__ import annotations
import json
import pathlib
import re
import typing as t
import pytest
from tmuxp.cli._colors import ColorMode, Colors
from tmuxp.cli._output import OutputFormatter, OutputMode
from tmuxp.cli.search import (
DEFAULT_FIELDS,
InvalidFieldError,
SearchPattern,
SearchTok... | True | assert | bool_literal | tests/cli/test_search.py | test_evaluate_match_single_pattern | 458 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pytest
from tests.cli.conftest import ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
from tmuxp.cli._formatter import (
HelpTheme,
TmuxpHelpFormatter,
create_themed_formatter,
)
def test_fill_text_multiple_example_sections_all_coloriz... | 6 | assert | numeric_literal | tests/cli/test_formatter.py | test_fill_text_multiple_example_sections_all_colorized | 264 | null | |
tmux-python/tmuxp | from __future__ import annotations
from tests.cli.conftest import ANSI_BLUE, ANSI_BOLD, ANSI_CYAN, ANSI_MAGENTA
from tmuxp.cli._colors import Colors
def test_shell_highlight_not_bold(colors_always: Colors) -> None:
"""Verify shell name uses highlight without bold for subtlety."""
result = colors_always.highli... | result | assert | variable | tests/cli/test_shell_colors.py | test_shell_highlight_not_bold | 45 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import (
ANSI_BLUE,
ANSI_CYAN,
ANSI_GREEN,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_freeze_colors_disabled_plain_text(colors... | "info" | assert | string_literal | tests/cli/test_freeze_colors.py | test_freeze_colors_disabled_plain_text | 66 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | tokens | assert | variable | tests/docs/_ext/test_cli_usage_lexer.py | test_usage_string | 304 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | expect | assert | variable | tests/workspace/test_finder.py | test_is_pure_name | 145 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | pathlib.Path("/moo/.tmuxinator/") | assert | func_call | tests/cli/test_cli.py | test_get_tmuxinator_dir | 98 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import typing as t
import pytest
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
@pytest.mark.parametrize(
list(FreezeTestFixture._fields),
FREEZE_TEST_FIXTURES,
ids=[test.test_id for test in FREEZE_TEST_FIXTURES... | None | assert | none_literal | tests/cli/test_freeze.py | test_freeze | 103 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import pytest
from tests._internal.conftest import (
ANSI_BLUE,
ANSI_BOLD,
ANSI_BRIGHT_CYAN,
ANSI_CYAN,
ANSI_GREEN,
ANSI_MAGENTA,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.colors import (
ColorMode,
Colors,
... | True | assert | bool_literal | tests/_internal/test_colors.py | test_auto_tty_enabled | 38 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import pytest
from tests._internal.conftest import (
ANSI_BLUE,
ANSI_BOLD,
ANSI_BRIGHT_CYAN,
ANSI_CYAN,
ANSI_GREEN,
ANSI_MAGENTA,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.colors import (
ColorMode,
Colors,
... | "test" | assert | string_literal | tests/_internal/test_colors.py | test_never_mode_disables | 86 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_exemplar import ( # type: ignore[import-not-found]
ExemplarConfig,
_extract_sections_from_container,
_is_examples_section,
_is_usage_block,
_reorder_nodes,
is_base_examples_term,
is_examples_term,
make_s... | [] | assert | collection | tests/docs/_ext/test_argparse_exemplar.py | test_reorder_nodes_empty_list | 767 | null | |
tmux-python/tmuxp | from __future__ import annotations
import json
import pathlib
import re
import typing as t
import pytest
from tmuxp.cli._colors import ColorMode, Colors
from tmuxp.cli._output import OutputFormatter, OutputMode
from tmuxp.cli.search import (
DEFAULT_FIELDS,
InvalidFieldError,
SearchPattern,
SearchTok... | 0 | assert | numeric_literal | tests/cli/test_search.py | test_find_search_matches_no_match | 581 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | pathlib.Path("~/.teamocil/").expanduser() | assert | func_call | tests/cli/test_cli.py | test_get_teamocil_dir | 107 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | ("Token.Generic.Heading", "usage:") | assert | collection | tests/docs/_ext/test_cli_usage_lexer.py | test_tokenize_usage_helper | 356 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | ("Token.Name.Attribute", option) | assert | collection | tests/docs/_ext/test_cli_usage_lexer.py | test_short_option_with_value | 179 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import ANSI_BLUE, ANSI_BOLD, ANSI_CYAN, ANSI_MAGENTA
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_edit_opening_message_format(colors_always: Colors) -> None:
"""Verify opening message f... | output | assert | variable | tests/cli/test_edit_colors.py | test_edit_opening_message_format | 26 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | check_cmd(".tmuxp.json").out | assert | func_call | tests/cli/test_cli.py | test_pass_config_dir_argparse | 148 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import json
import pathlib
import pytest
from tmuxp import cli
from tmuxp.cli.ls import (
_get_workspace_info,
create_ls_subparser,
)
def test_ls_json_includes_source_for_local(
monkeypatch: pytest.MonkeyPatch,
tmp_path: pathlib.Path,
capsys: ... | 1 | assert | numeric_literal | tests/cli/test_ls.py | test_ls_json_includes_source_for_local | 388 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pytest
from tests.cli.conftest import ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
from tmuxp.cli._formatter import (
HelpTheme,
TmuxpHelpFormatter,
create_themed_formatter,
)
def test_fill_text_with_theme_colorizes_examples(
mo... | result | assert | variable | tests/cli/test_formatter.py | test_fill_text_with_theme_colorizes_examples | 82 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from sphinx_argparse_neo.compat import (
MockModule,
get_parser_from_entry_point,
get_parser_from_module,
import_module,
mock_imports,
)
def test_mock_imports_adds_to_sys_modules() -> None:
"""Test that mock_import... | sys.modules | assert | complex_expr | tests/docs/_ext/sphinx_argparse_neo/test_compat.py | test_mock_imports_adds_to_sys_modules | 80 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_exemplar import ( # type: ignore[import-not-found]
ExemplarConfig,
_extract_sections_from_container,
_is_examples_section,
_is_usage_block,
_reorder_nodes,
is_base_examples_term,
is_examples_term,
make_s... | "$ " | assert | string_literal | tests/docs/_ext/test_argparse_exemplar.py | test_exemplar_config_defaults | 835 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tmuxp._internal.private_path import PrivatePath, collapse_home_in_string
def test_private_path_preserves_non_home(monkeypatch: pytest.MonkeyPatch) -> None:
"""PrivatePath preserves paths outside home directory."""
monkeypatch.setattr(pathl... | "/usr/bin/tmux" | assert | string_literal | tests/_internal/test_private_path.py | test_private_path_preserves_non_home | 35 | null | |
tmux-python/tmuxp | from __future__ import annotations
import re
import typing as t
import pytest
from docutils import nodes
from sphinx_argparse_neo.nodes import (
_generate_argument_id,
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
def tes... | None | assert | none_literal | tests/docs/_ext/sphinx_argparse_neo/test_nodes.py | test_node_get_with_default | 208 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | result.out | assert | complex_expr | tests/cli/test_cli.py | test_help | 75 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_exemplar import ( # type: ignore[import-not-found]
ExemplarConfig,
_extract_sections_from_container,
_is_examples_section,
_is_usage_block,
_reorder_nodes,
is_base_examples_term,
is_examples_term,
make_s... | 2 | assert | numeric_literal | tests/docs/_ext/test_argparse_exemplar.py | test_transform_definition_list_multiple_categories | 405 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.