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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_integration.py | test_pretend_version_accepts_bad_string | assert | string_literal | 30 | from __future__ import annotations
import sys
import textwrap
from pathlib import Path
import pytest
import setuptools_scm._integration.setuptools
from .wd_wrapper import WorkDir
from setuptools_scm._integration.setuptools import _warn_on_old_setuptools
from setuptools_scm._overrides import PRETEND_KEY
from setuptoo... | "dummy" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_integration.py | test_pretend_version_accepts_bad_string | assert | string_literal | 32 | from __future__ import annotations
import sys
import textwrap
from pathlib import Path
import pytest
import setuptools_scm._integration.setuptools
from .wd_wrapper import WorkDir
from setuptools_scm._integration.setuptools import _warn_on_old_setuptools
from setuptools_scm._overrides import PRETEND_KEY
from setuptoo... | "0.0.0" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_integration.py | test_unicode_in_setup_cfg | assert | string_literal | 44 | from __future__ import annotations
import sys
import textwrap
from pathlib import Path
import pytest
import setuptools_scm._integration.setuptools
from .wd_wrapper import WorkDir
from setuptools_scm._integration.setuptools import _warn_on_old_setuptools
from setuptools_scm._overrides import PRETEND_KEY
from setuptoo... | "configparser" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_integration.py | test_distribution_provides_extras | assert | collection | 36 | from __future__ import annotations
import sys
import textwrap
from pathlib import Path
import pytest
import setuptools_scm._integration.setuptools
from .wd_wrapper import WorkDir
from setuptools_scm._integration.setuptools import _warn_on_old_setuptools
from setuptools_scm._overrides import PRETEND_KEY
from setuptoo... | ["docs", "rich", "test", "toml"] | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_internal_log_level.py | test_log_levels_when_set | assert | complex_expr | 9 | from __future__ import annotations
import logging
from setuptools_scm import _log
def test_log_levels_when_set() -> None:
assert _log._default_log_level({"SETUPTOOLS_SCM_DEBUG": ""}) == | logging.DEBUG | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_internal_log_level.py | test_log_levels_when_unset | assert | complex_expr | 9 | from __future__ import annotations
import logging
from setuptools_scm import _log
def test_log_levels_when_unset() -> None:
assert _log._default_log_level({}) == | logging.WARNING | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_find_files_stop_at_root_hg | assert | collection | 35 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | [] | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_version_in_merge | assert | none_literal | 34 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | None | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_version_from_hg_id | assert | string_literal | 28 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | "0.0" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_version_from_hg_id | assert | string_literal | 35 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | "0.1" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_version_from_hg_id | assert | string_literal | 52 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | "0.3" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_latest_tag_detection | assert | string_literal | 50 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | "1.0.0" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_archival_to_version | assert | variable | 31 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | expected | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_find_files_stop_at_root_hg | assert | collection | 39 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | ["setup.cfg"] | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_version_from_archival | assert | string_literal | 39 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | "0.2.dev3+h000000000000" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_mercurial.py | test_hg_gone | pytest.raises | complex_expr | 30 | from __future__ import annotations
import os
from pathlib import Path
import pytest
import setuptools_scm._file_finders
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import has_command
from setuptools_scm.hg import archival_to_version
from setuptools_scm.hg import parse
from setuptools_scm.ve... | EnvironmentError, match="'hg' was not found") | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_regressions.py | test_pkginfo_noscmroot | assert | numeric_literal | 33 | from __future__ import annotations
import pprint
import subprocess
import sys
from importlib.metadata import distribution
from importlib.metadata import EntryPoint
from pathlib import Path
import pytest
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import run
from setuptools_scm.git import pa... | 1 | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_regressions.py | test_case_mismatch_on_windows_git | assert | none_literal | 25 | from __future__ import annotations
import pprint
import subprocess
import sys
from importlib.metadata import distribution
from importlib.metadata import EntryPoint
from pathlib import Path
import pytest
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import run
from setuptools_scm.git import pa... | None | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_regressions.py | test_pkginfo_noscmroot | assert | string_literal | 37 | from __future__ import annotations
import pprint
import subprocess
import sys
from importlib.metadata import distribution
from importlib.metadata import EntryPoint
from pathlib import Path
import pytest
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import run
from setuptools_scm.git import pa... | "1.0" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_regressions.py | test_pkginfo_noscmroot | assert | complex_expr | 32 | from __future__ import annotations
import pprint
import subprocess
import sys
from importlib.metadata import distribution
from importlib.metadata import EntryPoint
from pathlib import Path
import pytest
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import run
from setuptools_scm.git import pa... | res.stderr | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_regressions.py | test_data_from_mime_ignores_body | assert | collection | 19 | from __future__ import annotations
import pprint
import subprocess
import sys
from importlib.metadata import distribution
from importlib.metadata import EntryPoint
from pathlib import Path
import pytest
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import run
from setuptools_scm.git import pa... | {"version": "1.0"} | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_regressions.py | test_pkginfo_noscmroot | assert | string_literal | 45 | from __future__ import annotations
import pprint
import subprocess
import sys
from importlib.metadata import distribution
from importlib.metadata import EntryPoint
from pathlib import Path
import pytest
from setuptools_scm import Configuration
from setuptools_scm._run_cmd import run
from setuptools_scm.git import pa... | "0.1.dev0+d20090213" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_bump_dev_version_zero | assert | string_literal | 28 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | "1.0" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_tag_regex1 | assert | variable | 43 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | expected | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_bump_dev_version_nonzero_raises | pytest.raises | variable | 28 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | ValueError) | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_next_semver | assert | variable | 58 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | expected_next | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_custom_version_cls | assert | string_literal | 58 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | "Custom 1.0.0-foo" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_no_guess_version_bad | pytest.raises | complex_expr | 35 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | ValueError, match=match) | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_custom_version_schemes | assert | func_call | 34 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | no_guess_dev_version(version) | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_next_semver_bad_tag | pytest.raises | complex_expr | 26 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | ValueError, match=r"1\.0\.0-foo.* can't be parsed as numeric version") | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_version_bump_bad | pytest.raises | complex_expr | 39 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | ValueError, match=".*does not end with a number to bump, " "please correct or use a custom version scheme") | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pypa/setuptools-scm | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | train | train | testing/test_version.py | test_bump_dev_version_nonzero_raises | assert | string_literal | 31 | from __future__ import annotations
from datetime import date
from datetime import timedelta
from typing import Any
import pytest
from setuptools_scm import Configuration
from setuptools_scm import NonNormalizedVersion
from setuptools_scm.version import calver_by_date
from setuptools_scm.version import format_version... | "choosing custom numbers for the `.devX` distance " "is not supported.\n " "The 1.0.dev1 can't be bumped\n" "Please drop the tag or create a new supported one ending in .dev0" | 357f6e05da74f29a69cf209d0732db96c4667603 | 231 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | pyranges/multithreaded.py | pyrange_apply | assert | collection | 167 | import numpy as np
import pandas as pd
import pyranges as pr
from natsort import natsorted
import os
def get_n_args(f):
import inspect
nparams = len(inspect.signature(f).parameters)
return nparams
def call_f(f, nparams, df, odf, kwargs):
if nparams == 3:
return f.remote(df, odf, kwargs)
... | ["same", "opposite", False, None] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/helpers.py | assert_df_equal | assert_* | variable | 54 | import pandas as pd
def assert_df_equal(df1, df2):
# df1.loc[:, "Start"] = df1.Start.astype(np.int64)
# df2.loc[:, "Start"] = df1.Start.astype(np.int64)
# df1.loc[:, "End"] = df1.End.astype(np.int64)
# df2.loc[:, "End"] = df1.End.astype(np.int64)
pd.options.mode.chained_assignment = None
if "... | df2) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/new_position/test_new_position.py | test_new_position | assert_* | variable | 18 | import pyranges as pr
import pandas as pd
import pytest
def test_new_position():
gr = pr.data.chipseq()
gr2 = pr.data.chipseq_background()
ju = gr.join(gr2, new_pos="union", suffixes="_A _B".split()).df
j = gr.join(gr2, suffix="_B")
ju2 = j.new_position("union", suffixes=(" ", "_B")).df
ju2... | ju2) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_binary.py | test_jaccard | assert | variable | 128 | import pytest
from hypothesis import given, settings, HealthCheck
from hypothesis import reproduce_failure # pylint: disable=unused-import
from itertools import product
import tempfile
import subprocess # nosec
from io import StringIO
import pandas as pd
import numpy as np
from tests.helpers import assert_df_equa... | result | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_binary.py | compare_results | assert_* | variable | 86 | import pytest
from hypothesis import given, settings, HealthCheck
from hypothesis import reproduce_failure # pylint: disable=unused-import
from itertools import product
import tempfile
import subprocess # nosec
from io import StringIO
import pandas as pd
import numpy as np
from tests.helpers import assert_df_equa... | bedtools_df) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_binary.py | test_join_new_pos | assert | func_call | 128 | import pytest
from hypothesis import given, settings, HealthCheck
from hypothesis import reproduce_failure # pylint: disable=unused-import
from itertools import product
import tempfile
import subprocess # nosec
from io import StringIO
import pandas as pd
import numpy as np
from tests.helpers import assert_df_equa... | list(new_ends) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_binary.py | compare_results | assert | complex_expr | 88 | import pytest
from hypothesis import given, settings, HealthCheck
from hypothesis import reproduce_failure # pylint: disable=unused-import
from itertools import product
import tempfile
import subprocess # nosec
from io import StringIO
import pandas as pd
import numpy as np
from tests.helpers import assert_df_equa... | result.df.empty | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_binary.py | test_join_new_pos | assert | func_call | 127 | import pytest
from hypothesis import given, settings, HealthCheck
from hypothesis import reproduce_failure # pylint: disable=unused-import
from itertools import product
import tempfile
import subprocess # nosec
from io import StringIO
import pandas as pd
import numpy as np
from tests.helpers import assert_df_equa... | list(new_starts) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_binary.py | test_coverage | assert_* | complex_expr | 142 | import pytest
from hypothesis import given, settings, HealthCheck
from hypothesis import reproduce_failure # pylint: disable=unused-import
from itertools import product
import tempfile
import subprocess # nosec
from io import StringIO
import pandas as pd
import numpy as np
from tests.helpers import assert_df_equa... | result.FractionOverlaps) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_do_not_error.py | test_three_in_a_row | assert | complex_expr | 52 | import pytest
from hypothesis import given, settings, HealthCheck
from hypothesis import reproduce_failure # pylint: disable=unused-import
from itertools import product
import numpy as np
from tests.hypothesis_helper import dfs_min2, dfs_no_min
from os import environ
strandedness = [False, "same", "opposite"]
b... | np.int64 | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_genomicfeatures.py | _introns_correct | assert | numeric_literal | 98 | import pandas as pd
import pyranges as pr
from hypothesis import given, settings
from hypothesis import reproduce_failure # pylint: disable=unused-import
from tests.hypothesis_helper import deadline, slow_max_examples
by_to_id = {"gene": "gene_id", "transcript": "transcript_id"}
def compute_introns_single(df, by):... | 0 | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_genomicfeatures.py | _introns_correct | assert | func_call | 99 | import pandas as pd
import pyranges as pr
from hypothesis import given, settings
from hypothesis import reproduce_failure # pylint: disable=unused-import
from tests.hypothesis_helper import deadline, slow_max_examples
by_to_id = {"gene": "gene_id", "transcript": "transcript_id"}
def compute_introns_single(df, by):... | len(_introns) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_genomicfeatures.py | test_introns_single | assert | func_call | 128 | import pandas as pd
import pyranges as pr
from hypothesis import given, settings
from hypothesis import reproduce_failure # pylint: disable=unused-import
from tests.hypothesis_helper import deadline, slow_max_examples
by_to_id = {"gene": "gene_id", "transcript": "transcript_id"}
def compute_introns_single(df, by):... | list(actual.End) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_genomicfeatures.py | _introns_correct | assert | func_call | 101 | import pandas as pd
import pyranges as pr
from hypothesis import given, settings
from hypothesis import reproduce_failure # pylint: disable=unused-import
from tests.hypothesis_helper import deadline, slow_max_examples
by_to_id = {"gene": "gene_id", "transcript": "transcript_id"}
def compute_introns_single(df, by):... | list(expected.End) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_genomicfeatures.py | test_introns_single | assert | func_call | 127 | import pandas as pd
import pyranges as pr
from hypothesis import given, settings
from hypothesis import reproduce_failure # pylint: disable=unused-import
from tests.hypothesis_helper import deadline, slow_max_examples
by_to_id = {"gene": "gene_id", "transcript": "transcript_id"}
def compute_introns_single(df, by):... | list(actual.Start) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_genomicfeatures.py | _introns_correct | assert | func_call | 100 | import pandas as pd
import pyranges as pr
from hypothesis import given, settings
from hypothesis import reproduce_failure # pylint: disable=unused-import
from tests.hypothesis_helper import deadline, slow_max_examples
by_to_id = {"gene": "gene_id", "transcript": "transcript_id"}
def compute_introns_single(df, by):... | list(expected.Start) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_getset_attr.py | test_getsetattr_fails | pytest.raises | variable | 6 | import pytest
def test_getsetattr_fails(chip_10):
with pytest.raises( | Exception) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_io.py | test_read_gtf | assert | string_literal | 8 | import pyranges as pr
def test_read_gtf():
gr = pr.read_gtf("tests/test_data/ensembl.gtf", full=False)
assert list(gr.df.columns[:4]) == | "Chromosome Start End Strand".split() | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_stranded.py | test_stranded | assert | numeric_literal | 24 | import pyranges as pr
import numpy as np
np.random.seed(0)
def test_stranded():
cpg = pr.data.cpg()
exons = pr.data.exons()
j = cpg.join(exons)
assert j.stranded
j.Strand = "."
assert not j.stranded
j.Strand = np.random.choice("+ -".split(), size=len(j))
assert j.stranded
fo... | 1 | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_stranded.py | test_unstrand | assert | func_call | 15 | import pyranges as pr
import numpy as np
np.random.seed(0)
def test_unstrand():
exons = pr.data.exons()
cpg = pr.data.cpg()
x = exons.unstrand()
for _, df in x:
print(len(df.index), len(set(df.index)))
assert len(df.index) == | len(set(df.index)) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_tes_tss.py | test_three_end | assert | collection | 10 | def test_three_end(f2):
print(f2)
result = f2.three_end(slack=500)
print(result)
assert list(result.Start) == | [0, 0] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_tes_tss.py | test_five_end | assert | collection | 9 | def test_five_end(f1):
result = f1.five_end(slack=5)
print(f1)
print(result)
assert list(result.Start) == | [0, 3, 2] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_tes_tss.py | test_three_end | assert | collection | 11 | def test_three_end(f2):
print(f2)
result = f2.three_end(slack=500)
print(result)
assert list(result.Start) == [0, 0]
assert list(result.End) == | [503, 508] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_tes_tss.py | test_five_end | assert | collection | 10 | def test_five_end(f1):
result = f1.five_end(slack=5)
print(f1)
print(result)
assert list(result.Start) == [0, 3, 2]
assert list(result.End) == | [9, 14, 13] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_unary.py | test_cluster_by | assert_* | variable | 62 | import pytest
from natsort import natsorted
from hypothesis import given, settings, HealthCheck #, assume
from hypothesis import reproduce_failure # pylint: disable=unused-import
import tempfile
import subprocess # nosec
from io import StringIO
import numpy as np
import pandas as pd
from tests.helpers import as... | expected) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_unary.py | test_cluster | assert_* | variable | 83 | import pytest
from natsort import natsorted
from hypothesis import given, settings, HealthCheck #, assume
from hypothesis import reproduce_failure # pylint: disable=unused-import
import tempfile
import subprocess # nosec
from io import StringIO
import numpy as np
import pandas as pd
from tests.helpers import as... | bedtools_df) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_unary.py | test_merge | assert | complex_expr | 82 | import pytest
from natsort import natsorted
from hypothesis import given, settings, HealthCheck #, assume
from hypothesis import reproduce_failure # pylint: disable=unused-import
import tempfile
import subprocess # nosec
from io import StringIO
import numpy as np
import pandas as pd
from tests.helpers import as... | result.df.empty | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_unary.py | test_merge | assert_* | func_call | 78 | import pytest
from natsort import natsorted
from hypothesis import given, settings, HealthCheck #, assume
from hypothesis import reproduce_failure # pylint: disable=unused-import
import tempfile
import subprocess # nosec
from io import StringIO
import numpy as np
import pandas as pd
from tests.helpers import as... | bedtools_df.sort_values("Chromosome Start".split())) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/test_unary.py | test_merge | assert_* | func_call | 74 | import pytest
from natsort import natsorted
from hypothesis import given, settings, HealthCheck #, assume
from hypothesis import reproduce_failure # pylint: disable=unused-import
import tempfile
import subprocess # nosec
from io import StringIO
import numpy as np
import pandas as pd
from tests.helpers import as... | bedtools_df.sort_values("Chromosome Start Strand".split())) | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/windows/test_windows.py | test_windows | assert | collection | 31 | import pytest
import pyranges as pr
import pandas as pd
from io import StringIO
def expected_result():
c = """Chromosome Start End Name Score Strand
0 chr1 0 10 interval1 0 +
1 chr1 0 10 interval3 0 +
2 chr1 0 10 interval2 0 -"""
... | [2, 4, 8, 4, 6] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/windows/test_windows.py | test_windows | assert | collection | 32 | import pytest
import pyranges as pr
import pandas as pd
from io import StringIO
def expected_result():
c = """Chromosome Start End Name Score Strand
0 chr1 0 10 interval1 0 +
1 chr1 0 10 interval3 0 +
2 chr1 0 10 interval2 0 -"""
... | [4, 6, 10, 6, 8] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pyranges/pyranges | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | train | train | tests/windows/test_windows.py | test_windows2 | assert | collection | 40 | import pytest
import pyranges as pr
import pandas as pd
from io import StringIO
def expected_result():
c = """Chromosome Start End Name Score Strand
0 chr1 0 10 interval1 0 +
1 chr1 0 10 interval3 0 +
2 chr1 0 10 interval2 0 -"""
... | [10200, 10400, 51400, 51600, 51800] | 7b5ac852729b35c02531a8f305f184cd308aeb3b | 156 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | pytest_bdd/parser.py | as_contexts | assert | func_call | 212 | from __future__ import annotations
import os.path
import re
import textwrap
import typing
from collections import OrderedDict
from typing import cast
from . import exceptions, types
SPLIT_LINE_RE = re.compile(r"(?<!\\)\|")
STEP_PARAM_RE = re.compile(r"<(.+?)>")
COMMENT_RE = re.compile(r"(^|(?<=\s))#")
STEP_PREFIXES ... | len(row) | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | pytest_bdd/scenario.py | _execute_step_function | assert | none_literal | 119 | from __future__ import annotations
import contextlib
import logging
import os
import re
from typing import TYPE_CHECKING, Callable, Iterator, cast
import pytest
from _pytest.fixtures import FixtureDef, FixtureManager, FixtureRequest, call_fixture_func
from _pytest.nodes import iterparentnodeids
from . import excepti... | None | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/args/test_common.py | test_reuse_same_step_different_converters | assert | numeric_literal | 51 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_reuse_same_step_different_converters(testdir):
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Reuse same step with different converters
Scenario: Step functi... | 42 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/args/test_common.py | test_reuse_same_step_different_converters | assert | variable | 50 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_reuse_same_step_different_converters(testdir):
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Reuse same step with different converters
Scenario: Step functi... | int | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/args/test_common.py | test_reuse_same_step_different_converters | assert | variable | 53 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_reuse_same_step_different_converters(testdir):
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Reuse same step with different converters
Scenario: Step functi... | str | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/args/test_common.py | test_reuse_same_step_different_converters | assert | string_literal | 54 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_reuse_same_step_different_converters(testdir):
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Reuse same step with different converters
Scenario: Step functi... | "42" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/args/test_common.py | test_reuse_same_step_different_converters | assert | numeric_literal | 57 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_reuse_same_step_different_converters(testdir):
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Reuse same step with different converters
Scenario: Step functi... | 42.0 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/args/test_common.py | test_string_steps_dont_take_precedence | assert | string_literal | 62 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_string_steps_dont_take_precedence(testdir):
"""Test that normal steps don't take precedence over the other steps."""
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Step ... | "re" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_cucumber_json.py | test_step_trace | assert | variable | 219 | from __future__ import annotations
import json
import os.path
import textwrap
from typing import TYPE_CHECKING, Any
def runandparse(testdir: Testdir, *args: Any) -> tuple[RunResult, list[dict[str, Any]]]:
"""Run tests in testdir and parse json output."""
resultpath = testdir.tmpdir.join("cucumber.json")
r... | expected | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_outline.py | test_outlined | assert | collection | 73 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
STEPS = """\
from pytest_bdd import parsers, given, when, then
from pytest_bdd.utils import dump_obj
@given(parsers.parse("there are {start:d} cucumbers"), target_fixture="cucumbers")
def _(start):
assert isinstance(start, int)
dump_obj(sta... | [ 12, 5.0, "7", 5, 4.0, "1", ] | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_outline.py | test_outline_with_escaped_pipes | assert | collection | 78 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
STEPS = """\
from pytest_bdd import parsers, given, when, then
from pytest_bdd.utils import dump_obj
@given(parsers.parse("there are {start:d} cucumbers"), target_fixture="cucumbers")
def _(start):
assert isinstance(start, int)
dump_obj(sta... | [ r"bork", r"|bork", r"bork |", r"bork||bork", r"|", r"bork \\", r"bork \\|", ] | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_outline_empty_values.py | test_scenario_with_empty_example_values | assert | collection | 62 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
STEPS = """\
from pytest_bdd import given, when, then, parsers
from pytest_bdd.utils import dump_obj
# Using `parsers.re` so that we can match empty values
@given(parsers.re("there are (?P<start>.*?) cucumbers"))
def _(start):
dump_obj(start)
... | ["#", "", ""] | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_report.py | test_step_trace | assert | variable | 125 | import textwrap
import pytest
def test_step_trace(testdir):
"""Test step trace."""
testdir.makefile(
".ini",
pytest=textwrap.dedent(
"""
[pytest]
markers =
feature-tag
scenario-passing-tag
scenario-failing-tag
"""
),
)
feature = t... | expected | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_steps.py | test_step_hooks | assert | numeric_literal | 105 | import textwrap
def test_step_hooks(testdir):
"""When step fails."""
testdir.makefile(
".feature",
test="""
Scenario: When step has hook on failure
Given I have a bar
When it fails
Scenario: When step's dependency a has failure
Given I have a bar
When it... | 2 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_steps.py | test_step_hooks | assert | numeric_literal | 108 | import textwrap
def test_step_hooks(testdir):
"""When step fails."""
testdir.makefile(
".feature",
test="""
Scenario: When step has hook on failure
Given I have a bar
When it fails
Scenario: When step's dependency a has failure
Given I have a bar
When it... | 1 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_steps.py | test_step_trace | assert | func_call | 65 | import textwrap
def test_step_trace(testdir):
"""Test step trace."""
testdir.makeini(
"""
[pytest]
console_output_style=classic
"""
)
testdir.makefile(
".feature",
test="""
Scenario: When step has failure
Given I have a bar
When it fails
... | result.stdout.str() | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_tags.py | test_tags_selector | assert | numeric_literal | 56 | import textwrap
import pkg_resources
import pytest
from pytest_bdd.parser import get_tags
def test_tags_selector(testdir):
"""Test tests selection by tags."""
testdir.makefile(
".ini",
pytest=textwrap.dedent(
"""
[pytest]
markers =
feature_tag_1
feature_tag... | 1 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_tags.py | test_tags_selector | assert | numeric_literal | 64 | import textwrap
import pkg_resources
import pytest
from pytest_bdd.parser import get_tags
def test_tags_selector(testdir):
"""Test tests selection by tags."""
testdir.makefile(
".ini",
pytest=textwrap.dedent(
"""
[pytest]
markers =
feature_tag_1
feature_tag... | 2 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/feature/test_tags.py | test_get_tags | assert | variable | 22 | import textwrap
import pkg_resources
import pytest
from pytest_bdd.parser import get_tags
@pytest.mark.parametrize(
"line, expected",
[
("@foo @bar", {"foo", "bar"}),
("@with spaces @bar", {"with spaces", "bar"}),
("@double @double", {"double"}),
(" @indented", {"indented"}... | expected | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/generation/test_generate_missing.py | test_generate_missing | assert | numeric_literal | 59 | import itertools
import textwrap
from pytest_bdd.scenario import get_python_name_generator
def test_generate_missing(testdir):
"""Test generate missing command."""
testdir.makefile(
".feature",
generation=textwrap.dedent(
"""\
Feature: Missing code generation
... | 0 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/generation/test_generate_missing.py | test_generate_missing_with_step_parsers | assert | variable | 59 | import itertools
import textwrap
from pytest_bdd.scenario import get_python_name_generator
def test_generate_missing_with_step_parsers(testdir):
"""Test that step parsers are correctly discovered and won't be part of the missing steps."""
testdir.makefile(
".feature",
generation=textwrap.deden... | output | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/generation/test_generate_missing.py | test_python_name_generator | assert | collection | 9 | import itertools
import textwrap
from pytest_bdd.scenario import get_python_name_generator
def test_python_name_generator():
"""Test python name generator function."""
assert list(itertools.islice(get_python_name_generator("Some name"), 3)) == | [ "test_some_name", "test_some_name_1", "test_some_name_2", ] | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/library/test_parent.py | test_uses_correct_step_in_the_hierarchy | assert | variable | 179 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_uses_correct_step_in_the_hierarchy(testdir):
"""
Test regression found in issue #524, where we couldn't find the correct step implemntation in the
hierarchy of files/folder as expected.
This test uses many files and folders t... | thing2 | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/library/test_parent.py | test_global_when_step | assert | string_literal | 47 | import textwrap
from pytest_bdd.utils import collect_dumped_objects
def test_global_when_step(testdir):
"""Test when step defined in the parent conftest."""
testdir.makefile(
".feature",
global_when=textwrap.dedent(
"""\
Feature: Global when
Scenario: G... | "global when step" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/scripts/test_generate.py | test_unicode_characters | assert | variable | 66 | import os
import sys
import textwrap
from pytest_bdd.scripts import main
PATH = os.path.dirname(__file__)
def test_unicode_characters(testdir, monkeypatch):
"""Test generating code with unicode characters.
Primary purpose is to ensure compatibility with Python2.
"""
testdir.makefile(
".feat... | expected_output | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/scripts/test_main.py | test_main | assert | variable | 15 | import os
import sys
from pytest_bdd.scripts import main
PATH = os.path.dirname(__file__)
def test_main(monkeypatch, capsys):
"""Test if main command shows help when called without the subcommand."""
monkeypatch.setattr(sys, "argv", ["pytest-bdd"])
monkeypatch.setattr(sys, "exit", lambda x: x)
main()... | err | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/scripts/test_migrate.py | test_migrate | assert | variable | 38 | import os
import sys
import textwrap
from pytest_bdd.scripts import main
PATH = os.path.dirname(__file__)
def test_migrate(monkeypatch, capsys, testdir):
"""Test if the code is migrated by a given file mask."""
tests = testdir.mkpydir("tests")
tests.join("test_foo.py").write(
textwrap.dedent(
... | expected | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/scripts/test_migrate.py | test_migrate | assert | func_call | 39 | import os
import sys
import textwrap
from pytest_bdd.scripts import main
PATH = os.path.dirname(__file__)
def test_migrate(monkeypatch, capsys, testdir):
"""Test if the code is migrated by a given file mask."""
tests = testdir.mkpydir("tests")
tests.join("test_foo.py").write(
textwrap.dedent(
... | textwrap.dedent( ''' """Foo bar tests.""" from pytest_bdd import scenario @scenario('foo_bar.feature', 'Foo bar') def test_foo(): pass ''' ) | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_given_when_then_delegate_to_step | assert_* | string_literal | 21 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
@pytest.mark.parametrize("step_fn, step_type", [(given, "given"), (when, "when"), (then, "then")])
def test_given_when_then_de... | "foo") | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_step_functions_same_parser | assert | collection | 55 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
def test_step_functions_same_parser(testdir):
testdir.makefile(
".feature",
target_fixture=textwrap.dedent... | ("str",) | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_step_function_multiple_target_fixtures | assert | string_literal | 55 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
def test_step_function_multiple_target_fixtures(testdir):
testdir.makefile(
".feature",
target_fixture=tex... | "test foo" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_step_function_multiple_target_fixtures | assert | string_literal | 56 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
def test_step_function_multiple_target_fixtures(testdir):
testdir.makefile(
".feature",
target_fixture=tex... | "test bar" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_user_implements_a_step_generator | assert | string_literal | 156 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
def test_user_implements_a_step_generator(testdir):
"""Test advanced use cases, like the implementation of custom step gen... | "pay 1 EUR" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_user_implements_a_step_generator | assert | string_literal | 155 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
def test_user_implements_a_step_generator(testdir):
"""Test advanced use cases, like the implementation of custom step gen... | "given 10 EUR" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_user_implements_a_step_generator | assert | string_literal | 157 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
def test_user_implements_a_step_generator(testdir):
"""Test advanced use cases, like the implementation of custom step gen... | "assert 9 EUR" | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
pytest-dev/pytest-bdd | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | train | train | tests/steps/test_common.py | test_step_functions_same_parser | assert | collection | 56 | import textwrap
from typing import Any, Callable
from unittest import mock
import pytest
from pytest_bdd import given, parsers, then, when
from pytest_bdd.utils import collect_dumped_objects
def test_step_functions_same_parser(testdir):
testdir.makefile(
".feature",
target_fixture=textwrap.dedent... | ("re", "testfoo") | c5568af6f2b5438646da180df2fb005cd015a7ae | 144 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.