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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_name.py | test_run_all | assert | numeric_literal | 37 | import pytest
def testcases():
return {
"base": (
"""
def test_a(snapshot):
assert snapshot(name="xyz") == "case 1"
assert snapshot(name="zyx") == "case 2"
"""
),
"modified": (
"""
def test_a(snapsho... | 0 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_name.py | test_failure | assert | numeric_literal | 38 | import pytest
def testcases():
return {
"base": (
"""
def test_a(snapshot):
assert snapshot(name="xyz") == "case 1"
assert snapshot(name="zyx") == "case 2"
"""
),
"modified": (
"""
def test_a(snapsho... | 1 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_name.py | test_update | assert | func_call | 38 | import pytest
def testcases():
return {
"base": (
"""
def test_a(snapshot):
assert snapshot(name="xyz") == "case 1"
assert snapshot(name="zyx") == "case 2"
"""
),
"modified": (
"""
def test_a(snapsho... | str(result.stdout) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_update.py | test_update_failure_shows_snapshot_diff | assert | numeric_literal | 175 | import sys
from pathlib import Path
import pytest
def testcases_initial():
return {
"test_used": (
"""
import pytest
@pytest.mark.parametrize("actual", [1, 2, 3])
def test_used(snapshot, actual):
assert snapshot == actual
def te... | 1 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_update.py | test_update_success_shows_snapshot_report | assert | numeric_literal | 122 | import sys
from pathlib import Path
import pytest
def testcases_initial():
return {
"test_used": (
"""
import pytest
@pytest.mark.parametrize("actual", [1, 2, 3])
def test_used(snapshot, actual):
assert snapshot == actual
def te... | 0 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_update.py | run_testcases | assert | func_call | 114 | import sys
from pathlib import Path
import pytest
def testcases_initial():
return {
"test_used": (
"""
import pytest
@pytest.mark.parametrize("actual", [1, 2, 3])
def test_used(snapshot, actual):
assert snapshot == actual
def te... | result.stdout.str() | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_warn_unused.py | test_unused_snapshots_failure | assert | numeric_literal | 38 | import pytest
def testcases():
return {
"used": (
"""
def test_used(snapshot):
assert snapshot == 'used'
"""
),
"unused": (
"""
def test_unused(snapshot):
assert snapshot == 'unused'
"""
... | 1 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_option_warn_unused.py | test_unused_snapshots_warning | assert | numeric_literal | 38 | import pytest
def testcases():
return {
"used": (
"""
def test_used(snapshot):
assert snapshot == 'used'
"""
),
"unused": (
"""
def test_unused(snapshot):
assert snapshot == 'unused'
"""
... | 0 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_outside_directory.py | test_generated_snapshots | assert | numeric_literal | 53 | import pytest
def testcases(testdir, tmp_path):
dirname = tmp_path.joinpath("__snapshots__")
testdir.makeconftest(
f"""
import pytest
from syrupy.extensions.amber import AmberSnapshotExtension
class CustomSnapshotExtension(AmberSnapshotExtension):
@classmethod
... | 0 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_outside_directory.py | test_unmatched_snapshots | assert | numeric_literal | 54 | import pytest
def testcases(testdir, tmp_path):
dirname = tmp_path.joinpath("__snapshots__")
testdir.makeconftest(
f"""
import pytest
from syrupy.extensions.amber import AmberSnapshotExtension
class CustomSnapshotExtension(AmberSnapshotExtension):
@classmethod
... | 1 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_outside_directory.py | test_generated_snapshots | assert | func_call | 52 | import pytest
def testcases(testdir, tmp_path):
dirname = tmp_path.joinpath("__snapshots__")
testdir.makeconftest(
f"""
import pytest
from syrupy.extensions.amber import AmberSnapshotExtension
class CustomSnapshotExtension(AmberSnapshotExtension):
@classmethod
... | result.stdout.str() | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_similar_names_default.py | test_run_all | assert | numeric_literal | 39 | import pytest
def testcases():
return {
"a": (
"""
def test_a(snapshot):
assert snapshot == 'a'
"""
),
"b": (
"""
def test_b(snapshot):
assert snapshot == 'b'
"""
),
"a_su... | 0 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_similar_names_file_extension.py | test_run_all | assert | numeric_literal | 48 | import pytest
def testcases():
return {
"a": (
"""
def test_a(snapshot):
assert snapshot == b"a"
"""
),
"b": (
"""
def test_b(snapshot):
assert snapshot == b"b"
"""
),
"a_... | 0 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_use_extension.py | test_unsaved_snapshots | assert | numeric_literal | 97 | import pytest
def testcases_initial(testdir):
testdir.makeconftest(
"""
import pytest
from syrupy.extensions.amber import AmberSnapshotExtension
from syrupy.extensions.image import (
PNGImageSnapshotExtension,
SVGImageSnapshotExtension,
)
fro... | 1 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_use_extension.py | test_generated_snapshots | assert | numeric_literal | 95 | import pytest
def testcases_initial(testdir):
testdir.makeconftest(
"""
import pytest
from syrupy.extensions.amber import AmberSnapshotExtension
from syrupy.extensions.image import (
PNGImageSnapshotExtension,
SVGImageSnapshotExtension,
)
fro... | 0 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/integration/test_snapshot_use_extension.py | test_generated_snapshots | assert | func_call | 94 | import pytest
def testcases_initial(testdir):
testdir.makeconftest(
"""
import pytest
from syrupy.extensions.amber import AmberSnapshotExtension
from syrupy.extensions.image import (
PNGImageSnapshotExtension,
SVGImageSnapshotExtension,
)
fro... | result.stdout.str() | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_filters.py | test_filters_error_prop | assert | func_call | 27 | import datetime
import pytest
from syrupy.filters import (
paths,
props,
)
@pytest.mark.parametrize(
"predicate", [paths("exclude_me", "nested.exclude_me"), props("exclude_me")]
)
def test_filters_error_prop(snapshot, predicate):
class CustomClass:
@property
def include_me(self):
... | snapshot(exclude=predicate) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_filters.py | test_filters_expected_props | assert | func_call | 18 | import datetime
import pytest
from syrupy.filters import (
paths,
props,
)
def test_filters_expected_props(snapshot):
actual = {
0: "some value",
"date": datetime.datetime.now(),
"nested": {"id": 4, "other": "value"},
"list": [1, 2],
}
assert actual == | snapshot(exclude=props("0", "date", "id")) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_filters.py | test_filters_path_noop | pytest.raises | complex_expr | 12 | import datetime
import pytest
from syrupy.filters import (
paths,
props,
)
def test_filters_path_noop():
with pytest.raises( | TypeError, match="required positional argument") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_filters.py | test_filters_expected_paths | assert | func_call | 18 | import datetime
import pytest
from syrupy.filters import (
paths,
props,
)
def test_filters_expected_paths(snapshot):
actual = {
0: "some value",
"date": datetime.datetime.now(),
"nested": {"id": 4, "other": "value"},
"list": [1, 2],
}
assert actual == | snapshot(exclude=paths("0", "date", "nested.id", "list.0")) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_matchers.py | test_matches_non_deterministic_snapshots | assert | variable | 28 | import datetime
import uuid
import pytest
from syrupy.extensions.amber.serializer import Repr
from syrupy.matchers import (
PathTypeError,
path_type,
)
def test_matches_non_deterministic_snapshots(snapshot):
def matcher(data, path):
if isinstance(data, uuid.UUID):
return Repr("UUID(..... | snapshot | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_matchers.py | test_matches_non_deterministic_snapshots | assert | func_call | 23 | import datetime
import uuid
import pytest
from syrupy.extensions.amber.serializer import Repr
from syrupy.matchers import (
PathTypeError,
path_type,
)
def test_matches_non_deterministic_snapshots(snapshot):
def matcher(data, path):
if isinstance(data, uuid.UUID):
return Repr("UUID(..... | snapshot(matcher=matcher) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_matchers.py | test_matches_expected_type | assert | func_call | 22 | import datetime
import uuid
import pytest
from syrupy.extensions.amber.serializer import Repr
from syrupy.matchers import (
PathTypeError,
path_type,
)
def test_matches_expected_type(snapshot):
my_matcher = path_type(
{"date_created": (datetime.datetime,), "nested.id": (int,)}, types=(uuid.UUID,)... | snapshot(matcher=my_matcher) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_matchers.py | test_raises_unexpected_type | assert | func_call | 30 | import datetime
import uuid
import pytest
from syrupy.extensions.amber.serializer import Repr
from syrupy.matchers import (
PathTypeError,
path_type,
)
def test_raises_unexpected_type(snapshot):
kwargs = {
"mapping": {
"date_created": (datetime.datetime,),
"date_updated": ... | snapshot(matcher=path_type(**kwargs)) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_matchers.py | test_matcher_path_type_noop | pytest.raises | complex_expr | 14 | import datetime
import uuid
import pytest
from syrupy.extensions.amber.serializer import Repr
from syrupy.matchers import (
PathTypeError,
path_type,
)
def test_matcher_path_type_noop(snapshot):
with pytest.raises( | PathTypeError, match="argument cannot be empty") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_matchers.py | test_raises_unexpected_type | assert | func_call | 28 | import datetime
import uuid
import pytest
from syrupy.extensions.amber.serializer import Repr
from syrupy.matchers import (
PathTypeError,
path_type,
)
def test_raises_unexpected_type(snapshot):
kwargs = {
"mapping": {
"date_created": (datetime.datetime,),
"date_updated": ... | snapshot(matcher=path_type(**kwargs, strict=False)) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_matchers.py | test_raises_unexpected_type | pytest.raises | complex_expr | 29 | import datetime
import uuid
import pytest
from syrupy.extensions.amber.serializer import Repr
from syrupy.matchers import (
PathTypeError,
path_type,
)
def test_raises_unexpected_type(snapshot):
kwargs = {
"mapping": {
"date_created": (datetime.datetime,),
"date_updated": ... | AssertionError, match="does not match any of the expected") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_numbers | assert | numeric_literal | 13 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_numbers(snapshot):
assert snapshot == 3.5
assert snapshot == | 7 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_ordered_dict | assert | variable | 15 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_ordered_dict(snapshot):
d = OrderedDict()
d["b"] = 0
d["a"] = 1
assert snapshot == | d | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_empty_snapshot | assert | string_literal | 13 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_empty_snapshot(snapshot):
assert snapshot == None # noqa: E711
assert snapshot == | "" | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_tuple | assert | collection | 14 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_tuple(snapshot):
assert snapshot == ("this", "is", ("a", "tuple"))
assert snapshot == ExampleTuple(a="this", b="is", c="a", d={"named", "tuple"})
assert ... | () | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_numbers | assert | numeric_literal | 12 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_numbers(snapshot):
assert snapshot == | 3.5 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_empty_snapshot | assert | none_literal | 12 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_empty_snapshot(snapshot):
assert snapshot == | None | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_numbers | assert | complex_expr | 14 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_numbers(snapshot):
assert snapshot == 3.5
assert snapshot == 7
assert snapshot == | 2 / 6 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_string | assert | variable | 29 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
@pytest.mark.parametrize(
"actual",
[
"",
r"Raw string",
r"Escaped \n",
r"Backslash \u U",
"🥞🐍🍯",
"singleline:",
... | actual | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_reflection | assert | variable | 13 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_reflection(snapshot):
"""assert [expected|snapshot] == [actual|received]"""
assert snapshot(name="reflectionA") == | snapshot | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_serializer.py | test_multiple_snapshots | assert | string_literal | 14 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
def test_multiple_snapshots(snapshot):
assert "First." == snapshot
snapshot.assert_match("Second.")
assert snapshot == | "Third." | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_snapshot_diff.py | test_snapshot_diff | assert | variable | 14 | from types import MappingProxyType
import pytest
def test_snapshot_diff(snapshot):
my_dict = {
"field_0": True,
"field_1": "no_value",
"nested": {
"field_0": 1,
},
}
assert my_dict == | snapshot | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_snapshot_diff.py | test_snapshot_diff | assert | func_call | 16 | from types import MappingProxyType
import pytest
def test_snapshot_diff(snapshot):
my_dict = {
"field_0": True,
"field_1": "no_value",
"nested": {
"field_0": 1,
},
}
assert my_dict == snapshot
my_dict["field_1"] = "yes_value"
assert my_dict == | snapshot(diff=0) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_snapshot_diff.py | test_snapshot_diff_id | assert | func_call | 23 | from types import MappingProxyType
import pytest
def test_snapshot_diff_id(snapshot):
my_dict = {
"field_0": True,
"field_1": "no_value",
"field_2": 0,
"field_3": None,
"field_4": 1,
"field_5": False,
"field_6": (True, "hey", 2, None),
"field_7": {Fa... | snapshot(name="large snapshot") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_snapshot_diff.py | test_snapshot_diff_id | assert | func_call | 30 | from types import MappingProxyType
import pytest
def test_snapshot_diff_id(snapshot):
my_dict = {
"field_0": True,
"field_1": "no_value",
"field_2": 0,
"field_3": None,
"field_4": 1,
"field_5": False,
"field_6": (True, "hey", 2, None),
"field_7": {Fa... | snapshot(diff="large snapshot") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_snapshot_diff.py | test_snapshot_no_diff_raises_exception | assert | func_call | 11 | from types import MappingProxyType
import pytest
def test_snapshot_no_diff_raises_exception(snapshot):
my_dict = {
"field_0": "value_0",
}
with pytest.raises(AssertionError, match="SnapshotDoesNotExist"):
assert my_dict == | snapshot(diff="does not exist index") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_snapshot_diff.py | test_snapshot_diff_id | assert | func_call | 36 | from types import MappingProxyType
import pytest
def test_snapshot_diff_id(snapshot):
my_dict = {
"field_0": True,
"field_1": "no_value",
"field_2": 0,
"field_3": None,
"field_4": 1,
"field_5": False,
"field_6": (True, "hey", 2, None),
"field_7": {Fa... | snapshot(name="case3", diff="large snapshot") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber/test_amber_snapshot_diff.py | test_snapshot_no_diff_raises_exception | pytest.raises | complex_expr | 10 | from types import MappingProxyType
import pytest
def test_snapshot_no_diff_raises_exception(snapshot):
my_dict = {
"field_0": "value_0",
}
with pytest.raises( | AssertionError, match="SnapshotDoesNotExist") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/amber_sorted/test_amber_sort.py | test_many_sorted | assert | variable | 14 | import pytest
from syrupy.extensions.amber import (
AmberDataSerializerSorted,
AmberSnapshotExtension,
)
def snapshot(snapshot):
return snapshot.use_extension(AmberSortedSnapshotExtension)
def test_many_sorted(snapshot):
for i in range(25):
assert i == | snapshot | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_png.py | test_multiple_snapshot_extensions | assert | none_literal | 26 | import base64
import pytest
from syrupy.extensions.image import PNGImageSnapshotExtension
actual_png = base64.b64decode(
b"iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAG1BMVEXMzMy"
b"Wlpaqqqq3t7exsbGcnJy+vr6jo6PFxcUFpPI/AAAACXBIWXMAAA7EAAAOxA"
b"GVKw4bAAAAQUlEQVQ4jWNgGAWjgP6ASdncAEaiAhaGiACmFhCJLsMaIi... | None | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_png.py | test_multiple_snapshot_extensions | assert | func_call | 25 | import base64
import pytest
from syrupy.extensions.image import PNGImageSnapshotExtension
actual_png = base64.b64decode(
b"iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAG1BMVEXMzMy"
b"Wlpaqqqq3t7exsbGcnJy+vr6jo6PFxcUFpPI/AAAACXBIWXMAAA7EAAAOxA"
b"GVKw4bAAAAQUlEQVQ4jWNgGAWjgP6ASdncAEaiAhaGiACmFhCJLsMaIi... | snapshot() | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_png.py | test_image | assert | variable | 20 | import base64
import pytest
from syrupy.extensions.image import PNGImageSnapshotExtension
actual_png = base64.b64decode(
b"iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAG1BMVEXMzMy"
b"Wlpaqqqq3t7exsbGcnJy+vr6jo6PFxcUFpPI/AAAACXBIWXMAAA7EAAAOxA"
b"GVKw4bAAAAQUlEQVQ4jWNgGAWjgP6ASdncAEaiAhaGiACmFhCJLsMaIi... | snapshot_png | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_png.py | test_multiple_snapshot_extensions | assert | func_call | 24 | import base64
import pytest
from syrupy.extensions.image import PNGImageSnapshotExtension
actual_png = base64.b64decode(
b"iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAG1BMVEXMzMy"
b"Wlpaqqqq3t7exsbGcnJy+vr6jo6PFxcUFpPI/AAAACXBIWXMAAA7EAAAOxA"
b"GVKw4bAAAAQUlEQVQ4jWNgGAWjgP6ASdncAEaiAhaGiACmFhCJLsMaIi... | snapshot(extension_class=PNGImageSnapshotExtension) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_svg.py | test_multiple_snapshot_extensions | assert | none_literal | 28 | import pytest
from syrupy.extensions.image import SVGImageSnapshotExtension
actual_svg = (
'<?xml version="1.0" encoding="UTF-8"?>'
'<svg viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">'
'<g><rect width="50" height="50" fill="#fff"/>'
'<g><g fill="#fff" stroke="#707070">'
'<rect width="50"... | None | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_svg.py | test_multiple_snapshot_extensions | assert | func_call | 27 | import pytest
from syrupy.extensions.image import SVGImageSnapshotExtension
actual_svg = (
'<?xml version="1.0" encoding="UTF-8"?>'
'<svg viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">'
'<g><rect width="50" height="50" fill="#fff"/>'
'<g><g fill="#fff" stroke="#707070">'
'<rect width="50"... | snapshot() | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_svg.py | test_image | assert | variable | 22 | import pytest
from syrupy.extensions.image import SVGImageSnapshotExtension
actual_svg = (
'<?xml version="1.0" encoding="UTF-8"?>'
'<svg viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">'
'<g><rect width="50" height="50" fill="#fff"/>'
'<g><g fill="#fff" stroke="#707070">'
'<rect width="50"... | snapshot_svg | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/image/test_image_svg.py | test_multiple_snapshot_extensions | assert | func_call | 26 | import pytest
from syrupy.extensions.image import SVGImageSnapshotExtension
actual_svg = (
'<?xml version="1.0" encoding="UTF-8"?>'
'<svg viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">'
'<g><rect width="50" height="50" fill="#fff"/>'
'<g><g fill="#fff" stroke="#707070">'
'<rect width="50"... | snapshot(extension_class=SVGImageSnapshotExtension) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_filters.py | test_serializer | assert | variable | 31 | import datetime
import pytest
from syrupy.extensions.json import JSONSnapshotExtension
from syrupy.filters import (
paths,
props,
)
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
@pytest.mark.parametrize(
"content",
[
{},
["an array"],
{... | content | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_matchers.py | test_matcher | assert | variable | 29 | import datetime
import random
import pytest
from syrupy.extensions.json import JSONSnapshotExtension
from syrupy.matchers import path_type
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_matcher(snapshot_json):
content = {
"int": random.randint(1, 100),
... | content | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_numbers | assert | numeric_literal | 17 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_numbers(snapshot_json)... | 7 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_ordered_dict | assert | variable | 19 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_ordered_dict(snapshot_... | d | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_empty_snapshot | assert | string_literal | 17 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_empty_snapshot(snapsho... | "" | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_tuple | assert | collection | 18 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_tuple(snapshot_json):
... | () | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_numbers | assert | numeric_literal | 16 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_numbers(snapshot_json)... | 3.5 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_empty_snapshot | assert | none_literal | 16 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_empty_snapshot(snapsho... | None | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_numbers | assert | complex_expr | 18 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_numbers(snapshot_json)... | 2 / 6 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_string | assert | variable | 33 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
@pytest.mark.parametrize(
"... | actual | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_multiple_snapshots | assert | string_literal | 18 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_multiple_snapshots(sna... | "Third." | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_multiple_snapshots | assert_* | string_literal | 17 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_multiple_snapshots(sna... | "Second.") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/json/test_json_serializer.py | test_reflection | assert | variable | 16 | from collections import (
OrderedDict,
namedtuple,
)
import pytest
from syrupy.extensions.amber.serializer import AmberDataSerializer
from syrupy.extensions.json import JSONSnapshotExtension
def snapshot_json(snapshot):
return snapshot.use_extension(JSONSnapshotExtension)
def test_reflection(snapshot_js... | snapshot_json | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/test_base.py | test_diff_lines | assert | variable | 27 | import pytest
from syrupy.extensions.base import SnapshotReporter
class TestSnapshotReporter:
@pytest.mark.parametrize(
"a, b",
[
(
"line 0\nline 1\nline 02\nline 3\nline 4\r\nline 5\nline 6\nline 7",
"line 0\nline 1\nline 2\r\nline 3\nline 04\nline 5\nl... | snapshot | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/test_single_file.py | test_special_characters | assert | variable | 26 | from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from syrupy.data import (
Snapshot,
SnapshotCollection,
)
from syrupy.extensions.single_file import (
SingleFileSnapshotExtension,
WriteMode,
)
def snapshot_single(snapshot):
return snapshot.use_extension(SingleFileSnapshotEx... | content | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/test_single_file.py | test_unicode | assert | string_literal | 24 | from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from syrupy.data import (
Snapshot,
SnapshotCollection,
)
from syrupy.extensions.single_file import (
SingleFileSnapshotExtension,
WriteMode,
)
def snapshot_single(snapshot):
return snapshot.use_extension(SingleFileSnapshotEx... | "apple" | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/test_single_file.py | test_underscore | assert | string_literal | 23 | from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from syrupy.data import (
Snapshot,
SnapshotCollection,
)
from syrupy.extensions.single_file import (
SingleFileSnapshotExtension,
WriteMode,
)
def snapshot_single(snapshot):
return snapshot.use_extension(SingleFileSnapshotEx... | b"apple" | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/test_single_file.py | test_____underscore | assert | string_literal | 23 | from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from syrupy.data import (
Snapshot,
SnapshotCollection,
)
from syrupy.extensions.single_file import (
SingleFileSnapshotExtension,
WriteMode,
)
def snapshot_single(snapshot):
return snapshot.use_extension(SingleFileSnapshotEx... | b"orange" | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/test_single_file.py | test_class_method_name | assert | string_literal | 24 | from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from syrupy.data import (
Snapshot,
SnapshotCollection,
)
from syrupy.extensions.single_file import (
SingleFileSnapshotExtension,
WriteMode,
)
def snapshot_single(snapshot):
return snapshot.use_extension(SingleFileSnapshotEx... | b"this is in a test class" | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/extensions/test_single_file.py | test_does_not_write_non_binary | pytest.raises | complex_expr | 27 | from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from syrupy.data import (
Snapshot,
SnapshotCollection,
)
from syrupy.extensions.single_file import (
SingleFileSnapshotExtension,
WriteMode,
)
def snapshot_single(snapshot):
return snapshot.use_extension(SingleFileSnapshotEx... | TypeError, match="Expected 'bytes', got 'str'") | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_location.py | test_location_properties | assert | variable | 56 | from pathlib import Path
from unittest.mock import MagicMock
import pytest
from syrupy.location import PyTestLocation
def mock_pytest_item(node_id: str, method_name: str) -> "pytest.Item":
mock_node = MagicMock(spec=pytest.Item)
mock_node.nodeid = node_id
[filepath, *_, nodename] = node_id.split("::")
... | expected_filename | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_location.py | test_location_properties | assert | variable | 55 | from pathlib import Path
from unittest.mock import MagicMock
import pytest
from syrupy.location import PyTestLocation
def mock_pytest_item(node_id: str, method_name: str) -> "pytest.Item":
mock_node = MagicMock(spec=pytest.Item)
mock_node.nodeid = node_id
[filepath, *_, nodename] = node_id.split("::")
... | expected_classname | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_location.py | test_location_properties | assert | variable | 57 | from pathlib import Path
from unittest.mock import MagicMock
import pytest
from syrupy.location import PyTestLocation
def mock_pytest_item(node_id: str, method_name: str) -> "pytest.Item":
mock_node = MagicMock(spec=pytest.Item)
mock_node.nodeid = node_id
[filepath, *_, nodename] = node_id.split("::")
... | expected_snapshotname | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_terminal.py | test_colors_off_does_not_call_colored | pytest.raises | variable | 55 | from unittest.mock import (
NonCallableMock,
patch,
)
import pytest
from syrupy.constants import DISABLE_COLOR_ENV_VAR
from syrupy.terminal import (
bold,
context_style,
error_style,
green,
received_diff_style,
received_style,
red,
reset,
snapshot_diff_style,
snapshot_s... | TypeError) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_terminal.py | test_colors_off_does_not_call_colored | assert | func_call | 58 | from unittest.mock import (
NonCallableMock,
patch,
)
import pytest
from syrupy.constants import DISABLE_COLOR_ENV_VAR
from syrupy.terminal import (
bold,
context_style,
error_style,
green,
received_diff_style,
received_style,
red,
reset,
snapshot_diff_style,
snapshot_s... | str(excinfo.value) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_utils.py | test_import_module_member_imports_member | assert | numeric_literal | 43 | from pathlib import Path
import pytest
from syrupy.exceptions import FailedToLoadModuleMember
from syrupy.utils import (
import_module_member,
walk_snapshot_dir,
)
def makefiles(testdir, filetree, root=""):
for filename, contents in filetree.items():
filepath = Path(root).joinpath(filename)
... | 123 | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_utils.py | test_import_module_member_with_bad_path_raises_exception | pytest.raises | variable | 50 | from pathlib import Path
import pytest
from syrupy.exceptions import FailedToLoadModuleMember
from syrupy.utils import (
import_module_member,
walk_snapshot_dir,
)
def makefiles(testdir, filetree, root=""):
for filename, contents in filetree.items():
filepath = Path(root).joinpath(filename)
... | FailedToLoadModuleMember) | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
syrupy-project/syrupy | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | train | train | tests/syrupy/test_utils.py | test_walk_dir_skips_non_snapshot_path | assert | collection | 41 | from pathlib import Path
import pytest
from syrupy.exceptions import FailedToLoadModuleMember
from syrupy.utils import (
import_module_member,
walk_snapshot_dir,
)
def makefiles(testdir, filetree, root=""):
for filename, contents in filetree.items():
filepath = Path(root).joinpath(filename)
... | { str(snap_folder.joinpath("snapfile1.ambr")), str(snap_folder.joinpath("snapfolder", "snapfile2.svg")), } | 8f581d577068f19a9e0fff65f4476f4601c137df | 91 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_schedule.py | test_batch_update_state_items | assert | variable | 63 | from pathlib import Path
from datetime import time
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.datetime_helpers import format_datetime
TEST_ASSET_DIR = Path(__file__).parent / "assets"
GET_XML = TEST_ASSET_DIR / "schedule_get.xml"
GET_BY_ID_XML = TEST_ASSET_DIR / "s... | r | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_groupsets.py | test_update | assert | variable | 35 | from pathlib import Path
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.models.reference_item import ResourceReference
TEST_ASSET_DIR = Path(__file__).parent / "assets"
GROUPSET_CREATE = TEST_ASSET_DIR / "groupsets_create.xml"
GROUPSETS_GET = TEST_ASSET_DIR / "groupsets... | id_ | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_linked_tasks.py | test_run_now_str_linked_task | assert | variable | 38 | from pathlib import Path
from defusedxml.ElementTree import fromstring
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.datetime_helpers import parse_datetime
from tableauserverclient.models.linked_tasks_item import LinkedTaskItem, LinkedTaskStepItem, LinkedTaskFlowRunItem... | id_ | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_workbook.py | test_odata_connection | assert | variable | 77 | import os
import re
import requests_mock
import tempfile
from defusedxml.ElementTree import fromstring
from io import BytesIO
from pathlib import Path
import pytest
import tableauserverclient as TSC
from tableauserverclient.datetime_helpers import format_datetime, parse_datetime
from tableauserverclient.models import... | url | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_oidc.py | test_oidc_delete | assert | variable | 34 | import requests_mock
from pathlib import Path
import pytest
import tableauserverclient as TSC
assets = Path(__file__).parent / "assets"
OIDC_GET = assets / "oidc_get.xml"
OIDC_GET_BY_ID = assets / "oidc_get_by_id.xml"
OIDC_UPDATE = assets / "oidc_update.xml"
OIDC_CREATE = assets / "oidc_create.xml"
def server():
... | luid | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_virtual_connection.py | test_virtual_connection_download_revision | assert | variable | 47 | import json
from pathlib import Path
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.datetime_helpers import parse_datetime
from tableauserverclient.models.virtual_connection_item import VirtualConnectionItem
ASSET_DIR = Path(__file__).parent / "assets"
VIRTUAL_CONNECTI... | data | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_permissionsrule.py | test_eq_false | assert | variable | 25 | import tableauserverclient as TSC
from tableauserverclient.models.reference_item import ResourceReference
def test_eq_false() -> None:
grantee = ResourceReference("a", "user")
rule1 = TSC.PermissionsRule(
grantee,
{
TSC.Permission.Capability.ExportData: TSC.Permission.Mode.Allow,
... | rule2 | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_sort.py | test_filter_equals | assert | variable | 28 | from urllib.parse import parse_qs
import pytest
import requests_mock
import tableauserverclient as TSC
def server():
"""Fixture to create a TSC.Server instance for testing."""
server = TSC.Server("http://test", False)
# Fake signin
server._site_id = "dad65087-b08b-4603-af4e-2887b8aafc67"
server.... | query | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_virtual_connection.py | test_virtual_connection_populate_connections | assert | variable | 46 | import json
from pathlib import Path
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.datetime_helpers import parse_datetime
from tableauserverclient.models.virtual_connection_item import VirtualConnectionItem
ASSET_DIR = Path(__file__).parent / "assets"
VIRTUAL_CONNECTI... | vconn | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_exponential_backoff.py | test_exponential_saturation | pytest.approx | variable | 19 | import pytest
from tableauserverclient.exponential_backoff import ExponentialBackoffTimer
from ._utils import mocked_time
def test_exponential_saturation() -> None:
with mocked_time() as mock_time:
exponentialBackoff = ExponentialBackoffTimer()
for _ in range(99):
exponentialBackoff.sl... | slept) | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_fileuploads.py | test_upload_chunks_file_path | assert | variable | 48 | import contextlib
import io
import os
from pathlib import Path
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.config import BYTES_PER_MB, config
TEST_ASSET_DIR = Path(__file__).parent / "assets"
FILEUPLOAD_INITIALIZE = TEST_ASSET_DIR / "fileupload_initialize.xml"
FILEUP... | actual | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_metadata.py | test_paged_metadata_query | assert | variable | 71 | import json
from pathlib import Path
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.server.endpoint.exceptions import GraphQLError
TEST_ASSET_DIR = Path(__file__).parent / "assets"
METADATA_QUERY_SUCCESS = TEST_ASSET_DIR / "metadata_query_success.json"
METADATA_QUERY_E... | actual | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_regression_tests.py | test_empty_request_works | assert | variable | 10 | from unittest import mock
import tableauserverclient.server.request_factory as factory
from tableauserverclient.helpers.strings import redact_xml
from tableauserverclient.filesys_helpers import to_filename, make_download_path
def test_empty_request_works():
result = factory.EmptyRequest().empty_req()
assert ... | result | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_request_option.py | test_queryset_field_order | assert | variable | 43 | from pathlib import Path
from urllib.parse import parse_qs
import pytest
import requests_mock
import tableauserverclient as TSC
TEST_ASSET_DIR = Path(__file__).parent / "assets"
PAGINATION_XML = TEST_ASSET_DIR / "request_option_pagination.xml"
PAGE_NUMBER_XML = TEST_ASSET_DIR / "request_option_page_number.xml"
PAGE... | fields | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_custom_view.py | test_download | assert | variable | 46 | from contextlib import ExitStack
import io
import os
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.config import BYTES_PER_MB
from tableauserverclient.datetime_helpers import format_datetime
TEST_ASSET_DI... | content | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_tagging.py | test_delete_tags | assert | variable | 106 | from contextlib import ExitStack
import re
from collections.abc import Iterable
from typing import Optional, Protocol
import uuid
from xml.etree import ElementTree as ET
import pytest
import requests_mock
import tableauserverclient as TSC
def get_server() -> TSC.Server:
server = TSC.Server("http://test", False)
... | tag_set | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_user.py | test_bulk_remove | assert | variable | 84 | import csv
import io
from pathlib import Path
import re
from unittest.mock import patch
from pathlib import Path
from defusedxml import ElementTree as ET
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.datetime_helpers import format_datetime, parse_datetime
from tableause... | content | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_custom_view.py | test_populate_csv | assert | variable | 48 | from contextlib import ExitStack
import io
import os
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.config import BYTES_PER_MB
from tableauserverclient.datetime_helpers import format_datetime
TEST_ASSET_DI... | csv_file | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
tableau/server-client-python | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | train | train | test/test_view.py | test_populate_csv | assert | variable | 49 | from pathlib import Path
import pytest
import requests_mock
import tableauserverclient as TSC
from tableauserverclient import UserItem, GroupItem, PermissionsRule
from tableauserverclient.datetime_helpers import format_datetime, parse_datetime
from tableauserverclient.server.endpoint.exceptions import UnsupportedAttr... | csv_file | 24cf1adfdbd4b0e17e789899b09f00b60ca5bef9 | 159 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.