repo_id string | cross_repo_split string | commit_index int32 | commit_sha string | in_repo_split string | test_file string | file_split string | split_group string | lineno int32 | col_offset int32 | assertion_type string | test_function string | prefix large_string | target string | assertion_event_type string | assertion_event_id string | assertion_anchor large_string | old_target string | old_lineno int32 | old_col_offset int32 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 296 | 8 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors.get(found_error) | modified | 1500da42abb3a98e37612a859a1e2017603093dff8897e390ba93bb915f282ab | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors.get(found_error) | 296 | 8 | |
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_visitors/test_ast/test_blocks/test_outer_scope_shadow.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_outer_scope_shadow.py | 324 | 4 | assert_* | test_outer_variable_shadow | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
OuterScopeShadowingViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor
# Correct:
correct_for_loop1 = """
import ast
def wrapper():
... | [OuterScopeShadowingViolation]) | added | 4fa30959e2a504fa97496d4ce4e9f835503a397efe6fe50b0002666efd2e3e33 | assert_*|test_outer_variable_shadow|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( OuterScopeShadowingViolation, ) from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor # Correct: correct_for_loop1 = """ i... | null | null | null |
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_visitors/test_ast/test_blocks/test_overlap/test_blocks_overlap.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_overlap/test_blocks_overlap.py | 144 | 4 | assert_* | test_block_overlap | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
BlockAndLocalOverlapViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor
# Wrong:
import_and_class1 = """
import overlap
class overlap: ... | 'overlap') | added | 110fdc868ba25a86d5cc5a834bc0968a6922ed750d14ea5c282c0f8aab335712 | assert_*|test_block_overlap|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( BlockAndLocalOverlapViolation, ) from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor # Wrong: import_and_class1 = """ import ove... | null | null | null |
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | 124 | 4 | assert_* | test_incorrect_fields | import pytest
from wemake_python_styleguide.violations.oop import (
ShadowedClassAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor
# Can raise:
class_attribute = """
class ClassWithAttrs(object):
{0} = 0
def __init__(self) -> None:
self.{1} = 2... | [ShadowedClassAttributeViolation]) | added | 36588f92bf50ab14dce4e1c8d5465ed744a582462fd61187e93ba4cd7d5342c2 | assert_*|test_incorrect_fields|import pytest from wemake_python_styleguide.violations.oop import ( ShadowedClassAttributeViolation, ) from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor # Can raise: class_attribute = """ class ClassWithAttrs(object): {0} = 0 def __init__(self) -> None: self.... | null | null | null |
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | 125 | 4 | assert_* | test_incorrect_fields | import pytest
from wemake_python_styleguide.violations.oop import (
ShadowedClassAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor
# Can raise:
class_attribute = """
class ClassWithAttrs(object):
{0} = 0
def __init__(self) -> None:
self.{1} = 2... | field_name) | added | 94927f5e1f5bc80de828ba739ccd858f4792ca2971f1188cb5fae06475dfbcea | assert_*|test_incorrect_fields|import pytest from wemake_python_styleguide.violations.oop import ( ShadowedClassAttributeViolation, ) from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor # Can raise: class_attribute = """ class ClassWithAttrs(object): {0} = 0 def __init__(self) -> None: self.... | null | null | null |
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_visitors/test_ast/test_compares/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_redundant.py | 83 | 4 | assert_* | test_useless_with_in | import pytest
from wemake_python_styleguide.violations.consistency import (
UselessCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor
create_variables = """
variable = 1
another_variable = 2
{0}
"""
@pytest.mark.filterwarnings('ignore::SyntaxWarning')
@pytest.mar... | [UselessCompareViolation]) | modified | 3ba821fd4bdb2d55a8e314efd97198d0b7d79a9e16a781f02f2a59d48b834d7f | assert_*|test_useless_with_in|import pytest from wemake_python_styleguide.violations.consistency import ( UselessCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor create_variables = """ variable = 1 another_variable = 2 {0} """ @pytest.mark.filterwarnings('ignore::Synta... | [UselessCompareViolation]) | 83 | 4 |
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_arguments_lambda.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_arguments_lambda.py | 98 | 4 | assert_* | test_no_arguments_error | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyArgumentsViolation,
)
lambda_without_arguments = 'lambda: ...'
lambda_with_single_argument = 'lambda arg1: ...'
lambda_with_default... | [TooManyArgumentsViolation]) | modified | 53da55ff793a9d392a8bce10e8a6c7343a4c0548f8024a801fea19e87791f961 | assert_*|test_no_arguments_error|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyArgumentsViolation, ) lambda_without_arguments = 'lambda: ...' lambda_with_single_argument = 'lambda arg1: .... | [TooManyArgumentsViolation]) | 98 | 4 |
wemake-services/wemake-python-styleguide | train | 425 | 0f50854b2c2ed335f8e86a6da2f9d6e0df369619 | train | tests/test_visitors/test_ast/test_functions/test_unused_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_unused_variables.py | 169 | 4 | assert_* | test_wrong_super_call | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsUsedViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FunctionDefinitionVisitor,
)
# Correct:
correct_module = """
_PROTECTED = 1
PUBLIC =... | [UnusedVariableIsUsedViolation]) | added | d89c9d4da6ac1f1a4ac172a945918f06818928aad6d8e5f9674ad26b43372712 | assert_*|test_wrong_super_call|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.naming import ( UnusedVariableIsUsedViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FunctionDefinitionVisitor, ) # Correct: correct_module = """ _PR... | null | null | null |
wemake-services/wemake-python-styleguide | train | 426 | 74b86156d73c2a4fe9c755138f6953fec41fab3b | train | tests/test_visitors/test_ast/test_compares/test_in_type_check.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_in_type_check.py | 48 | 4 | assert_* | test_compare_with_wrong_type | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
InCompareWithSingleItemContainerViolation,
WrongInCompareTypeViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
InCompareSanityVisitor,
)
in_templat... | [WrongInCompareTypeViolation]) | added | 9b69b5e1a5f167b7767160cb81a4d6a9324637783d694e5c3cac13dc716ae68e | assert_*|test_compare_with_wrong_type|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( InCompareWithSingleItemContainerViolation, WrongInCompareTypeViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( InCompareSan... | null | null | null |
wemake-services/wemake-python-styleguide | train | 427 | 4037d2660f948dd56d4f6326f62503333ae26400 | train | tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | 133 | 4 | assert_* | test_incorrect_fields | import pytest
from wemake_python_styleguide.violations.oop import (
ShadowedClassAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor
# Can raise:
class_attribute = """
class ClassWithAttrs(object):
{0} = 0
def __init__(self) -> None:
self.{1} = 2... | [ShadowedClassAttributeViolation]) | added | 074271fee3e497ed0858067b4dec514d8dbeba9fd1bce2061a773bc560fe86c7 | assert_*|test_incorrect_fields|import pytest from wemake_python_styleguide.violations.oop import ( ShadowedClassAttributeViolation, ) from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor # Can raise: class_attribute = """ class ClassWithAttrs(object): {0} = 0 def __init__(self) -> None: self.... | null | null | null |
wemake-services/wemake-python-styleguide | train | 427 | 4037d2660f948dd56d4f6326f62503333ae26400 | train | tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_class_attributes/test_shadow_attributes.py | 134 | 4 | assert_* | test_incorrect_fields | import pytest
from wemake_python_styleguide.violations.oop import (
ShadowedClassAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor
# Can raise:
class_attribute = """
class ClassWithAttrs(object):
{0} = 0
def __init__(self) -> None:
self.{1} = 2... | field_name) | added | dd7ae4c94c1fc08335d4365fc153a50ccbe29c83faa5f2884149b7658bb63725 | assert_*|test_incorrect_fields|import pytest from wemake_python_styleguide.violations.oop import ( ShadowedClassAttributeViolation, ) from wemake_python_styleguide.visitors.ast.classes import ClassAttributeVisitor # Can raise: class_attribute = """ class ClassWithAttrs(object): {0} = 0 def __init__(self) -> None: self.... | null | null | null |
wemake-services/wemake-python-styleguide | train | 427 | 4037d2660f948dd56d4f6326f62503333ae26400 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | 143 | 4 | assert_* | test_locals_wrong_count | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import TooManyLocalsViolation
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
function_with_locals = """
def function():
local_varia... | [TooManyLocalsViolation]) | added | 7ff893985da14d9532a09ee6c6a3fe9d0f6c2cf51d383a256c72b5c0d035c2dd | assert_*|test_locals_wrong_count|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import TooManyLocalsViolation from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) function_with_locals = """ def ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 427 | 4037d2660f948dd56d4f6326f62503333ae26400 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | 144 | 4 | assert_* | test_locals_wrong_count | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import TooManyLocalsViolation
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
function_with_locals = """
def function():
local_varia... | option_values.max_local_variables) | added | 62786b8ac711be276eb43a44a3d2be5dfad6a5b5fe20a7c1b7400c0c7d30c27e | assert_*|test_locals_wrong_count|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import TooManyLocalsViolation from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) function_with_locals = """ def ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 428 | 5cd0702c942fdc0ba00212dc3cd65acd78084fa8 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | 145 | 4 | assert_* | test_locals_wrong_count | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooManyLocalsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
function_with_locals = """
def function():
lo... | [TooManyLocalsViolation]) | modified | 10d59a6a6bcaeed5f69a43d8d340a321a28bcb48161842ea0bcee63d7dcf04a6 | assert_*|test_locals_wrong_count|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooManyLocalsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) function_with_locals = """... | [TooManyLocalsViolation]) | 143 | 4 |
wemake-services/wemake-python-styleguide | train | 428 | 5cd0702c942fdc0ba00212dc3cd65acd78084fa8 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | 146 | 4 | assert_* | test_locals_wrong_count | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooManyLocalsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
function_with_locals = """
def function():
lo... | option_values.max_local_variables) | modified | 8e710233fc3886913afdb6c4e8f7b98a3d4acb7f9212c7b8fb1ac64661a494e6 | assert_*|test_locals_wrong_count|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooManyLocalsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) function_with_locals = """... | option_values.max_local_variables) | 144 | 4 |
wemake-services/wemake-python-styleguide | train | 429 | 78af910e92e64afc43c9e21af05593461479d02a | train | tests/test_formatter/test_formatter_output.py | train | wemake-services/wemake-python-styleguide:tests/test_formatter/test_formatter_output.py | 36 | 4 | assert | """
We use direct string assertiong on the formatter.
So, no unit tests for formatter, only e2e ones.
We use ``snapshottest`` to render and assert equality of the output:
https://github.com/syrusakbary/snapshottest
To update snapshots use ``--snapshot-update`` flag, when running ``pytest``.
We also don't use ``abso... | pkg_version | added | 472603b05557ed86449bd793dec111e1f4135197f2ce0260e2b5810b0b4440bf | assert||""" We use direct string assertiong on the formatter. So, no unit tests for formatter, only e2e ones. We use ``snapshottest`` to render and assert equality of the output: https://github.com/syrusakbary/snapshottest To update snapshots use ``--snapshot-update`` flag, when running ``pytest``. We also don't use ``... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 429 | 78af910e92e64afc43c9e21af05593461479d02a | train | tests/test_formatter/test_formatter_output.py | train | wemake-services/wemake-python-styleguide:tests/test_formatter/test_formatter_output.py | 80 | 4 | assert_* | test_formatter | """
We use direct string assertiong on the formatter.
So, no unit tests for formatter, only e2e ones.
We use ``snapshottest`` to render and assert equality of the output:
https://github.com/syrusakbary/snapshottest
To update snapshots use ``--snapshot-update`` flag, when running ``pytest``.
We also don't use ``abso... | 'formatter_{0}'.format(output)) | modified | 70e95b99d36da9d02362fba3d0f4ad81ad9d3fbcb4fd311e8fcb5a83ad082121 | assert_*|test_formatter|""" We use direct string assertiong on the formatter. So, no unit tests for formatter, only e2e ones. We use ``snapshottest`` to render and assert equality of the output: https://github.com/syrusakbary/snapshottest To update snapshots use ``--snapshot-update`` flag, when running ``pytest``. We a... | 'formatter_{0}'.format(output)) | 78 | 4 |
wemake-services/wemake-python-styleguide | train | 429 | 78af910e92e64afc43c9e21af05593461479d02a | train | tests/test_formatter/test_formatter_output.py | train | wemake-services/wemake-python-styleguide:tests/test_formatter/test_formatter_output.py | 114 | 4 | assert_* | test_formatter_correct | """
We use direct string assertiong on the formatter.
So, no unit tests for formatter, only e2e ones.
We use ``snapshottest`` to render and assert equality of the output:
https://github.com/syrusakbary/snapshottest
To update snapshots use ``--snapshot-update`` flag, when running ``pytest``.
We also don't use ``abso... | 'formatter_correct_{0}'.format(output)) | modified | 7514ee434b65bf51fef6c83e842d761241b63eec0ab281e8fbaf9a3f9727f858 | assert_*|test_formatter_correct|""" We use direct string assertiong on the formatter. So, no unit tests for formatter, only e2e ones. We use ``snapshottest`` to render and assert equality of the output: https://github.com/syrusakbary/snapshottest To update snapshots use ``--snapshot-update`` flag, when running ``pytest... | 'formatter_correct_{0}'.format(output)) | 112 | 4 |
wemake-services/wemake-python-styleguide | train | 429 | 78af910e92e64afc43c9e21af05593461479d02a | train | tests/test_version.py | train | wemake-services/wemake-python-styleguide:tests/test_version.py | 15 | 4 | assert | test_call_flake8_version | import subprocess
from wemake_python_styleguide.version import pkg_name, pkg_version
def test_call_flake8_version():
"""Checks that module is registered and visible in the meta data."""
output_text = subprocess.check_output(
['flake8', '--version'],
stderr=subprocess.STDOUT,
universal... | pkg_name | added | 5ebb5d00bd8a7cc550ddc05bd1e00bcb98f7f87647de7836f9dc7af80eca48b0 | assert|test_call_flake8_version|import subprocess from wemake_python_styleguide.version import pkg_name, pkg_version def test_call_flake8_version(): """Checks that module is registered and visible in the meta data.""" output_text = subprocess.check_output( ['flake8', '--version'], stderr=subprocess.STDOUT, universal_ne... | null | null | null |
wemake-services/wemake-python-styleguide | train | 429 | 78af910e92e64afc43c9e21af05593461479d02a | train | tests/test_version.py | train | wemake-services/wemake-python-styleguide:tests/test_version.py | 16 | 4 | assert | test_call_flake8_version | import subprocess
from wemake_python_styleguide.version import pkg_name, pkg_version
def test_call_flake8_version():
"""Checks that module is registered and visible in the meta data."""
output_text = subprocess.check_output(
['flake8', '--version'],
stderr=subprocess.STDOUT,
universal... | pkg_version | added | 21a3bf5cfe9fd984543c4fb786425dbaa4f4ae216e5fe883b3b6d93375676d4b | assert|test_call_flake8_version|import subprocess from wemake_python_styleguide.version import pkg_name, pkg_version def test_call_flake8_version(): """Checks that module is registered and visible in the meta data.""" output_text = subprocess.check_output( ['flake8', '--version'], stderr=subprocess.STDOUT, universal_ne... | null | null | null |
wemake-services/wemake-python-styleguide | train | 429 | 78af910e92e64afc43c9e21af05593461479d02a | train | tests/test_version.py | train | wemake-services/wemake-python-styleguide:tests/test_version.py | 18 | 4 | assert | test_call_flake8_version | import subprocess
from wemake_python_styleguide.version import pkg_name, pkg_version
def test_call_flake8_version():
"""Checks that module is registered and visible in the meta data."""
output_text = subprocess.check_output(
['flake8', '--version'],
stderr=subprocess.STDOUT,
universal... | output_text | modified | e6db19856e6014457435d199e12d31e2c294a0699d2765fbf0439a5e2e40b307 | assert|test_call_flake8_version|import subprocess from wemake_python_styleguide.version import pkg_name, pkg_version def test_call_flake8_version(): """Checks that module is registered and visible in the meta data.""" output_text = subprocess.check_output( ['flake8', '--version'], stderr=subprocess.STDOUT, universal_ne... | output_text | 15 | 4 |
wemake-services/wemake-python-styleguide | train | 429 | 78af910e92e64afc43c9e21af05593461479d02a | train | tests/test_version.py | train | wemake-services/wemake-python-styleguide:tests/test_version.py | 19 | 4 | assert | test_call_flake8_version | import subprocess
from wemake_python_styleguide.version import pkg_name, pkg_version
def test_call_flake8_version():
"""Checks that module is registered and visible in the meta data."""
output_text = subprocess.check_output(
['flake8', '--version'],
stderr=subprocess.STDOUT,
universal... | output_text | modified | fd03013b2979e77f0c79711ad42b51cf8dd0e3c95b866d1c474403f9986c0b85 | assert|test_call_flake8_version|import subprocess from wemake_python_styleguide.version import pkg_name, pkg_version def test_call_flake8_version(): """Checks that module is registered and visible in the meta data.""" output_text = subprocess.check_output( ['flake8', '--version'], stderr=subprocess.STDOUT, universal_ne... | output_text | 16 | 4 |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_compares/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_literal.py | 60 | 4 | assert_* | test_literal | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
ConstantCompareViolation,
ReversedComplexCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor
chained_compares1 = '0 < {0} < {1}... | [ConstantCompareViolation]) | added | bc06e8c4871b128a67606765ee17261e3fc47e7241c93edbb0724ce8e840964a | assert_*|test_literal|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( ConstantCompareViolation, ReversedComplexCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor chained_compares1 = '0... | null | null | null |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_compares/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_literal.py | 116 | 4 | assert_* | test_literal_special2 | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
ConstantCompareViolation,
ReversedComplexCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor
chained_compares1 = '0 < {0} < {1}... | ReversedComplexCompareViolation) | added | 0bbba27d09965ab0c4ee26e1fcad9129ec767864869fa473b066cd93faeadd79 | assert_*|test_literal_special2|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( ConstantCompareViolation, ReversedComplexCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor chained_compa... | null | null | null |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_compares/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_redundant.py | 78 | 4 | assert_* | test_useless | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
UselessCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor
create_variables = """
variable = 1
another_variable = 2
{0}
"""
correc... | [UselessCompareViolation]) | added | 2b60f577e578d6796c61c463d079f2f86108764fccb06099efd3cf1902980e1a | assert_*|test_useless|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( UselessCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor create_variables = """ variable = 1 another_variable = 2... | null | null | null |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_compares/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_redundant.py | 97 | 4 | assert_* | test_useless_with_in | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
UselessCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor
create_variables = """
variable = 1
another_variable = 2
{0}
"""
correc... | [UselessCompareViolation]) | added | bf2789ab03a7fad7c38af1ec28312b042bf11189f086b6069547064802c8f666 | assert_*|test_useless_with_in|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( UselessCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor create_variables = """ variable = 1 another_vari... | null | null | null |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_compares/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_redundant.py | 111 | 4 | assert_* | test_multiple_compare | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
UselessCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor
create_variables = """
variable = 1
another_variable = 2
{0}
"""
correc... | [UselessCompareViolation]) | added | 1cc29b6e9f81eddec44d3ad4bb2cbf2e2359a94892e01ff3210ee4c0a76c828c | assert_*|test_multiple_compare|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( UselessCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor create_variables = """ variable = 1 another_var... | null | null | null |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_naming/test_unused/test_unused_definition.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_unused/test_unused_definition.py | 58 | 4 | assert_* | test_unused_variable_definition | from textwrap import indent
import pytest
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsDefinedViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
UnusedVaribaleDefinitionVisitor,
)
module_context = '{0}'
function_context = """
def function():
{0}
"""
method_c... | [UnusedVariableIsDefinedViolation]) | modified | 44677e6a6c1a7ce08ca1b6b32db9b46f203e536b64299b65aa125508c66717ff | assert_*|test_unused_variable_definition|from textwrap import indent import pytest from wemake_python_styleguide.violations.naming import ( UnusedVariableIsDefinedViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( UnusedVaribaleDefinitionVisitor, ) module_context = '{0}' function_context = """ def ... | [UnusedVariableIsDefinedViolation]) | 57 | 4 |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_naming/test_unused/test_unused_definition.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_unused/test_unused_definition.py | 197 | 4 | assert_* | test_raw_unused_variable_definition | from textwrap import indent
import pytest
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsDefinedViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
UnusedVaribaleDefinitionVisitor,
)
module_context = '{0}'
function_context = """
def function():
{0}
"""
method_c... | [UnusedVariableIsDefinedViolation]) | added | 3612f4e856d11a84998920f985048746261d8d5bbe3958d72ab1d26372523e21 | assert_*|test_raw_unused_variable_definition|from textwrap import indent import pytest from wemake_python_styleguide.violations.naming import ( UnusedVariableIsDefinedViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( UnusedVaribaleDefinitionVisitor, ) module_context = '{0}' function_context = """ ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 430 | c3818e6f7c21f6f7f3153fc851f77d8acd8bca87 | train | tests/test_visitors/test_ast/test_naming/test_unused/test_variable_usages.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_unused/test_variable_usages.py | 146 | 4 | assert_* | test_wrong_variable_usage | import pytest
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsUsedViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
UnusedVariableUsageVisitor,
WrongNameVisitor,
)
annotation = 'some_var: {0}'
annotation_value = 'some_var: {0} = None'
assigned = 'some_var = {... | [UnusedVariableIsUsedViolation]) | added | f2ea7b7792922847dd7026042a2ef26fa43c3a0c6a7384a19d6b14aebfaa43ba | assert_*|test_wrong_variable_usage|import pytest from wemake_python_styleguide.violations.naming import ( UnusedVariableIsUsedViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( UnusedVariableUsageVisitor, WrongNameVisitor, ) annotation = 'some_var: {0}' annotation_value = 'some_var: {0} = None' ass... | null | null | null |
wemake-services/wemake-python-styleguide | train | 431 | ba077ed5a0bb3eb6e45f610be1d22a8a911faf5f | train | tests/test_visitors/test_ast/test_compares/test_in_with_single_item_container.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_in_with_single_item_container.py | 40 | 4 | assert_* | test_single_item_container | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
InCompareWithSingleItemContainerViolation,
WrongInCompareTypeViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
InCompareSanityVisitor,
)
@pytest.m... | [InCompareWithSingleItemContainerViolation]) | added | 89edde6ca07a3a8e4ba9ff433d5dbbd3090dfbd5063e1c0403f19ed0019ab2f2 | assert_*|test_single_item_container|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( InCompareWithSingleItemContainerViolation, WrongInCompareTypeViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( InCompareSanit... | null | null | null |
wemake-services/wemake-python-styleguide | train | 432 | eedfa2686daf521c258e61f2aa9df19e3dbe54c7 | train | tests/test_visitors/test_ast/test_compares/test_unpythonic/test_useless_len.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_unpythonic/test_useless_len.py | 44 | 4 | assert_* | test_useless_len_call | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
UselessLenCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor
@pytest.mark.parametrize('code', [
'len(some) > 0',
'len(som... | [UselessLenCompareViolation]) | added | 1ab13aa3978fa3cf65314d379ffb5aae69842a921bec7aa9bd3c4e1bc9962c91 | assert_*|test_useless_len_call|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( UselessLenCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import CompareSanityVisitor @pytest.mark.parametrize('code', [ 'len(some... | null | null | null |
wemake-services/wemake-python-styleguide | train | 433 | 4fa9f411fbe5c24477f4b7d975ed84845b405e64 | train | tests/test_visitors/test_ast/test_compares/test_order.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_order.py | 107 | 4 | assert_* | test_compare_wrong_order | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
CompareOrderViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongComparisionOrderVisitor,
)
wrong_comparators = [
('"string constant"', 'first_na... | [CompareOrderViolation]) | added | a465d4a4370e858fcebc1bcc2c29ef6bb178ae11af2881cc4b04c76f6a0842bd | assert_*|test_compare_wrong_order|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( CompareOrderViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongComparisionOrderVisitor, ) wrong_comparators = [ ('"string c... | null | null | null |
wemake-services/wemake-python-styleguide | train | 433 | 4fa9f411fbe5c24477f4b7d975ed84845b405e64 | train | tests/test_visitors/test_ast/test_compares/test_order.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_order.py | 125 | 4 | assert_* | test_compare_wrong_order_multiple | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
CompareOrderViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongComparisionOrderVisitor,
)
wrong_comparators = [
('"string constant"', 'first_na... | [ CompareOrderViolation, CompareOrderViolation, ]) | added | b04ebfb7af4bab78d2639173f51e22ce121cfcb2fe2deb0cd7ac90d65bde29c4 | assert_*|test_compare_wrong_order_multiple|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( CompareOrderViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongComparisionOrderVisitor, ) wrong_comparators = [ ('... | null | null | null |
wemake-services/wemake-python-styleguide | train | 434 | 7d98e4092cd55807f62d96b36f4756d11aaa3e63 | train | tests/test_visitors/test_ast/test_compares/test_conditionals.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_conditionals.py | 98 | 4 | assert_* | test_useless | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
ConstantConditionViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConditionalVisitor,
)
create_variable = """
variable = 1
{0}
"""
if_statement ... | [ConstantConditionViolation]) | added | 399f10f7951bd4ba290c980b0257cb3cc3f4c00769c3b16890eb1c78c374a342 | assert_*|test_useless|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( ConstantConditionViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConditionalVisitor, ) create_variable = """ variable = 1 {0} """ if... | null | null | null |
wemake-services/wemake-python-styleguide | train | 434 | 7d98e4092cd55807f62d96b36f4756d11aaa3e63 | train | tests/test_visitors/test_ast/test_compares/test_constant_compares/test_is_constant_compare.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_constant_compares/test_is_constant_compare.py | 60 | 4 | assert_* | test_wrong_constant_is | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
FalsyConstantCompareViolation,
WrongIsCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConstantCompareVisitor,
)
wrong_comparators = [... | ( FalsyConstantCompareViolation, )) | added | 9bb12e527bcf5ccf4404236c048d13730a7bcdf9b26439410df8af6acdcf3e18 | assert_*|test_wrong_constant_is|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( FalsyConstantCompareViolation, WrongIsCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConstantCompareVisitor, ) wro... | null | null | null |
wemake-services/wemake-python-styleguide | train | 434 | 7d98e4092cd55807f62d96b36f4756d11aaa3e63 | train | tests/test_visitors/test_ast/test_compares/test_order.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_order.py | 109 | 4 | assert_* | test_compare_wrong_order | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
CompareOrderViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongComparisionOrderVisitor,
)
wrong_comparators = [
('"string constant"', 'first_na... | [CompareOrderViolation]) | modified | 53c6a6b777ba2572560cd7a0e25798982e6af77809d938aaec2158e2fb099bec | assert_*|test_compare_wrong_order|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( CompareOrderViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongComparisionOrderVisitor, ) wrong_comparators = [ ('"string c... | [CompareOrderViolation]) | 107 | 4 |
wemake-services/wemake-python-styleguide | train | 434 | 7d98e4092cd55807f62d96b36f4756d11aaa3e63 | train | tests/test_visitors/test_ast/test_compares/test_order.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_order.py | 127 | 4 | assert_* | test_compare_wrong_order_multiple | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
CompareOrderViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongComparisionOrderVisitor,
)
wrong_comparators = [
('"string constant"', 'first_na... | [ CompareOrderViolation, CompareOrderViolation, ]) | modified | 3c1508588aa62ce7cd278d70a8fa78b962e55ad168e230904617e677bffe83d6 | assert_*|test_compare_wrong_order_multiple|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( CompareOrderViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongComparisionOrderVisitor, ) wrong_comparators = [ ('... | [ CompareOrderViolation, CompareOrderViolation, ]) | 125 | 4 |
wemake-services/wemake-python-styleguide | train | 435 | e45bbb16421a6e757a519308c94ade999b48141d | train | tests/test_visitors/test_ast/test_compares/test_constant_compares/test_falsy_constant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_constant_compares/test_falsy_constant.py | 49 | 4 | assert_* | test_falsy_constant | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
FalsyConstantCompareViolation,
WrongIsCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConstantCompareVisitor,
)
wrong_comparators = [... | [FalsyConstantCompareViolation]) | added | 2949029c8b8a53bf537349391fd47bf1d2eba9c45f4606c877d853e6e9688ac3 | assert_*|test_falsy_constant|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( FalsyConstantCompareViolation, WrongIsCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConstantCompareVisitor, ) wrong_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 435 | e45bbb16421a6e757a519308c94ade999b48141d | train | tests/test_visitors/test_ast/test_compares/test_constant_compares/test_falsy_constant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_constant_compares/test_falsy_constant.py | 67 | 4 | assert_* | test_falsy_constant_is | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
FalsyConstantCompareViolation,
WrongIsCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConstantCompareVisitor,
)
wrong_comparators = [... | [ FalsyConstantCompareViolation, WrongIsCompareViolation, ]) | added | 120ed10d569c18e8d9aca62919bb6a087d3ae14392fe91c0f3e6616d094b3d9b | assert_*|test_falsy_constant_is|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( FalsyConstantCompareViolation, WrongIsCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConstantCompareVisitor, ) wro... | null | null | null |
wemake-services/wemake-python-styleguide | train | 435 | e45bbb16421a6e757a519308c94ade999b48141d | train | tests/test_visitors/test_ast/test_compares/test_constant_compares/test_falsy_constant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_constant_compares/test_falsy_constant.py | 125 | 4 | assert_* | test_correct_constant_compare | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
FalsyConstantCompareViolation,
WrongIsCompareViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConstantCompareVisitor,
)
wrong_comparators = [... | (WrongIsCompareViolation,)) | added | 27a9ae80dcbbc6dfaecc24577f4102056d861bf7d32a66105db750d0d4f5c714 | assert_*|test_correct_constant_compare|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( FalsyConstantCompareViolation, WrongIsCompareViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConstantCompareVisitor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 436 | 10895e0cd095e7ba7aa0caefefd56465d570718a | train | tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | 73 | 4 | assert_* | test_single_argument_count_invalid | from wemake_python_styleguide.violations.complexity import (
TooManyArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
def test_correct_arguments_count(
assert_errors,
parse_ast_tree,
single_argument,
default_options,
... | [TooManyArgumentsViolation]) | added | 0782ce2fb40294daa56dd0ca8d96cae239fc54941beb8a121da18ef389f617f9 | assert_*|test_single_argument_count_invalid|from wemake_python_styleguide.violations.complexity import ( TooManyArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) def test_correct_arguments_count( assert_errors, parse_ast_tree, single_argument, def... | null | null | null |
wemake-services/wemake-python-styleguide | train | 436 | 10895e0cd095e7ba7aa0caefefd56465d570718a | train | tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | 74 | 4 | assert_* | test_single_argument_count_invalid | from wemake_python_styleguide.violations.complexity import (
TooManyArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
def test_correct_arguments_count(
assert_errors,
parse_ast_tree,
single_argument,
default_options,
... | option_values.max_arguments) | modified | 674710e19eff8a6f1741b9b7d02e2569979ae78d97e3105426e5d489388adca1 | assert_*|test_single_argument_count_invalid|from wemake_python_styleguide.violations.complexity import ( TooManyArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) def test_correct_arguments_count( assert_errors, parse_ast_tree, single_argument, def... | option_values.max_arguments) | 72 | 4 |
wemake-services/wemake-python-styleguide | train | 436 | 10895e0cd095e7ba7aa0caefefd56465d570718a | train | tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | 92 | 4 | assert_* | test_two_arguments_count_invalid | from wemake_python_styleguide.violations.complexity import (
TooManyArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
def test_correct_arguments_count(
assert_errors,
parse_ast_tree,
single_argument,
default_options,
... | [TooManyArgumentsViolation]) | modified | effc82d7db456037773c2d9dbad8adb070f1bced6d50cdb118997acb38166ac1 | assert_*|test_two_arguments_count_invalid|from wemake_python_styleguide.violations.complexity import ( TooManyArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) def test_correct_arguments_count( assert_errors, parse_ast_tree, single_argument, defau... | [TooManyArgumentsViolation]) | 90 | 4 |
wemake-services/wemake-python-styleguide | train | 436 | 10895e0cd095e7ba7aa0caefefd56465d570718a | train | tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | 93 | 4 | assert_* | test_two_arguments_count_invalid | from wemake_python_styleguide.violations.complexity import (
TooManyArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
def test_correct_arguments_count(
assert_errors,
parse_ast_tree,
single_argument,
default_options,
... | option_values.max_arguments) | modified | 24bfdb6ab4556958765ffdd5c27a76e8338b4dab1313435be75315ee026a496a | assert_*|test_two_arguments_count_invalid|from wemake_python_styleguide.violations.complexity import ( TooManyArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) def test_correct_arguments_count( assert_errors, parse_ast_tree, single_argument, defau... | option_values.max_arguments) | 91 | 4 |
wemake-services/wemake-python-styleguide | train | 437 | fbd4cd806b5463035a16ac74a842cc3724b85b48 | train | tests/test_visitors/test_ast/test_builtins/test_numbers/test_magic_numbers.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_numbers/test_magic_numbers.py | 196 | 4 | assert_* | test_magic_number_warning | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST
from wemake_python_styleguide.violations.best_practices import (
MagicNumberViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongNumberVisitor
# C... | [MagicNumberViolation]) | added | b05d75fba26483efe929dc0e403a9f76cd870b7ea6838ffad4ef872cfae5aa5b | assert_*|test_magic_number_warning|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST from wemake_python_styleguide.violations.best_practices import ( MagicNumberViolation, ) from wemake_python_styleguide.visitors.ast.builtins ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 437 | fbd4cd806b5463035a16ac74a842cc3724b85b48 | train | tests/test_visitors/test_ast/test_builtins/test_numbers/test_magic_numbers.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_numbers/test_magic_numbers.py | 197 | 4 | assert_* | test_magic_number_warning | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST
from wemake_python_styleguide.violations.best_practices import (
MagicNumberViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongNumberVisitor
# C... | number.replace('-', '')) | added | fa69dc986813c071b24cada483e07f6c734a29cfe9fe55d67da5c5444b4d8cc2 | assert_*|test_magic_number_warning|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST from wemake_python_styleguide.violations.best_practices import ( MagicNumberViolation, ) from wemake_python_styleguide.visitors.ast.builtins ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 437 | fbd4cd806b5463035a16ac74a842cc3724b85b48 | train | tests/test_visitors/test_ast/test_builtins/test_numbers/test_magic_numbers.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_numbers/test_magic_numbers.py | 232 | 4 | assert_* | test_magic_number_octal_warning | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST
from wemake_python_styleguide.violations.best_practices import (
MagicNumberViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongNumberVisitor
# C... | [MagicNumberViolation]) | added | f2fbe83aae0f9fd34825ca3a738d3e7e10d14d3c70633743424ee231d2103542 | assert_*|test_magic_number_octal_warning|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST from wemake_python_styleguide.violations.best_practices import ( MagicNumberViolation, ) from wemake_python_styleguide.visitors.ast.bui... | null | null | null |
wemake-services/wemake-python-styleguide | train | 437 | fbd4cd806b5463035a16ac74a842cc3724b85b48 | train | tests/test_visitors/test_ast/test_builtins/test_strings/test_modulo_formatting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_strings/test_modulo_formatting.py | 96 | 4 | assert_* | test_modulo_formatting | import pytest
from wemake_python_styleguide.violations.consistency import (
FormattedStringViolation,
ModuloStringFormatViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor
_PREFIXES = (
'',
'b',
'u',
'r',
'rb',
'f',
'fr',
)
# Docstring sample... | ( FormattedStringViolation, )) | added | 4be2a548fc0dcb571ab86da3dde10aa4502a80048462c9865ec40517a4aca888 | assert_*|test_modulo_formatting|import pytest from wemake_python_styleguide.violations.consistency import ( FormattedStringViolation, ModuloStringFormatViolation, ) from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor _PREFIXES = ( '', 'b', 'u', 'r', 'rb', 'f', 'fr', ) # Docstring samples: docs... | null | null | null |
wemake-services/wemake-python-styleguide | train | 437 | fbd4cd806b5463035a16ac74a842cc3724b85b48 | train | tests/test_visitors/test_ast/test_builtins/test_strings/test_modulo_formatting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_strings/test_modulo_formatting.py | 144 | 4 | assert_* | test_regular_modulo_string | import pytest
from wemake_python_styleguide.violations.consistency import (
FormattedStringViolation,
ModuloStringFormatViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor
_PREFIXES = (
'',
'b',
'u',
'r',
'rb',
'f',
'fr',
)
# Docstring sample... | (FormattedStringViolation,)) | added | c3a880882bd3ce65f940a1feed33f52d60ad7d813b717790526407002f031343 | assert_*|test_regular_modulo_string|import pytest from wemake_python_styleguide.violations.consistency import ( FormattedStringViolation, ModuloStringFormatViolation, ) from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor _PREFIXES = ( '', 'b', 'u', 'r', 'rb', 'f', 'fr', ) # Docstring samples: ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 297 | 8 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors.get(found_error) | modified | 8c413ad4388ca65b8fd5574c60abadc1155fbb3aea37a6d6efa9e5838a749b94 | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors.get(found_error) | 296 | 8 | |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_visitors/test_ast/test_conditions/test_useless_len_call.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_useless_len_call.py | 52 | 4 | assert_* | test_useless_len_call | import pytest
from wemake_python_styleguide.violations.refactoring import (
UselessLenCompareViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor
correct_call1 = 'print(len([]))'
correct_call2 = 'assert len([]) == len([])'
correct_call3 = 'if sum(x): ...'
wrong_len_call1 =... | [UselessLenCompareViolation]) | modified | 93328031ead9be2bc27d876855b4e966526af137f8e39240f70df4bdaae32ce9 | assert_*|test_useless_len_call|import pytest from wemake_python_styleguide.violations.refactoring import ( UselessLenCompareViolation, ) from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor correct_call1 = 'print(len([]))' correct_call2 = 'assert len([]) == len([])' correct_call3 = 'if sum(x)... | [UselessLenCompareViolation]) | 51 | 4 |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_long.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_long.py | 21 | 4 | assert_* | test_long_variable_name | from wemake_python_styleguide.violations.naming import TooLongNameViolation
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
def test_long_variable_name(
assert_errors,
assert_error_text,
parse_ast_tree,
naming_template,
default_options,
mode,
):
"""Ensures that lo... | default_options.max_name_length) | modified | c1f568f7bb6d329c46ba26d32eed53a717f7480f527f2f6e442b5fa26d5a3e6c | assert_*|test_long_variable_name|from wemake_python_styleguide.violations.naming import TooLongNameViolation from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor def test_long_variable_name( assert_errors, assert_error_text, parse_ast_tree, naming_template, default_options, mode, ): """Ensures that... | long_name) | 21 | 4 |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_redability.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_redability.py | 45 | 4 | assert_* | test_unreadable_name | import pytest
from wemake_python_styleguide import constants
from wemake_python_styleguide.logic.naming.alphabet import (
get_unreadable_characters,
)
from wemake_python_styleguide.violations.naming import UnreadableNameViolation
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
class_temp... | [UnreadableNameViolation]) | added | 9d98906c09fac7ea418e4e4f13ae5b1c49ed8221fe91f8a82894ae006f7a2b05 | assert_*|test_unreadable_name|import pytest from wemake_python_styleguide import constants from wemake_python_styleguide.logic.naming.alphabet import ( get_unreadable_characters, ) from wemake_python_styleguide.violations.naming import UnreadableNameViolation from wemake_python_styleguide.visitors.ast.naming import Wro... | null | null | null |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | 72 | 4 | assert_* | test_naming_length_settings | import pytest
from wemake_python_styleguide.violations.naming import (
TooShortNameViolation,
TrailingUnderscoreViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('short_name', [
'y',
'_y',
])
def test_short_variable_name(
assert_errors... | [TooShortNameViolation]) | modified | d750c6a600b3c52b25a89e3934fa51266b311e1cb73a35f7bda3bbe3a74949fa | assert_*|test_naming_length_settings|import pytest from wemake_python_styleguide.violations.naming import ( TooShortNameViolation, TrailingUnderscoreViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('short_name', [ 'y', '_y', ]) def test_short_variable_name(... | [TooShortNameViolation]) | 72 | 4 |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_visitors/test_filenames/test_module/test_module_name_length.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_name_length.py | 78 | 4 | assert_* | test_max_length_option | import pytest
from wemake_python_styleguide.violations.naming import (
TooLongNameViolation,
TooShortNameViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'a.py',
'relative/_a.py',
'C:/a_.py',
'so... | option_values.max_name_length) | modified | 8a27beb8c8c461cb637a2204b3ba0e7807d3e5265e7b8766e6d9ad644a3c1a2f | assert_*|test_max_length_option|import pytest from wemake_python_styleguide.violations.naming import ( TooLongNameViolation, TooShortNameViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'a.py', 'relative/_a.py', 'C:/a_.py', 's... | filename.replace('.py', '')) | 76 | 4 |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_visitors/test_filenames/test_module/test_module_redable_name.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_redable_name.py | 21 | 4 | assert_* | test_unreadable_filename | import pytest
from wemake_python_styleguide.violations.naming import (
UnderscoredNumberNameViolation,
UnreadableNameViolation,
WrongModuleNamePatternViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'the... | [UnreadableNameViolation]) | added | 03882b3f895cc6692d6b52e0fc653eafdc49a8e4ba7e097142032bc74d9627ba | assert_*|test_unreadable_filename|import pytest from wemake_python_styleguide.violations.naming import ( UnderscoredNumberNameViolation, UnreadableNameViolation, WrongModuleNamePatternViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filena... | null | null | null |
wemake-services/wemake-python-styleguide | train | 438 | 08be412b397c1124b6a0b2983d669f886d90a9fe | train | tests/test_visitors/test_filenames/test_module/test_module_redable_name.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_redable_name.py | 44 | 4 | assert_* | test_corner_case | import pytest
from wemake_python_styleguide.violations.naming import (
UnderscoredNumberNameViolation,
UnreadableNameViolation,
WrongModuleNamePatternViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'the... | [ WrongModuleNamePatternViolation, UnderscoredNumberNameViolation, ]) | added | 09a18c6274fa2e50a4e4ccf2a46c1ccc0c03b1609fc4aef8cfe10f588f54c21a | assert_*|test_corner_case|import pytest from wemake_python_styleguide.violations.naming import ( UnderscoredNumberNameViolation, UnreadableNameViolation, WrongModuleNamePatternViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ '... | null | null | null |
wemake-services/wemake-python-styleguide | train | 439 | 458e4e22b50544dc14405b46ef7778d339993ef3 | train | tests/test_visitors/test_tokenize/test_comments/test_shebang.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_comments/test_shebang.py | 184 | 4 | assert_* | test_wrong_shebang_executable | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import ShebangViolation
from wemake_python_styleguide.visitors.tokenize import comments
template_empty = ''
template_newlines = '\n\n'
template_regular = '{0}'
template_with_leading_comment = """{0}
# some other
"""
templ... | [ShebangViolation]) | added | 00d06536b0cfd2ef3b2e8beb463a6c7bbfef2c9f0c4adf23b4512b88b597229e | assert_*|test_wrong_shebang_executable|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ShebangViolation from wemake_python_styleguide.visitors.tokenize import comments template_empty = '' template_newlines = '\n\n' template_regular = '{0}' template_with_leading_comme... | null | null | null |
wemake-services/wemake-python-styleguide | train | 439 | 458e4e22b50544dc14405b46ef7778d339993ef3 | train | tests/test_visitors/test_tokenize/test_comments/test_shebang.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_comments/test_shebang.py | 216 | 4 | assert_* | test_wrong_shebang_format | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import ShebangViolation
from wemake_python_styleguide.visitors.tokenize import comments
template_empty = ''
template_newlines = '\n\n'
template_regular = '{0}'
template_with_leading_comment = """{0}
# some other
"""
templ... | [ShebangViolation]) | added | 0f8f8846b6f43a092ed84ee0e28da6af2b4c471b7595c7e12c0fa7656fa8e2df | assert_*|test_wrong_shebang_format|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ShebangViolation from wemake_python_styleguide.visitors.tokenize import comments template_empty = '' template_newlines = '\n\n' template_regular = '{0}' template_with_leading_comment =... | null | null | null |
wemake-services/wemake-python-styleguide | train | 440 | 4647e6d4cb489f073fd45137860e1d6f61ea311d | train | tests/test_visitors/test_ast/test_imports/test_protected_import.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_protected_import.py | 57 | 4 | assert_* | test_incorrect_modules_import | import pytest
from wemake_python_styleguide.violations.best_practices import (
ProtectedModuleMemberViolation,
ProtectedModuleViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected =... | [ProtectedModuleViolation]) | modified | a9b231d65f82d8eeac944981dd445831cc96b7fa79a6f612d08807b5f7fb3d74 | assert_*|test_incorrect_modules_import|import pytest from wemake_python_styleguide.violations.best_practices import ( ProtectedModuleMemberViolation, ProtectedModuleViolation, ) from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor import_public = 'import public' import_protected = 'import _prote... | [ProtectedModuleViolation]) | 56 | 4 |
wemake-services/wemake-python-styleguide | train | 440 | 4647e6d4cb489f073fd45137860e1d6f61ea311d | train | tests/test_visitors/test_ast/test_imports/test_protected_import.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_protected_import.py | 58 | 4 | assert_* | test_incorrect_modules_import | import pytest
from wemake_python_styleguide.violations.best_practices import (
ProtectedModuleMemberViolation,
ProtectedModuleViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected =... | '_protected') | added | fc40a7a72be80ef01ee2d2916be197f93bd44ee9a389f2d4c56209b1760cf6f0 | assert_*|test_incorrect_modules_import|import pytest from wemake_python_styleguide.violations.best_practices import ( ProtectedModuleMemberViolation, ProtectedModuleViolation, ) from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor import_public = 'import public' import_protected = 'import _prote... | null | null | null |
wemake-services/wemake-python-styleguide | train | 440 | 4647e6d4cb489f073fd45137860e1d6f61ea311d | train | tests/test_visitors/test_ast/test_imports/test_protected_import.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_protected_import.py | 78 | 4 | assert_* | test_incorrect_module_members_import | import pytest
from wemake_python_styleguide.violations.best_practices import (
ProtectedModuleMemberViolation,
ProtectedModuleViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected =... | [ProtectedModuleMemberViolation]) | modified | ba6d049f2a14f1a1d16a31c061c87f2dcbe5a28b50de68cb7735caa50590b568 | assert_*|test_incorrect_module_members_import|import pytest from wemake_python_styleguide.violations.best_practices import ( ProtectedModuleMemberViolation, ProtectedModuleViolation, ) from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor import_public = 'import public' import_protected = 'import... | [ProtectedModuleMemberViolation]) | 75 | 4 |
wemake-services/wemake-python-styleguide | train | 440 | 4647e6d4cb489f073fd45137860e1d6f61ea311d | train | tests/test_visitors/test_ast/test_imports/test_protected_import.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_protected_import.py | 79 | 4 | assert_* | test_incorrect_module_members_import | import pytest
from wemake_python_styleguide.violations.best_practices import (
ProtectedModuleMemberViolation,
ProtectedModuleViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected =... | '_protected') | added | 2bf0f255168d228d757b579bb2ab8fe4518a8db3294730166b8031b4de092299 | assert_*|test_incorrect_module_members_import|import pytest from wemake_python_styleguide.violations.best_practices import ( ProtectedModuleMemberViolation, ProtectedModuleViolation, ) from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor import_public = 'import public' import_protected = 'import... | null | null | null |
wemake-services/wemake-python-styleguide | train | 441 | e80aee963490433c0c6c01a23f0261fdac436c9f | train | tests/test_visitors/test_tokenize/test_comments/test_typed_ast.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_comments/test_typed_ast.py | 61 | 4 | assert_* | test_incorrect_type_comment | import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongMagicCommentViolation,
)
from wemake_python_styleguide.visitors.tokenize.comments import (
WrongCommentVisitor,
)
@pytest.mark.parametrize('code', [
'1 + "12" # type: ignore',
'1 + "12" # type:ignore',
'1 + "12"... | [WrongMagicCommentViolation]) | modified | 1a30753a77fd3ab9c637319f1de7ccba1f63d71bd1f8e6f8235d0c749b270ddf | assert_*|test_incorrect_type_comment|import pytest from wemake_python_styleguide.violations.best_practices import ( WrongMagicCommentViolation, ) from wemake_python_styleguide.visitors.tokenize.comments import ( WrongCommentVisitor, ) @pytest.mark.parametrize('code', [ '1 + "12" # type: ignore', '1 + "12" # type:ignore... | [WrongMagicCommentViolation]) | 59 | 4 |
wemake-services/wemake-python-styleguide | train | 442 | e12aa891b97062075eb1c2c1fe111d06172717b4 | train | tests/test_visitors/test_ast/test_compares/test_order.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_order.py | 109 | 4 | assert_* | test_compare_wrong_order | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
CompareOrderViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongComparisonOrderVisitor,
)
wrong_comparators = [
('"string constant"', 'first_nam... | [CompareOrderViolation]) | modified | 5d72e1939954a6c752359d9d6298f091dab80527af9c66943476de3ac3f42404 | assert_*|test_compare_wrong_order|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( CompareOrderViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongComparisonOrderVisitor, ) wrong_comparators = [ ('"string co... | [CompareOrderViolation]) | 109 | 4 |
wemake-services/wemake-python-styleguide | train | 442 | e12aa891b97062075eb1c2c1fe111d06172717b4 | train | tests/test_visitors/test_ast/test_compares/test_order.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_order.py | 127 | 4 | assert_* | test_compare_wrong_order_multiple | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
CompareOrderViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongComparisonOrderVisitor,
)
wrong_comparators = [
('"string constant"', 'first_nam... | [ CompareOrderViolation, CompareOrderViolation, ]) | modified | fd7c999c687225462a1769869bb7b9753133224cd97de4840be0f28506b5abee | assert_*|test_compare_wrong_order_multiple|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( CompareOrderViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongComparisonOrderVisitor, ) wrong_comparators = [ ('"... | [ CompareOrderViolation, CompareOrderViolation, ]) | 127 | 4 |
wemake-services/wemake-python-styleguide | train | 442 | e12aa891b97062075eb1c2c1fe111d06172717b4 | train | tests/test_visitors/test_ast/test_iterables/test_unpacking.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_iterables/test_unpacking.py | 62 | 4 | assert_* | test_unnecessary_iterable_unpacking_usage | import pytest
from wemake_python_styleguide.violations.consistency import (
IterableUnpackingViolation,
)
from wemake_python_styleguide.visitors.ast.iterables import (
IterableUnpackingVisitor,
)
args_unpacking_in_call = 'f(*args)'
spread_list_definition = '[1, 2, *numbers, 74]'
spread_set_definition = '{1, 2... | [IterableUnpackingViolation]) | added | 96f7b78b35673088672385c7576b52378d75514b3de7a01b8d67bf8ddb0f7639 | assert_*|test_unnecessary_iterable_unpacking_usage|import pytest from wemake_python_styleguide.violations.consistency import ( IterableUnpackingViolation, ) from wemake_python_styleguide.visitors.ast.iterables import ( IterableUnpackingVisitor, ) args_unpacking_in_call = 'f(*args)' spread_list_definition = '[1, 2, *num... | null | null | null |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/fixtures/external_plugins.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/external_plugins.py | 17 | 0 | assert | from sys import *
import sys
from typing import List, Union, Dict
++int
extra_parens = list((node for node in 'abc'))
some_tuple = (1, 2, )
breaking_pycodestyle=3
# commented: str = 'comment'
def camelCase(): ...
'{}'.format(1)
assert | True | modified | 8c7d6d06edcd5099cc24de25437664b70dee8472ef216e10f76cbbebaeffa1c8 | assert||from sys import * import sys from typing import List, Union, Dict ++int extra_parens = list((node for node in 'abc')) some_tuple = (1, 2, ) breaking_pycodestyle=3 # commented: str = 'comment' def camelCase(): ... '{}'.format(1) assert | True | 19 | 0 | |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/fixtures/noqa/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa/noqa.py | 312 | 0 | assert | """
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: WPS422
from typing import List
import os.path # noqa: WPS301
import sys as sys # noqa: WPS113
from _some import protected # noqa: WPS436
from some import _protected # noqa: WPS450
from ... | hex_number | added | 662fcc0dc8ec23c3e3ba8e772e0ac92f635902ab0be72fc7cbfbd32e38710a92 | assert||""" This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: WPS422 from typing import List import os.path # noqa: WPS301 import sys as sys # noqa: WPS113 from _some import protected # noqa: WPS436 from some import _protected # noqa: WPS450 from .ve... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 294 | 12 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | 99d9d51db6566e5b0ed7855aa2f82dd6c196b085a3ecd0d76d672060dc04dc81 | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 293 | 12 | |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/test_options/test_validate_domain_names_options.py | val | wemake-services/wemake-python-styleguide:tests/test_options/test_validate_domain_names_options.py | 25 | 9 | pytest.raises | test_raises_valueerror_when_names_intersect | import pytest
from wemake_python_styleguide.options.validation import (
validate_domain_names_options,
)
@pytest.mark.parametrize(('allowed_names', 'forbidden_names'), [
(['items'], []),
([], ['items']),
(['item'], ['handle']),
])
def test_passes_when_any_option_not_passed(allowed_names, forbidden_na... | ValueError, match='visitor') | modified | 1c87cbc445c5c44be7b9c52584aac1636b02f9bcfdbba2041ab4dee8af7f6a15 | pytest.raises|test_raises_valueerror_when_names_intersect|import pytest from wemake_python_styleguide.options.validation import ( validate_domain_names_options, ) @pytest.mark.parametrize(('allowed_names', 'forbidden_names'), [ (['items'], []), ([], ['items']), (['item'], ['handle']), ]) def test_passes_when_any_option... | ValueError) | 25 | 9 |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/test_visitors/test_ast/test_naming/test_class_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_class_attributes.py | 54 | 4 | assert_* | test_upper_case_class_attributes | import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
static_attribute = """
class Test(object):
{0} = None
"""
static_typed_attribute = """
class Test(object):
{0}: int = None
"""
r... | [UpperCaseAttributeViolation]) | modified | 8baae0291da1e379605b2954995af3c649508fa6860688d14edb53c0a299f936 | assert_*|test_upper_case_class_attributes|import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor static_attribute = """ class Test(object): {0} = None """ static_typed_attribute = """ class Test(obje... | [UpperCaseAttributeViolation]) | 54 | 4 |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_builtin_shadowing.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_builtin_shadowing.py | 30 | 4 | assert_* | test_builtin_shadowing | import pytest
from wemake_python_styleguide.violations.naming import (
BuiltinShadowingViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('wrong_name', [
'list',
'str',
'sum',
])
def test_builtin_shadowing(
assert_errors,
assert_err... | wrong_name) | added | d3686ec345719dea26e05d1ad734d000caa45a234715b68648aa334410a5c0f9 | assert_*|test_builtin_shadowing|import pytest from wemake_python_styleguide.violations.naming import ( BuiltinShadowingViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('wrong_name', [ 'list', 'str', 'sum', ]) def test_builtin_shadowing( assert_errors, asser... | null | null | null |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | 71 | 4 | assert_* | test_naming_length_settings | import pytest
from wemake_python_styleguide.violations.naming import (
TooShortNameViolation,
TrailingUnderscoreViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('short_name', [
'y',
'_y',
])
def test_short_variable_name(
assert_errors... | [TooShortNameViolation]) | modified | 3d3fb4b440ae81b8ef4b38d4d0652f8d8a0949989c9e6eb723cbad718f7ca8df | assert_*|test_naming_length_settings|import pytest from wemake_python_styleguide.violations.naming import ( TooShortNameViolation, TrailingUnderscoreViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('short_name', [ 'y', '_y', ]) def test_short_variable_name(... | [TooShortNameViolation]) | 72 | 4 |
wemake-services/wemake-python-styleguide | train | 443 | 4f278f557bc3d91d4a2448b0c28ba207bfe1845b | train | tests/test_visitors/test_decorators/test_alias_decorator.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_decorators/test_alias_decorator.py | 22 | 9 | pytest.raises | test_useless_alias | import pytest
from wemake_python_styleguide.visitors.decorators import alias
class _HasAliasedProp(object):
def existing(self):
return None
def first(self):
return None
def test_raises_for_duplicates():
"""Ensures that decorator raises an exception for duplicates."""
with pytest.ra... | ValueError, match='duplicate') | modified | 8f2ad926d970cbb65dd1c50ae60c045d0dfd9d9188b85be48e1cb83ffdc59af6 | pytest.raises|test_useless_alias|import pytest from wemake_python_styleguide.visitors.decorators import alias class _HasAliasedProp(object): def existing(self): return None def first(self): return None def test_raises_for_duplicates(): """Ensures that decorator raises an exception for duplicates.""" with pytest.raises(... | ValueError) | 22 | 9 |
wemake-services/wemake-python-styleguide | train | 444 | 97ef6cfbf61f83858e3c533e9eac3122bfa7e7c7 | train | tests/test_visitors/test_ast/test_naming/test_class_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_class_attributes.py | 61 | 4 | assert_* | test_upper_case_class_attributes | import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
static_attribute = """
class Test(object):
{0} = None
"""
static_typed_attribute = """
class Test(object):
{0}: int = None
"""
s... | [UpperCaseAttributeViolation]) | added | 989606ba3261dec89f6a73915fff3168589dd46ea9e17052e71a5e82a442d5af | assert_*|test_upper_case_class_attributes|import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor static_attribute = """ class Test(object): {0} = None """ static_typed_attribute = """ class Test(obje... | null | null | null |
wemake-services/wemake-python-styleguide | train | 444 | 97ef6cfbf61f83858e3c533e9eac3122bfa7e7c7 | train | tests/test_visitors/test_ast/test_naming/test_class_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_class_attributes.py | 62 | 4 | assert_* | test_upper_case_class_attributes | import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
static_attribute = """
class Test(object):
{0} = None
"""
static_typed_attribute = """
class Test(object):
{0}: int = None
"""
s... | non_snake_case_name) | added | 9dfacf343e766794eb64155c020131b1c11cad2b70bb638dc4d4278fce3750c0 | assert_*|test_upper_case_class_attributes|import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor static_attribute = """ class Test(object): {0} = None """ static_typed_attribute = """ class Test(obje... | null | null | null |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/fixtures/noqa/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa/noqa.py | 240 | 4 | assert | """
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: WPS422
from typing import List
import os.path # noqa: WPS301
import sys as sys # noqa: WPS113
from _some import protected # noqa: WPS436
from some import _protected # noqa: WPS450
from ... | test_function(1) | modified | 82bff7ff903c8ddd3365e82df6bc07d1474f3e60147da742077077e8a18b0750 | assert||""" This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: WPS422 from typing import List import os.path # noqa: WPS301 import sys as sys # noqa: WPS113 from _some import protected # noqa: WPS436 from some import _protected # noqa: WPS450 from .ve... | test_function(1) | 239 | 4 | |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/fixtures/noqa/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa/noqa.py | 242 | 4 | assert | """
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: WPS422
from typing import List
import os.path # noqa: WPS301
import sys as sys # noqa: WPS113
from _some import protected # noqa: WPS436
from some import _protected # noqa: WPS450
from ... | test_function(3) | modified | 74eb033ecb3f0a0ba9eb7ce29c341ef586845b398f7c46990217725a20a0c14e | assert||""" This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: WPS422 from typing import List import os.path # noqa: WPS301 import sys as sys # noqa: WPS113 from _some import protected # noqa: WPS436 from some import _protected # noqa: WPS450 from .ve... | test_function(3) | 241 | 4 | |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/fixtures/noqa/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa/noqa.py | 302 | 0 | assert | """
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: WPS422
from typing import List
import os.path # noqa: WPS301
import sys as sys # noqa: WPS113
from _some import protected # noqa: WPS436
from some import _protected # noqa: WPS450
from ... | octal_number | modified | b886bdd36ed06e99a03e9c27e5d94e12293400fc32f3ccd87771f8782c34df76 | assert||""" This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: WPS422 from typing import List import os.path # noqa: WPS301 import sys as sys # noqa: WPS113 from _some import protected # noqa: WPS436 from some import _protected # noqa: WPS450 from .ve... | octal_number | 301 | 0 | |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 294 | 12 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | 2dda5e24fea5d3dde036b703ae5c6d8273e29cb87a50c8fa0f918457603c3422 | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 294 | 12 | |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 297 | 8 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | f72a5e427a95e6ad23a94e333b4182461f82976243db7232a8e67227a3a01a8e | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 297 | 8 | |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 381 | 4 | assert | test_noqa_fixture_disabled_no_control | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_controlled_violations) | modified | d159f37fb780a11eda353926d00eb7306dfea5a7c8ed116e3e2ca617c8cb1183 | assert|test_noqa_fixture_disabled_no_control|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-st... | len(all_controlled_violations) | 381 | 4 |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_wrong_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_wrong_names.py | 60 | 4 | assert_* | test_wrong_variable_name | import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('wrong_name', [
'SOME',
'Value',
'nO',
'dATa',
])
def test_wrong... | wrong_name) | added | 81228191cf10c2dd91567aa0e039f4d877f1459a999fb5517d0f562786c5049e | assert_*|test_wrong_variable_name|import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('wrong_name', [ 'SOME', 'Value', 'nO', 'dATa', ]) def tes... | null | null | null |
wemake-services/wemake-python-styleguide | train | 445 | c7247891f4a1684a6978ae9f9f26fac4157fc5f9 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_wrong_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_wrong_names.py | 86 | 4 | assert_* | test_name_in_forbidden_domain_names_option | import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('wrong_name', [
'SOME',
'Value',
'nO',
'dATa',
])
def test_wrong... | forbidden_name) | added | 888d88a9600f9563f1e132eee06059d4e608f10817bbfe6a8d8f6a72a91feb24 | assert_*|test_name_in_forbidden_domain_names_option|import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('wrong_name', [ 'SOME', 'Value', 'nO', ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_float_keys.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_float_keys.py | 38 | 4 | assert_* | test_dict_with_float_key | import pytest
from wemake_python_styleguide.violations.best_practices import FloatKeyViolation
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
dict_template1 = '{{ {0}: 1 }}'
dict_template2 = '{{ {0}: {0} }}'
dict_template3 = '{{ {0}: 1, **kwargs }}'
dict_template4 = '{{ {0}... | [FloatKeyViolation]) | modified | 2f4809a0484c94a6d323952efa7afc8b401f714a8383cdc27e126ba1d316ed80 | assert_*|test_dict_with_float_key|import pytest from wemake_python_styleguide.violations.best_practices import FloatKeyViolation from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) dict_template1 = '{{ {0}: 1 }}' dict_template2 = '{{ {0}: {0} }}' dict_template3 = '{{ {0}: 1, **kwargs ... | [FloatKeyViolation]) | 40 | 4 |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_functions/test_call_context/test_type_compare.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_call_context/test_type_compare.py | 129 | 4 | assert_* | test_type_with_compare | import pytest
from wemake_python_styleguide.violations.refactoring import TypeCompareViolation
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallContextVisitior,
)
# Wrong:
simple_compare = '{0} == other'
is_compare = '{0} is other'
nested_compare = '{0} == int and other()'
triple_co... | [TypeCompareViolation]) | modified | c61a9f0925d4f4c664e1a0b4600a963c8d2aeeb9c9193fb533619ac3164ede54 | assert_*|test_type_with_compare|import pytest from wemake_python_styleguide.violations.refactoring import TypeCompareViolation from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallContextVisitior, ) # Wrong: simple_compare = '{0} == other' is_compare = '{0} is other' nested_compare = '{0} == i... | [TypeCompareViolation]) | 131 | 4 |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_imports/test_vague_imports.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_vague_imports.py | 39 | 4 | assert_* | test_vague_method_name_import | import pytest
from wemake_python_styleguide import constants
from wemake_python_styleguide.violations.consistency import VagueImportViolation
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_template = 'import {0}'
from_import_template = 'from mod import {0}'
alias_import_template1 ... | [VagueImportViolation]) | modified | bb374f81226db5c16ac10be9d084003926b4bf08ef836a94a626e916c386c356 | assert_*|test_vague_method_name_import|import pytest from wemake_python_styleguide import constants from wemake_python_styleguide.violations.consistency import VagueImportViolation from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor import_template = 'import {0}' from_import_template = 'from mo... | [VagueImportViolation]) | 41 | 4 |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_loops/test_loops/test_loop_sum.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_loops/test_loop_sum.py | 43 | 4 | assert_* | test_implicit_sum | import pytest
from wemake_python_styleguide.violations.refactoring import ImplicitSumViolation
from wemake_python_styleguide.visitors.ast.loops import (
WrongLoopDefinitionVisitor,
)
for_loop_template = """
def function():
for index in some:
{0}
"""
@pytest.mark.parametrize('template', [
for_loo... | [ImplicitSumViolation]) | modified | 5da28f219bface78983f872ca3ecdb502c9938f11f2ac0900012677346430155 | assert_*|test_implicit_sum|import pytest from wemake_python_styleguide.violations.refactoring import ImplicitSumViolation from wemake_python_styleguide.visitors.ast.loops import ( WrongLoopDefinitionVisitor, ) for_loop_template = """ def function(): for index in some: {0} """ @pytest.mark.parametrize('template', [ for_... | [ImplicitSumViolation]) | 45 | 4 |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_modules/test_mutable_constants.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_modules/test_mutable_constants.py | 42 | 4 | assert_* | test_wrong_constant_type_used | import pytest
from wemake_python_styleguide.violations.best_practices import (
MutableModuleConstantViolation,
)
from wemake_python_styleguide.visitors.ast.modules import ModuleConstantsVisitor
module_constant = 'CONST = {0}'
module_typed_constant = 'CONST: int = {0}'
module_variable = 'some_variable = {0}'
modu... | [MutableModuleConstantViolation]) | modified | 5574bb5b3f9991a5287ff12a3c09ee55c804d31172a7edeb7ee63c83f2646095 | assert_*|test_wrong_constant_type_used|import pytest from wemake_python_styleguide.violations.best_practices import ( MutableModuleConstantViolation, ) from wemake_python_styleguide.visitors.ast.modules import ModuleConstantsVisitor module_constant = 'CONST = {0}' module_typed_constant = 'CONST: int = {0}' module_varia... | [MutableModuleConstantViolation]) | 44 | 4 |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_builtin_shadowing.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_builtin_shadowing.py | 28 | 4 | assert_* | test_builtin_shadowing | import pytest
from wemake_python_styleguide.violations.naming import BuiltinShadowingViolation
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('wrong_name', [
'list',
'str',
'sum',
])
def test_builtin_shadowing(
assert_errors,
assert_error_text,
... | wrong_name) | modified | 53e3fec931626d1019952741ace70d47f2a77788d35496c0455106088d5bcabd | assert_*|test_builtin_shadowing|import pytest from wemake_python_styleguide.violations.naming import BuiltinShadowingViolation from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('wrong_name', [ 'list', 'str', 'sum', ]) def test_builtin_shadowing( assert_errors, assert_err... | wrong_name) | 30 | 4 |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_statements/test_useless_node.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_statements/test_useless_node.py | 87 | 4 | assert_* | test_useless_loop_nodes | import pytest
from wemake_python_styleguide.violations.consistency import UselessNodeViolation
from wemake_python_styleguide.visitors.ast.statements import (
StatementsWithBodiesVisitor,
)
for_template = """
def wrapper():
for some_var in call():
{0}
"""
while_template = """
def wrapper():
while ... | [UselessNodeViolation]) | modified | 1793d7aefc6194c89f566e18492b0bf16306711932d9b50eb370be0cb24b5a75 | assert_*|test_useless_loop_nodes|import pytest from wemake_python_styleguide.violations.consistency import UselessNodeViolation from wemake_python_styleguide.visitors.ast.statements import ( StatementsWithBodiesVisitor, ) for_template = """ def wrapper(): for some_var in call(): {0} """ while_template = """ def wrapper... | [UselessNodeViolation]) | 89 | 4 |
wemake-services/wemake-python-styleguide | train | 446 | fe2e73dc9de2c36186f6b3923a55d2aabfcf4096 | train | tests/test_visitors/test_ast/test_subscripts/test_float_key_usage.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_subscripts/test_float_key_usage.py | 26 | 4 | assert_* | test_float_key_usage | import pytest
from wemake_python_styleguide.violations.best_practices import FloatKeyViolation
from wemake_python_styleguide.visitors.ast.subscripts import CorrectKeyVisitor
usage_template = 'some_dict[{0}]'
@pytest.mark.parametrize('expression', [
'1.0',
'-0.0',
'+3.5',
])
def test_float_key_usage(
... | [FloatKeyViolation]) | modified | 3c80771bc039bfb2d490565a76ca7c02f1bf4433af76a90743f266074d407813 | assert_*|test_float_key_usage|import pytest from wemake_python_styleguide.violations.best_practices import FloatKeyViolation from wemake_python_styleguide.visitors.ast.subscripts import CorrectKeyVisitor usage_template = 'some_dict[{0}]' @pytest.mark.parametrize('expression', [ '1.0', '-0.0', '+3.5', ]) def test_float_... | [FloatKeyViolation]) | 28 | 4 |
wemake-services/wemake-python-styleguide | train | 447 | fba0f6bccb31206c445a137b780e1ee35fc78fc9 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | 165 | 4 | assert_* | test_multiple_assignments | import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongUnpackingViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongAssignmentVisitor,
)
single_assignment = '{0} = 1'
tuple_assignment1 = 'first, {0} = (1, 2)'
tuple_assignment2 = '{0}, second = (1, 2)'
... | [WrongUnpackingViolation]) | modified | 4a5219d11add585ce19df291b1d730160823fac6f7dc624fd4e644ce61d0d9c0 | assert_*|test_multiple_assignments|import pytest from wemake_python_styleguide.violations.best_practices import ( WrongUnpackingViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongAssignmentVisitor, ) single_assignment = '{0} = 1' tuple_assignment1 = 'first, {0} = (1, 2)' tuple_assignment2 = ... | [WrongUnpackingViolation]) | 165 | 4 |
wemake-services/wemake-python-styleguide | train | 447 | fba0f6bccb31206c445a137b780e1ee35fc78fc9 | train | tests/test_visitors/test_ast/test_compares/test_nested_ternary.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_nested_ternary.py | 173 | 4 | assert_* | test_nested_ternary | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
NestedTernaryViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConditionalVisitor,
)
wrong_compare1 = 'x > (a if b else c)'
wrong_compare2 = '(a i... | [NestedTernaryViolation]) | modified | 30c5905560744a5bbe7d97417dda0cb877baffeb87d89d1225ee3a0d18defd9b | assert_*|test_nested_ternary|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( NestedTernaryViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConditionalVisitor, ) wrong_compare1 = 'x > (a if b else c)' wro... | [NestedTernaryViolation]) | 173 | 4 |
wemake-services/wemake-python-styleguide | train | 447 | fba0f6bccb31206c445a137b780e1ee35fc78fc9 | train | tests/test_visitors/test_ast/test_complexity/test_nested/test_nested_classes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_nested/test_nested_classes.py | 209 | 4 | assert_* | test_whitelist_nested_classes_in_functions | import pytest
from wemake_python_styleguide.options.defaults import NESTED_CLASSES_WHITELIST
from wemake_python_styleguide.violations.best_practices import (
NestedClassViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.nested import (
NestedComplexityVisitor,
)
nested_class_in_class = """
cla... | whitelist_name) | modified | 1d3c93365b4dd69394c0ddfe8e93065942a68e5f6b3a63b16eacdd7a70848648 | assert_*|test_whitelist_nested_classes_in_functions|import pytest from wemake_python_styleguide.options.defaults import NESTED_CLASSES_WHITELIST from wemake_python_styleguide.violations.best_practices import ( NestedClassViolation, ) from wemake_python_styleguide.visitors.ast.complexity.nested import ( NestedComplexity... | whitelist_name) | 211 | 4 |
wemake-services/wemake-python-styleguide | train | 447 | fba0f6bccb31206c445a137b780e1ee35fc78fc9 | train | tests/test_visitors/test_ast/test_exceptions/test_finally_return_path.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_finally_return_path.py | 441 | 4 | assert_* | test_correct_return_path_in_try_except | import pytest
from wemake_python_styleguide.violations.best_practices import (
TryExceptMultipleReturnPathViolation,
)
from wemake_python_styleguide.violations.consistency import (
UselessExceptCaseViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongTryExceptVisitor,
)
# Corre... | UselessExceptCaseViolation) | modified | f5afbb61961c97df26f58a96bcbec107c938743054424f4f11f000e74ad09291 | assert_*|test_correct_return_path_in_try_except|import pytest from wemake_python_styleguide.violations.best_practices import ( TryExceptMultipleReturnPathViolation, ) from wemake_python_styleguide.violations.consistency import ( UselessExceptCaseViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ... | UselessExceptCaseViolation) | 442 | 4 |
wemake-services/wemake-python-styleguide | train | 447 | fba0f6bccb31206c445a137b780e1ee35fc78fc9 | train | tests/test_visitors/test_ast/test_exceptions/test_finally_return_path.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_finally_return_path.py | 494 | 4 | assert_* | test_different_nodes_trigger_violation | import pytest
from wemake_python_styleguide.violations.best_practices import (
TryExceptMultipleReturnPathViolation,
)
from wemake_python_styleguide.violations.consistency import (
UselessExceptCaseViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongTryExceptVisitor,
)
# Corre... | [TryExceptMultipleReturnPathViolation]) | modified | a449ba4c8182340b670373e545c3fa72482a719e15223054942856cebbc72a48 | assert_*|test_different_nodes_trigger_violation|import pytest from wemake_python_styleguide.violations.best_practices import ( TryExceptMultipleReturnPathViolation, ) from wemake_python_styleguide.violations.consistency import ( UselessExceptCaseViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ... | [TryExceptMultipleReturnPathViolation]) | 495 | 4 |
wemake-services/wemake-python-styleguide | train | 447 | fba0f6bccb31206c445a137b780e1ee35fc78fc9 | train | tests/test_visitors/test_ast/test_statements/test_parameters_indentation/test_collection_indentation.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_statements/test_parameters_indentation/test_collection_indentation.py | 286 | 4 | assert_* | test_wrong_collection_indentation | import pytest
from wemake_python_styleguide.visitors.ast.statements import (
ParametersIndentationViolation,
WrongParametersIndentationVisitor,
)
# Correct:
correct_single_line_tuple = 'xy = (1, 2, 3)'
correct_single_line_list = 'xy = [1, 2, 3]'
correct_single_line_set = 'xy = {1, 2, 3}'
correct_single_line_... | [ParametersIndentationViolation]) | modified | 900aa77b45b7a773b965eff17ac0c2028caca230fba7be3b3220492620901786 | assert_*|test_wrong_collection_indentation|import pytest from wemake_python_styleguide.visitors.ast.statements import ( ParametersIndentationViolation, WrongParametersIndentationVisitor, ) # Correct: correct_single_line_tuple = 'xy = (1, 2, 3)' correct_single_line_list = 'xy = [1, 2, 3]' correct_single_line_set = 'xy =... | [ParametersIndentationViolation]) | 287 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.