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 |
|---|---|---|---|---|---|---|---|---|---|
python-lsp/python-lsp-server | import sys
from pylsp import lsp, uris
from pylsp.plugins import pyflakes_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pass
"""
DOC_UNDEFINED_NAME_ERR = "a = b"
DOC_ENCODING = """# encod... | "'sys' imported but unused" | assert | string_literal | test/plugins/test_pyflakes_lint.py | test_unicode_encoding | 69 | null | |
python-lsp/python-lsp-server | import multiprocessing
import os
import sys
import time
from threading import Thread
from typing import Any
from unittest import mock
from docstring_to_markdown import UnknownFormatError
from flaky import flaky
from pylsp import _utils
from pylsp.lsp import NotebookCellKind
from pylsp.python_lsp import PythonLSPServe... | [ mock.call(1), mock.call(2), mock.call(3), ]) | assert_* | collection | test/test_utils.py | test_debounce_keyed_by | 168 | null | |
python-lsp/python-lsp-server | import sys
from pylsp import lsp, uris
from pylsp.plugins import pyflakes_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pass
"""
DOC_UNDEFINED_NAME_ERR = "a = b"
DOC_ENCODING = """# encod... | {"line": 0, "character": 0} | assert | collection | test/plugins/test_pyflakes_lint.py | test_pyflakes | 39 | null | |
python-lsp/python-lsp-server | import pytest
from pylsp import uris
from pylsp.plugins.yapf_format import pylsp_format_document, pylsp_format_range
from pylsp.text_edit import apply_text_edits
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """A = [
'h', 'w',
'a'
]
B = ['h',
'w']
"""
GOOD_DOC =... | f"import os{newline}import sys{2 * newline}dict(a=1){newline}" | assert | string_literal | test/plugins/test_yapf_format.py | test_line_endings | 76 | null | |
python-lsp/python-lsp-server | import os
from pylsp import uris
from pylsp.plugins.hover import pylsp_hover
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """
def main(a: float, b: float):
\"\"\"hello world\"\"\"
pass
"""
NUMPY_DOC = """
import numpy as np
np.sin
"""
def test_numpy_hover(workspace) ->... | pylsp_hover(doc._config, doc, numpy_hov_position_2)["contents"]["value"] | assert | func_call | test/plugins/test_hover.py | test_numpy_hover | 50 | null | |
python-lsp/python-lsp-server | import multiprocessing
import os
import sys
import time
from threading import Thread
from typing import Any
from unittest import mock
from docstring_to_markdown import UnknownFormatError
from flaky import flaky
from pylsp import _utils
from pylsp.lsp import NotebookCellKind
from pylsp.python_lsp import PythonLSPServe... | 0 | assert | numeric_literal | test/test_utils.py | test_clip_column | 208 | null | |
python-lsp/python-lsp-server | import os
import pytest
from pylsp import lsp, uris
from pylsp.plugins import pycodestyle_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello( ):
\tpass
print("hello"
,"world"
)
import json
"""
def test_pycodestyle(workspace) -> None:
doc = Document... | "W391" | assert | string_literal | test/plugins/test_pycodestyle_lint.py | test_pycodestyle | 45 | null | |
python-lsp/python-lsp-server | import os
import pytest
from pylsp import uris
from pylsp.plugins.references import pylsp_references
from pylsp.workspace import Document
DOC1_NAME = "test1.py"
DOC2_NAME = "test2.py"
DOC1 = """class Test1():
pass
"""
DOC2 = """from test1 import Test1
try:
Test1()
except UnicodeError:
pass
"""
def tm... | 3 | assert | numeric_literal | test/plugins/test_references.py | test_references | 47 | null | |
python-lsp/python-lsp-server | import math
import os
import sys
from pathlib import Path
from typing import NamedTuple
import pytest
from pylsp import lsp, uris
from pylsp._utils import JEDI_VERSION
from pylsp.plugins.jedi_completion import (
pylsp_completion_item_resolve as pylsp_jedi_completion_item_resolve,
)
from pylsp.plugins.jedi_complet... | "date" | assert | string_literal | test/plugins/test_completion.py | test_multiline_import_snippets | 436 | null | |
python-lsp/python-lsp-server | import os
import sys
import time
import pytest
from flaky import flaky
from pylsp_jsonrpc.exceptions import JsonRpcMethodNotFound
from test.test_utils import ClientServerPair, send_initialize_request
RUNNING_IN_CI = bool(os.environ.get("CI"))
CALL_TIMEOUT_IN_SECONDS = 10
@pytest.fixture
def client_exited_server() ... | False | assert | bool_literal | test/test_language_server.py | client_exited_server | 28 | null | |
python-lsp/python-lsp-server | import os
import pathlib
import pytest
from pylsp import uris
DOC_URI = uris.from_fs_path(__file__)
NOTEBOOK_URI = uris.from_fs_path("notebook_uri")
def path_as_uri(path):
return pathlib.Path(os.path.abspath(path)).as_uri()
def test_no_progress_without_capability(workspace, consumer) -> None:
workspace._co... | 0 | assert | numeric_literal | test/test_workspace.py | test_no_progress_without_capability | 299 | null | |
python-lsp/python-lsp-server | import multiprocessing
import os
import sys
import time
from threading import Thread
from typing import Any
from unittest import mock
from docstring_to_markdown import UnknownFormatError
from flaky import flaky
from pylsp import _utils
from pylsp.lsp import NotebookCellKind
from pylsp.python_lsp import PythonLSPServe... | 3 | assert | numeric_literal | test/test_utils.py | test_debounce_keyed_by | 176 | null | |
python-lsp/python-lsp-server | import time
from unittest.mock import call, patch
import pytest
from pylsp import IS_WIN
from pylsp.lsp import NotebookCellKind
from pylsp.workspace import Notebook
from test.test_utils import (
CALL_TIMEOUT_IN_SECONDS,
send_initialize_request,
send_notebook_did_open,
)
def wait_for_condition(condition, ... | None | assert | none_literal | test/test_notebook_document.py | test_initialize | 31 | null | |
python-lsp/python-lsp-server | import sys
from pylsp import lsp, uris
from pylsp.plugins import pyflakes_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pass
"""
DOC_UNDEFINED_NAME_ERR = "a = b"
DOC_ENCODING = """# encod... | {"line": 0, "character": 12} | assert | collection | test/plugins/test_pyflakes_lint.py | test_syntax_error_pyflakes | 51 | null | |
python-lsp/python-lsp-server | import os
import pytest
from pylsp import uris
from pylsp.plugins.references import pylsp_references
from pylsp.workspace import Document
DOC1_NAME = "test1.py"
DOC2_NAME = "test2.py"
DOC1 = """class Test1():
pass
"""
DOC2 = """from test1 import Test1
try:
Test1()
except UnicodeError:
pass
"""
def tm... | ranges | assert | variable | test/plugins/test_references.py | test_references_builtin | 82 | null | |
python-lsp/python-lsp-server | from pylsp.workspace import Document
from test.fixtures import DOC, DOC_URI
def test_document_props(doc) -> None:
assert doc.uri == DOC_URI
assert doc.source == | DOC | assert | variable | test/test_document.py | test_document_props | 10 | null | |
python-lsp/python-lsp-server | import os
import sys
import pytest
from pylsp import uris
from pylsp.lsp import SymbolKind
from pylsp.plugins.symbols import pylsp_document_symbols
from pylsp.workspace import Document
PY2 = sys.version[0] == "2"
LINUX = sys.platform.startswith("linux")
CI = os.environ.get("CI")
DOC_URI = uris.from_fs_path(__file__)... | {"line": 2, "character": 0} | assert | collection | test/plugins/test_symbols.py | test_symbols | 80 | null | |
python-lsp/python-lsp-server | import contextlib
import os
import tempfile
from pathlib import Path
from pylsp import lsp, uris
from pylsp.plugins import pylint_lint
from pylsp.workspace import Document, Workspace
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pa... | diag | assert | variable | test/plugins/test_pylint_lint.py | test_syntax_error_pylint | 80 | null | |
python-lsp/python-lsp-server | import os
from pylsp import uris
from pylsp.plugins.hover import pylsp_hover
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """
def main(a: float, b: float):
\"\"\"hello world\"\"\"
pass
"""
NUMPY_DOC = """
import numpy as np
np.sin
"""
def test_document_path_hover(works... | contents["value"] | assert | complex_expr | test/plugins/test_hover.py | test_document_path_hover | 145 | null | |
python-lsp/python-lsp-server | import math
import os
import sys
from pathlib import Path
from typing import NamedTuple
import pytest
from pylsp import lsp, uris
from pylsp._utils import JEDI_VERSION
from pylsp.plugins.jedi_completion import (
pylsp_completion_item_resolve as pylsp_jedi_completion_item_resolve,
)
from pylsp.plugins.jedi_complet... | 2 | assert | numeric_literal | test/plugins/test_completion.py | test_completion_with_class_objects | 374 | null | |
python-lsp/python-lsp-server | from pylsp.workspace import Document
from test.fixtures import DOC, DOC_URI
def test_word_at_position(doc) -> None:
"""Return the position under the cursor (or last in line if past the end)"""
# import sys
assert doc.word_at_position({"line": 0, "character": 8}) == "sys"
# Past end of import sys
as... | "def" | assert | string_literal | test/test_document.py | test_word_at_position | 41 | null | |
python-lsp/python-lsp-server | import contextlib
import os
import tempfile
from pathlib import Path
from pylsp import lsp, uris
from pylsp.plugins import pylint_lint
from pylsp.workspace import Document, Workspace
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pa... | {"line": 0, "character": 0} | assert | collection | test/plugins/test_pylint_lint.py | test_pylint | 51 | null | |
python-lsp/python-lsp-server | from typing import Any
from unittest.mock import Mock, patch
import jedi
import parso
import pytest
from pylsp import IS_WIN, lsp, uris
from pylsp.config.config import Config
from pylsp.plugins.rope_autoimport import (
_get_score,
_should_insert,
cache,
get_name_or_module,
get_names,
)
from pylsp.... | {"blah", "bleh", "e", "hello", "someone", "sfa", "a", "b"} | assert | collection | test/plugins/test_autoimport.py | test_get_names | 232 | null | |
python-lsp/python-lsp-server | import contextlib
import os
import tempfile
from pathlib import Path
from pylsp import lsp, uris
from pylsp.plugins import pylint_lint
from pylsp.workspace import Document, Workspace
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pa... | [lsp.DiagnosticTag.Unnecessary] | assert | collection | test/plugins/test_pylint_lint.py | test_pylint | 53 | null | |
python-lsp/python-lsp-server | import contextlib
import os
import tempfile
from pathlib import Path
from pylsp import lsp, uris
from pylsp.plugins import pylint_lint
from pylsp.workspace import Document, Workspace
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pa... | diags | assert | variable | test/plugins/test_pylint_lint.py | test_lint_caching | 123 | null | |
python-lsp/python-lsp-server | import pytest
from pylsp import uris
from pylsp.plugins import signature
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def main(param1, param2):
\"\"\" Main docstring
Args:
param1 (str): Docs for param1
\"\"\"
raise Exception()
main(
"""
MUL... | { "kind": "markdown", "value": "Docs for param1", } | assert | collection | test/plugins/test_signature.py | test_signature | 65 | null | |
python-lsp/python-lsp-server | import pytest
from pylsp import uris
from pylsp.plugins.yapf_format import pylsp_format_document, pylsp_format_range
from pylsp.text_edit import apply_text_edits
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """A = [
'h', 'w',
'a'
]
B = ['h',
'w']
"""
GOOD_DOC =... | ' log("hi")\n' | assert | string_literal | test/plugins/test_yapf_format.py | test_format_returns_text_edit_per_line | 115 | null | |
python-lsp/python-lsp-server | import time
from unittest.mock import call, patch
import pytest
from pylsp import IS_WIN
from pylsp.lsp import NotebookCellKind
from pylsp.workspace import Notebook
from test.test_utils import (
CALL_TIMEOUT_IN_SECONDS,
send_initialize_request,
send_notebook_did_open,
)
def wait_for_condition(condition, ... | 3 | assert | numeric_literal | test/test_notebook_document.py | test_notebook_definition | 467 | null | |
python-lsp/python-lsp-server | import os
import sys
import time
import pytest
from flaky import flaky
from pylsp_jsonrpc.exceptions import JsonRpcMethodNotFound
from test.test_utils import ClientServerPair, send_initialize_request
RUNNING_IN_CI = bool(os.environ.get("CI"))
CALL_TIMEOUT_IN_SECONDS = 10
def client_exited_server() -> None:
"""... | JsonRpcMethodNotFound) | pytest.raises | variable | test/test_language_server.py | test_missing_message | 83 | null | |
python-lsp/python-lsp-server | import pytest
from pylsp import uris
from test import unix_only, windows_only
@unix_only
@pytest.mark.parametrize(
"path,uri",
[
("/foo/bar", "file:///foo/bar"),
("/foo/space ?bar", "file:///foo/space%20%3Fbar"),
],
)
def test_from_fs_path(path, uri) -> None:
assert uris.from_fs_path(... | uri | assert | variable | test/test_uris.py | test_from_fs_path | 45 | null | |
python-lsp/python-lsp-server | from pylsp.workspace import Document
from test.fixtures import DOC, DOC_URI
def test_offset_at_position(doc) -> None:
assert doc.offset_at_position({"line": 0, "character": 8}) == | 8 | assert | numeric_literal | test/test_document.py | test_offset_at_position | 25 | null | |
python-lsp/python-lsp-server | import pytest
from pylsp import uris
from pylsp.plugins.yapf_format import pylsp_format_document, pylsp_format_range
from pylsp.text_edit import apply_text_edits
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """A = [
'h', 'w',
'a'
]
B = ['h',
'w']
"""
GOOD_DOC =... | FOUR_SPACE_DOC.replace(" ", " ") | assert | func_call | test/plugins/test_yapf_format.py | test_format_with_tab_size_option | 86 | null | |
python-lsp/python-lsp-server | import os
import pytest
from pylsp import lsp, uris
from pylsp.plugins import pycodestyle_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello( ):
\tpass
print("hello"
,"world"
)
import json
"""
def test_pycodestyle(workspace) -> None:
doc = Document... | "W191" | assert | string_literal | test/plugins/test_pycodestyle_lint.py | test_pycodestyle | 37 | null | |
python-lsp/python-lsp-server | import os
import pytest
from pylsp import uris
from pylsp.plugins.references import pylsp_references
from pylsp.workspace import Document
DOC1_NAME = "test1.py"
DOC2_NAME = "test2.py"
DOC1 = """class Test1():
pass
"""
DOC2 = """from test1 import Test1
try:
Test1()
except UnicodeError:
pass
"""
def tm... | {"line": 3, "character": 9} | assert | collection | test/plugins/test_references.py | test_references | 65 | null | |
python-lsp/python-lsp-server | import os
from io import StringIO
from unittest.mock import MagicMock
import pytest
from pylsp_jsonrpc.dispatchers import MethodDispatcher
from pylsp_jsonrpc.endpoint import Endpoint
from pylsp_jsonrpc.exceptions import JsonRpcException
from pylsp import uris
from pylsp.config.config import Config
from pylsp.python_l... | None | assert | none_literal | test/fixtures.py | client_server_pair | 178 | null | |
python-lsp/python-lsp-server | import os
import pytest
from pylsp import lsp, uris
from pylsp.plugins import pycodestyle_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello( ):
\tpass
print("hello"
,"world"
)
import json
"""
def test_pycodestyle(workspace) -> None:
doc = Document... | {"line": 3, "character": 0} | assert | collection | test/plugins/test_pycodestyle_lint.py | test_pycodestyle | 39 | null | |
python-lsp/python-lsp-server | import contextlib
import os
import tempfile
from pathlib import Path
from pylsp import lsp, uris
from pylsp.plugins import pylint_lint
from pylsp.workspace import Document, Workspace
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pa... | { "line": 0, "character": 0, } | assert | collection | test/plugins/test_pylint_lint.py | test_pylint | 62 | null | |
python-lsp/python-lsp-server | from pylsp import lsp, uris
from pylsp.plugins import mccabe_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """def hello():
\tpass
"""
DOC_SYNTAX_ERR = """def hello()
\tpass"""
def test_mccabe(config, workspace) -> None:
old_settings = config.settings
try:
confi... | {"line": 0, "character": 6} | assert | collection | test/plugins/test_mccabe_lint.py | test_mccabe | 32 | null | |
python-lsp/python-lsp-server | import os
from pylsp import lsp, uris
from pylsp.plugins import pydocstyle_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(os.path.join(os.path.dirname(__file__), "pydocstyle.py"))
TEST_DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
def test_pyd... | "D100: Missing docstring in public module" | assert | string_literal | test/plugins/test_pydocstyle_lint.py | test_pydocstyle_empty_source | 51 | null | |
python-lsp/python-lsp-server | from pylsp.workspace import Document
from test.fixtures import DOC, DOC_URI
def test_document_line_edit(workspace) -> None:
doc = Document("file:///uri", workspace, "itshelloworld")
doc.apply_change(
{
"text": "goodbye",
"range": {
"start": {"line": 0, "character... | "itsgoodbyeworld" | assert | string_literal | test/test_document.py | test_document_line_edit | 71 | null | |
python-lsp/python-lsp-server | import os
import pytest
from pylsp import uris
from pylsp.plugins.jedi_rename import pylsp_rename
from pylsp.workspace import Document
DOC_NAME = "test1.py"
DOC = """class Test1():
pass
class Test2(Test1):
pass
"""
DOC_NAME_EXTRA = "test2.py"
DOC_EXTRA = """from test1 import Test1
x = Test1()
"""
DOC_NAME... | 2 | assert | numeric_literal | test/plugins/test_jedi_rename.py | test_jedi_rename | 46 | null | |
python-lsp/python-lsp-server | import pytest
from pylsp import uris
from pylsp.plugins.yapf_format import pylsp_format_document, pylsp_format_range
from pylsp.text_edit import apply_text_edits
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """A = [
'h', 'w',
'a'
]
B = ['h',
'w']
"""
GOOD_DOC =... | 4 | assert | numeric_literal | test/plugins/test_yapf_format.py | test_format_returns_text_edit_per_line | 111 | null | |
python-lsp/python-lsp-server | import time
from unittest.mock import call, patch
import pytest
from pylsp import IS_WIN
from pylsp.lsp import NotebookCellKind
from pylsp.workspace import Notebook
from test.test_utils import (
CALL_TIMEOUT_IN_SECONDS,
send_initialize_request,
send_notebook_did_open,
)
def wait_for_condition(condition, ... | 2 | assert | numeric_literal | test/test_notebook_document.py | test_workspace_did_change_configuration | 68 | null | |
python-lsp/python-lsp-server | import os
import tempfile
from textwrap import dedent
from unittest.mock import patch
from pylsp import lsp, uris
from pylsp.plugins import flake8_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import pylsp
t = "TEST"
def using_const():
\ta = 8 + 9
\treturn t
"""
def temp_... | 2 | assert | numeric_literal | test/plugins/test_flake8_lint.py | test_flake8_multiline | 186 | null | |
python-lsp/python-lsp-server | from typing import Any
from unittest.mock import Mock, patch
import jedi
import parso
import pytest
from pylsp import IS_WIN, lsp, uris
from pylsp.config.config import Config
from pylsp.plugins.rope_autoimport import (
_get_score,
_should_insert,
cache,
get_name_or_module,
get_names,
)
from pylsp.... | "pathlib" | assert | string_literal | test/plugins/test_autoimport.py | test_autoimport_pathlib | 103 | null | |
python-lsp/python-lsp-server | from pylsp import uris
from pylsp.plugins.type_definition import pylsp_type_definition
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """\
from dataclasses import dataclass
@dataclass
class IntPair:
a: int
b: int
def main() -> None:
l0 = list(1, 2)
my_pair = IntPair... | pylsp_type_definition( config, doc, cursor_pos ) | assert | func_call | test/plugins/test_type_definition.py | test_type_definitions | 35 | null | |
python-lsp/python-lsp-server | import os
from pylsp import uris
from pylsp.plugins.hover import pylsp_hover
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """
def main(a: float, b: float):
\"\"\"hello world\"\"\"
pass
"""
NUMPY_DOC = """
import numpy as np
np.sin
"""
def test_hover(workspace) -> None:... | pylsp_hover(doc._config, doc, hov_position) | assert | func_call | test/plugins/test_hover.py | test_hover | 87 | null | |
python-lsp/python-lsp-server | from pylsp.workspace import Document
from test.fixtures import DOC, DOC_URI
def test_document_lines(doc) -> None:
assert len(doc.lines) == | 4 | assert | numeric_literal | test/test_document.py | test_document_lines | 14 | null | |
python-lsp/python-lsp-server | import os
from pylsp import lsp, uris
from pylsp.plugins import pydocstyle_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(os.path.join(os.path.dirname(__file__), "pydocstyle.py"))
TEST_DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
def test_pyd... | 1 | assert | numeric_literal | test/plugins/test_pydocstyle_lint.py | test_pydocstyle_empty_source | 52 | null | |
python-lsp/python-lsp-server | import sys
from pylsp import lsp, uris
from pylsp.plugins import pyflakes_lint
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pass
"""
DOC_UNDEFINED_NAME_ERR = "a = b"
DOC_ENCODING = """# encod... | {"line": 0, "character": 4} | assert | collection | test/plugins/test_pyflakes_lint.py | test_undefined_name_pyflakes | 60 | null | |
python-lsp/python-lsp-server | import os
import pathlib
import pytest
from pylsp import uris
DOC_URI = uris.from_fs_path(__file__)
NOTEBOOK_URI = uris.from_fs_path("notebook_uri")
def path_as_uri(path):
return pathlib.Path(os.path.abspath(path)).as_uri()
@pytest.mark.skipif(os.name == "nt", reason="Fails on Windows")
def test_workspace_load... | 20 | assert | numeric_literal | test/test_workspace.py | test_workspace_loads_pycodestyle_config | 268 | null | |
python-lsp/python-lsp-server | from pylsp import uris
from pylsp.text_edit import OverLappingTextEditException, apply_text_edits
DOC_URI = uris.from_fs_path(__file__)
def test_apply_text_edits_replace(pylsp) -> None:
pylsp.workspace.put_document(DOC_URI, "012345678901234567890123456789")
test_doc = pylsp.workspace.get_document(DOC_URI)
... | "012HelloWorld678901234567890123456789" | assert | string_literal | test/test_text_edit.py | test_apply_text_edits_replace | 152 | null | |
python-lsp/python-lsp-server | import contextlib
import os
import tempfile
from pathlib import Path
from pylsp import lsp, uris
from pylsp.plugins import pylint_lint
from pylsp.workspace import Document, Workspace
DOC_URI = uris.from_fs_path(__file__)
DOC = """import sys
def hello():
\tpass
import json
"""
DOC_SYNTAX_ERR = """def hello()
pa... | lsp.DiagnosticSeverity.Error | assert | complex_expr | test/plugins/test_pylint_lint.py | test_syntax_error_pylint | 79 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import MimeTypes, Steamship, Task, TaskState
from steamship.data.plugin.index_plugin_instance import SearchResults
@pytest.mark.usefixtures("client")
def test_indexer_pipeline_mixin(clie... | 0 | assert | numeric_literal | tests/steamship_tests/app/integration/test_e2e_mixins_indexer_pipeline.py | test_indexer_pipeline_mixin | 34 | null | |
steamship-core/python-client | import time
import pytest
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship_tests.utils.fixtures import get_steamship_client
from steamship import File
@pytest.mark.skip(
reason="article tagging depends on a classifier plugin that needs to be re... | 1 | assert | numeric_literal | tests/steamship_tests/app/integration/test_article_tagging.py | test_article_tagging | 53 | null | |
steamship-core/python-client | import pytest
import requests
from assets.packages.transports.mock_slack_api import MockSlackApi
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import File, Steamship
config_template = {
"telegram_token": {"type": "string"},
"telegram_api_... | 2 | assert | numeric_literal | tests/steamship_tests/agents/transports/test_slack.py | test_slack | 75 | null | |
steamship-core/python-client | from steamship_tests.utils.fixtures import get_steamship_client
from steamship import File
from steamship.base import TaskState
def test_file_upload_then_parse():
steamship = get_steamship_client()
a = File.create(
steamship,
content="This is a test.",
)
assert a.id is not None
q... | 1 | assert | numeric_literal | tests/steamship_tests/client/operations/test_blockify.py | test_file_upload_then_parse | 28 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.invocable import PackageService
@pytest.mark.usefixtures("client")
def test_multi_inheritance_first_class_instance_init(client: Steamship):
class PackageServiceA(PackageService):
a = 0
def instance_init(self):
self.a += 1
... | 0 | assert | numeric_literal | tests/steamship_tests/app/unit/test_multi_inheritance.py | test_multi_inheritance_first_class_instance_init | 65 | null | |
steamship-core/python-client | import os
import webbrowser
from unittest import mock
import pytest
from pydantic import ValidationError
from steamship import Configuration, SteamshipError
from steamship.base.configuration import DEFAULT_API_BASE, DEFAULT_APP_BASE, DEFAULT_WEB_BASE
TEST_WEB_BASE = "https://app.test.com/"
TEST_APP_BASE = "https://t... | None | assert | none_literal | tests/steamship_tests/base/test_configuration.py | test_empty_base_uris | 48 | null | |
steamship-core/python-client | import json
import logging
import time
from typing import Any, List, Optional, Union
import pytest
import requests
import sseclient
from pydantic.fields import PrivateAttr
from steamship_tests import SRC_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import Block, File, Steamship, St... | 1 | assert | numeric_literal | tests/steamship_tests/agents/test_agent_service.py | test_non_cacheable_tool_actions | 145 | null | |
steamship-core/python-client | import pytest
from steamship import DocTag, Steamship
from steamship.agents.llms import OpenAI
from steamship.agents.schema import AgentContext
from steamship.agents.tools.question_answering import VectorSearchQATool
from steamship.agents.utils import with_llm
from steamship.data import TagKind
from steamship.invocabl... | 1 | assert | numeric_literal | tests/steamship_tests/agents/tools/test_vector_search_qa_tool.py | test_vector_search_qa_tool | 24 | null | |
steamship-core/python-client | from typing import Optional
from assets.packages.configurable_hello_world import HelloWorld
from pydantic import Field
from steamship.invocable.config import Config, ConfigParameterType
def test_config_parameters():
config_template = HelloWorld.get_config_parameters()
assert len(config_template) == | 4 | assert | numeric_literal | tests/steamship_tests/app/unit/test_config_template_extraction.py | test_config_parameters | 11 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import PackageInstance, Steamship
@pytest.mark.usefixtures("client")
def test_configurable_instance_invoke(client: Steamship):
greeting1 = "Hola"
config_template = {
"gre... | instance3.id | assert | complex_expr | tests/steamship_tests/app/integration/test_configurable_package_instance.py | test_configurable_instance_invoke | 74 | null | |
steamship-core/python-client | from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship_tests.utils.fixtures import get_steamship_client
def test_returns_list():
client = get_steamship_client()
demo_package_path = PACKAGES_PATH / "returns_list.py"
with deploy_package(client,... | 3 | assert | numeric_literal | tests/steamship_tests/app/integration/test_returns_list.py | test_returns_list | 14 | null | |
steamship-core/python-client | import pytest
from steamship import File, Steamship
from steamship.invocable import PackageService
from steamship.invocable.mixins.indexer_pipeline_mixin import IndexerPipelineMixin
@pytest.mark.usefixtures("client")
def test_set_file_status(client: Steamship):
"""Tests that we can inspect the package and mixin r... | "status" | assert | string_literal | tests/steamship_tests/app/unit/test_indexer_pipeline_mixin.py | test_set_file_status | 19 | null | |
steamship-core/python-client | import uuid
import pytest
from steamship_tests.utils.fixtures import get_steamship_client
from steamship import PluginInstance, SteamshipError, Workspace
from steamship.data.plugin import Plugin, PluginAdapterType, PluginType
from steamship.data.user import User
def test_plugin_instance_quick_create():
steamship... | p2.id | assert | complex_expr | tests/steamship_tests/data/test_plugins.py | test_plugin_instance_quick_create | 144 | null | |
steamship-core/python-client | import uuid
import pytest
from steamship_tests.utils.fixtures import get_steamship_client
from steamship import SteamshipError, Workspace
from steamship.base.request import SortOrder
def test_create_use_delete_workspace():
client = get_steamship_client()
default = Workspace.get(client=client)
test_one = ... | test_one | assert | variable | tests/steamship_tests/data/test_workspace.py | test_create_use_delete_workspace | 71 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import MimeTypes, Steamship, Task, TaskState
from steamship.data.plugin.index_plugin_instance import SearchResults
@pytest.mark.usefixtures("client")
def test_indexer_pipeline_mixin(clie... | 1 | assert | numeric_literal | tests/steamship_tests/app/integration/test_e2e_mixins_indexer_pipeline.py | test_indexer_pipeline_mixin | 28 | null | |
steamship-core/python-client | import pytest
from assets.packages.package_with_mixins import PackageWithMixin, TestMixin
from steamship import SteamshipError
from steamship.invocable import (
Invocable,
InvocableRequest,
InvocableResponse,
Invocation,
PackageService,
post,
)
from steamship.utils.url import Verb
def invoke(o... | 5 | assert | numeric_literal | tests/steamship_tests/app/unit/test_mixins.py | test_package_with_mixin_routes | 43 | null | |
steamship-core/python-client | import pytest
from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_index, random_name
from steamship import SteamshipError, Tag
from steamship.data.embeddings import EmbeddedItem
_TEST_EMBEDDER = "test-embedder"
def _list_equal(actual, expected):
assert ... | a1 | assert | variable | tests/steamship_tests/client/operations/test_embedding_index.py | test_index_usage | 169 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import MimeTypes, Steamship, Task, TaskState
from steamship.data.plugin.index_plugin_instance import SearchResults
@pytest.mark.usefixtures("client")
def test_indexer_pipeline_mixin(clie... | True | assert | bool_literal | tests/steamship_tests/app/integration/test_e2e_mixins_indexer_pipeline.py | test_indexer_pipeline_mixin | 59 | null | |
steamship-core/python-client | import base64
import json
import re
import pytest
import requests
from assets.packages.demo_package import TestPackage
from requests import ConnectTimeout
from steamship_tests import PACKAGES_PATH, TEST_ASSETS_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship_tests.utils.fixtures import ... | None | assert | none_literal | tests/steamship_tests/app/integration/test_package_instance.py | test_package_spec_sdk_version | 303 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.invocable import PackageService
@pytest.mark.usefixtures("client")
def test_multi_inheritance_instance_init(client: Steamship):
class PackageServiceA(PackageService):
a = 0
def instance_init(self):
self.a += 1
class Pac... | 2 | assert | numeric_literal | tests/steamship_tests/app/unit/test_multi_inheritance.py | test_multi_inheritance_instance_init | 38 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.client import steamship_use
from steamship_tests.utils.deployables import deploy_package
from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_name
from steamship import Steamshi... | instance.handle | assert | complex_expr | tests/steamship_tests/app/integration/test_use_package.py | test_use_package_fails_with_same_instance_name_but_different_config_unless_anon | 186 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.agents.schema.chathistory import ChatHistory
from steamship.data.tags.tag_constants import ChatTag, TagKind
from steamship.data.tags.tag_utils import get_tag
@pytest.mark.usefixtures("client")
def test_chat_history_index_init(client: Steamship):
contex... | None | assert | none_literal | tests/steamship_tests/agents/test_chat_history.py | test_chat_history_index_init | 15 | null | |
steamship-core/python-client | from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_index
from steamship import DocTag, File, MimeTypes, PluginInstance, Tag
_TEST_EMBEDDER = "test-embedder"
T = "A nice poem"
P1_1 = "Roses are red."
P1_2 = "Violets are blue."
P2_1 = "Sugar is sweet."
P2_2 ... | None | assert | none_literal | tests/steamship_tests/client/operations/test_embed_file.py | test_file_parse | 33 | null | |
steamship-core/python-client | from typing import Optional
from assets.packages.configurable_hello_world import HelloWorld
from pydantic import Field
from steamship.invocable.config import Config, ConfigParameterType
def test_config_parameters():
config_template = HelloWorld.get_config_parameters()
assert len(config_template) == 4
for... | None | assert | none_literal | tests/steamship_tests/app/unit/test_config_template_extraction.py | test_config_parameters | 13 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.invocable import PackageService
@pytest.mark.usefixtures("client")
def test_multi_inheritance_instance_init(client: Steamship):
class PackageServiceA(PackageService):
a = 0
def instance_init(self):
self.a += 1
class Pac... | 1 | assert | numeric_literal | tests/steamship_tests/app/unit/test_multi_inheritance.py | test_multi_inheritance_instance_init | 32 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PACKAGES_PATH, PLUGINS_PATH
from steamship_tests.utils.deployables import deploy_package, deploy_plugin
from steamship import Steamship
@pytest.mark.usefixtures("client")
def test_get_param_decoding(client: Steamship):
request_id_package_path = PACKAGES_PATH / "request_id... | None | assert | none_literal | tests/steamship_tests/app/integration/test_request_id.py | test_get_param_decoding | 23 | null | |
steamship-core/python-client | from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_index
from steamship import DocTag, File, MimeTypes, PluginInstance, Tag
_TEST_EMBEDDER = "test-embedder"
T = "A nice poem"
P1_1 = "Roses are red."
P1_2 = "Violets are blue."
P2_1 = "Sugar is sweet."
P2_2 ... | file.id | assert | complex_expr | tests/steamship_tests/client/operations/test_embed_file.py | test_file_parse | 57 | null | |
steamship-core/python-client | import os
from pathlib import Path
from typing import Callable
from assets.plugins.taggers.plugin_trainable_tagger import (
TRAINING_PARAMETERS,
TestTrainableTaggerModel,
)
from steamship_tests.utils.fixtures import get_steamship_client
from steamship.plugin.inputs.train_plugin_input import TrainPluginInput
f... | model.path | assert | complex_expr | tests/steamship_tests/plugin/unit/trainable/test_model_checkpoints.py | test_model_can_save_to_and_load_from_checkpoint | 139 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PLUGINS_PATH
from steamship_tests.utils.client import steamship_use_plugin
from steamship_tests.utils.deployables import deploy_plugin
from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_name
from steamship import Ste... | plugin.handle | assert | complex_expr | tests/steamship_tests/plugin/integration/test_use_plugin.py | test_use_plugin_fails_with_same_instance_name_but_different_config_unless_anon | 204 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.agents.schema import AgentContext
@pytest.mark.usefixtures("client")
def test_different_context(client: Steamship):
context1 = AgentContext.get_or_create(client=client, context_keys={"one": "one", "two": "two"})
contextdiff = AgentContext.get_or_cre... | contextdiff.id | assert | complex_expr | tests/steamship_tests/utils/context.py | test_different_context | 23 | null | |
steamship-core/python-client | import logging
from assets.packages.signed_url_package import TEST_STRING
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship_tests.utils.fixtures import get_steamship_client
from steamship.data.workspace import SignedUrl
from steamship.utils.signed_ur... | None | assert | none_literal | tests/steamship_tests/app/integration/test_signed_url_package.py | test_signed_url_package | 19 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.invocable.mixins.indexer_mixin import IndexerMixin
@pytest.mark.usefixtures("client")
def test_indexer_mixin_and_qa_tool(client: Steamship):
"""Tests that we can inspect the package and mixin routes"""
indexer = IndexerMixin(client)
assert index... | 2 | assert | numeric_literal | tests/steamship_tests/app/unit/test_indexer_mixin.py | test_indexer_mixin_and_qa_tool | 22 | null | |
steamship-core/python-client | import pytest
import requests
from assets.packages.transports.mock_slack_api import MockSlackApi
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import File, Steamship
config_template = {
"telegram_token": {"type": "string"},
"telegram_api_... | 1 | assert | numeric_literal | tests/steamship_tests/agents/transports/test_slack.py | test_slack | 63 | null | |
steamship-core/python-client | import pytest
from steamship_tests import PACKAGES_PATH
from steamship_tests.utils.client import steamship_use
from steamship_tests.utils.deployables import deploy_package
from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_name
from steamship import Steamshi... | "default" | assert | string_literal | tests/steamship_tests/app/integration/test_use_package.py | test_use_package | 66 | null | |
steamship-core/python-client | import base64
from assets.plugins.importers.plugin_file_importer import TEST_DOC, TestFileImporterPlugin
from steamship.data.file import File
from steamship.invocable import InvocableResponse
from steamship.invocable.plugin_service import PluginRequest
from steamship.plugin.outputs.raw_data_plugin_output import RawDa... | b64 | assert | variable | tests/steamship_tests/plugin/unit/test_file_importer.py | _test_resp | 19 | null | |
steamship-core/python-client | from steamship_tests.utils.fixtures import get_steamship_client
from steamship_tests.utils.random import random_index
from steamship import DocTag, File, MimeTypes, PluginInstance, Tag
_TEST_EMBEDDER = "test-embedder"
T = "A nice poem"
P1_1 = "Roses are red."
P1_2 = "Violets are blue."
P2_1 = "Sugar is sweet."
P2_2 ... | 6 | assert | numeric_literal | tests/steamship_tests/client/operations/test_embed_file.py | test_file_parse | 46 | null | |
steamship-core/python-client | import pytest
from steamship import Steamship
from steamship.agents.llms import OpenAI
from steamship.agents.react import ReACTOutputParser
from steamship.agents.schema import Action, AgentContext, LLMAgent
from steamship.agents.schema.chathistory import ChatHistory
from steamship.data.tags.tag_constants import ChatTa... | 0 | assert | numeric_literal | tests/steamship_tests/agents/test_message_formatting.py | test_search_method_formatting | 26 | null | |
steamship-core/python-client | import base64
import json
import re
import pytest
import requests
from assets.packages.demo_package import TestPackage
from requests import ConnectTimeout
from steamship_tests import PACKAGES_PATH, TEST_ASSETS_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship_tests.utils.fixtures import ... | 0 | assert | numeric_literal | tests/steamship_tests/app/integration/test_package_instance.py | test_task_from_invoke | 204 | null | |
steamship-core/python-client | from typing import Any, Dict, Type
import pytest
from steamship import Steamship, SteamshipError
from steamship.agents.llms import OpenAI
from steamship.agents.mixins.transports.telegram import TelegramTransport, TelegramTransportConfig
from steamship.agents.react import ReACTAgent
from steamship.agents.schema import... | routes | assert | variable | tests/steamship_tests/app/unit/test_routes_on_superclasses.py | test_l1_routes | 111 | null | |
steamship-core/python-client | import pytest
from steamship_tests.plugin.unit.trainable.util import create_dummy_training_task
from steamship_tests.utils.fixtures import get_steamship_client
from steamship import SteamshipError
from steamship.base.tasks import Task, TaskState
from steamship.invocable import InvocableResponse
def test_response_post... | new_state | assert | variable | tests/steamship_tests/plugin/unit/test_response_post_update.py | test_response_post_update_can_update_task | 33 | null | |
steamship-core/python-client | from steamship_tests.utils.fixtures import get_steamship_client
from steamship import File
from steamship.base import TaskState
def test_file_upload_then_parse():
steamship = get_steamship_client()
a = File.create(
steamship,
content="This is a test.",
)
assert a.id is not None
q... | 2 | assert | numeric_literal | tests/steamship_tests/client/operations/test_blockify.py | test_file_upload_then_parse | 46 | null | |
steamship-core/python-client | import json
import logging
import time
from typing import Any, List, Optional, Union
import pytest
import requests
import sseclient
from pydantic.fields import PrivateAttr
from steamship_tests import SRC_PATH
from steamship_tests.utils.deployables import deploy_package
from steamship import Block, File, Steamship, St... | 2 | assert | numeric_literal | tests/steamship_tests/agents/test_agent_service.py | test_non_cacheable_tool_actions | 149 | null | |
steamship-core/python-client | import pytest
from steamship import DocTag, Steamship
from steamship.agents.llms import OpenAI
from steamship.agents.schema import AgentContext
from steamship.agents.tools.question_answering import VectorSearchQATool
from steamship.agents.utils import with_llm
from steamship.data import TagKind
from steamship.invocabl... | None | assert | none_literal | tests/steamship_tests/agents/tools/test_vector_search_qa_tool.py | test_vector_search_qa_tool | 27 | null | |
steamship-core/python-client | import uuid
from typing import List
import pytest
from steamship import Block, DocTag
from steamship.agents.schema import ChatHistory
from steamship.agents.schema.message_selectors import MessageSelector
from steamship.client import Steamship
from steamship.data import TagKind
from steamship.data.tags.tag_constants i... | RoleTag.USER | assert | complex_expr | tests/steamship_tests/data/test_chat.py | test_chat_append_user | 60 | null | |
steamship-core/python-client | import pytest
from steamship import Block, File, MimeTypes, Steamship
from steamship.agents.schema import Action
from steamship.agents.schema.cache import ActionCache, LLMCache
@pytest.mark.usefixtures("client")
def test_llm_cache(client: Steamship):
context_keys = {"id": "test"}
cache = LLMCache.get_or_creat... | "input" | assert | string_literal | tests/steamship_tests/agents/test_cache.py | test_llm_cache | 20 | null | |
steamship-core/python-client | import json
import pytest
from steamship.client import Steamship
from steamship.data.block import Block
from steamship.data.file import File
from steamship.data.tags.tag import Tag
@pytest.mark.usefixtures("client")
def test_dict_method_should_not_include_client(client: Steamship):
block = Block(client=client, t... | d | assert | variable | tests/steamship_tests/base/test_serialization.py | test_dict_method_should_not_include_client | 16 | null | |
steamship-core/python-client | import os
from pathlib import Path
from typing import Callable
from assets.plugins.taggers.plugin_trainable_tagger import (
TRAINING_PARAMETERS,
TestTrainableTaggerModel,
)
from steamship_tests.utils.fixtures import get_steamship_client
from steamship.plugin.inputs.train_plugin_input import TrainPluginInput
f... | p2 | assert | variable | tests/steamship_tests/plugin/unit/trainable/test_model_checkpoints.py | _assert_same_content | 28 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.