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 | 399 | ffc1f15defb183fad5df2ce35000d52ba6dab88e | train | tests/test_violations/test_implementation.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_implementation.py | 13 | 4 | assert | test_visitor_returns_location | # -*- coding: utf-8 -*-
import ast
from wemake_python_styleguide.violations.base import ASTViolation
def test_visitor_returns_location():
"""Ensures that `BaseNodeVisitor` return correct violation message."""
visitor = ASTViolation(node=ast.parse(''), text='violation')
visitor.error_template = '{0}'
... | (0, 0, 'WPS001 violation') | modified | 9910a4890356a62f4a1173ad6572bf031d54b6a82fbe7ab94d01b893225a9ea1 | assert|test_visitor_returns_location|# -*- coding: utf-8 -*- import ast from wemake_python_styleguide.violations.base import ASTViolation def test_visitor_returns_location(): """Ensures that `BaseNodeVisitor` return correct violation message.""" visitor = ASTViolation(node=ast.parse(''), text='violation') visitor.error... | (0, 0, 'WPS001 violation') | 16 | 4 |
wemake-services/wemake-python-styleguide | train | 400 | dea621a3505867de1e588d21b3e2c29c6208b0a0 | train | tests/test_visitors/test_ast/test_blocks/test_control_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_control_variables.py | 203 | 4 | assert_* | test_control_variable_used_after_block | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
ControlVarUsedAfterBlockViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import (
AfterBlockVariablesVisitor,
)
# Correct:
correct_for_loop1 = """
def wrapper():
for i, j in ():
p... | [ControlVarUsedAfterBlockViolation]) | added | d7823744e7b3c9c2c69fe11c530c0edbc8fa7a5644cfbaf5cc842173f3fd3564 | assert_*|test_control_variable_used_after_block|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( ControlVarUsedAfterBlockViolation, ) from wemake_python_styleguide.visitors.ast.blocks import ( AfterBlockVariablesVisitor, ) # Correct: correct_for_loop1 = """ def wrap... | null | null | null |
wemake-services/wemake-python-styleguide | train | 400 | dea621a3505867de1e588d21b3e2c29c6208b0a0 | train | tests/test_visitors/test_ast/test_blocks/test_overlap/test_try_block.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_overlap/test_try_block.py | 157 | 4 | assert_* | test_except_block_overlap | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BlockAndLocalOverlapViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor
# Exception handling:
except_block1 = 'except Exception as {0}:'
except_block2 = 'except (TypeErro... | [BlockAndLocalOverlapViolation]) | added | e082bdb93c7409926da9c382cd75f9410b623dc267dbf3b294b51e81fd0d3b20 | assert_*|test_except_block_overlap|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BlockAndLocalOverlapViolation, ) from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor # Exception handling: except_block1 = 'except Exception as {0}:' except... | null | null | null |
wemake-services/wemake-python-styleguide | train | 400 | dea621a3505867de1e588d21b3e2c29c6208b0a0 | train | tests/test_visitors/test_ast/test_blocks/test_overlap/test_try_block.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_overlap/test_try_block.py | 158 | 4 | assert_* | test_except_block_overlap | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BlockAndLocalOverlapViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor
# Exception handling:
except_block1 = 'except Exception as {0}:'
except_block2 = 'except (TypeErro... | variable_name) | added | 6c2a80f1008d25ce6a80d6716ecdbadf69d8dd4ee62fc3f53a840ef8375c9dec | assert_*|test_except_block_overlap|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BlockAndLocalOverlapViolation, ) from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor # Exception handling: except_block1 = 'except Exception as {0}:' except... | null | null | null |
wemake-services/wemake-python-styleguide | train | 400 | dea621a3505867de1e588d21b3e2c29c6208b0a0 | train | tests/test_visitors/test_ast/test_blocks/test_overlap/test_try_block.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_overlap/test_try_block.py | 266 | 4 | assert_* | test_except_block_regression1115 | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BlockAndLocalOverlapViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor
# Exception handling:
except_block1 = 'except Exception as {0}:'
except_block2 = 'except (TypeErro... | violations) | added | d24908ad0e2ebb6960c7443c9220e14e809003d153f983dec859ea6b4bfc799d | assert_*|test_except_block_regression1115|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BlockAndLocalOverlapViolation, ) from wemake_python_styleguide.visitors.ast.blocks import BlockVariableVisitor # Exception handling: except_block1 = 'except Exception as {0}:'... | null | null | null |
wemake-services/wemake-python-styleguide | train | 401 | 528816f7290f8d42a93f9c7e7fbe0ebea01a8024 | train | tests/test_visitors/test_ast/test_blocks/test_control_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_control_variables.py | 220 | 4 | assert_* | test_control_variable_used_after_block | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
ControlVarUsedAfterBlockViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import (
AfterBlockVariablesVisitor,
)
# Correct:
correct_for_loop1 = """
def wrapper():
for i, j in ():
p... | [ControlVarUsedAfterBlockViolation]) | added | 105bbfb58a59702b741abc4a0afa324900b3ed011477ad5f3147ccf890e578e0 | assert_*|test_control_variable_used_after_block|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( ControlVarUsedAfterBlockViolation, ) from wemake_python_styleguide.visitors.ast.blocks import ( AfterBlockVariablesVisitor, ) # Correct: correct_for_loop1 = """ def wrap... | null | null | null |
wemake-services/wemake-python-styleguide | train | 401 | 528816f7290f8d42a93f9c7e7fbe0ebea01a8024 | train | tests/test_visitors/test_ast/test_conditions/test_negated_conditions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_negated_conditions.py | 111 | 4 | assert_* | test_wrong_negated_complex_conditions | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.refactoring import (
NegatedConditionsViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor
if_expression = '1 if {0} else 2'
simple_conditions = """
if {0}:
...
"""
complex_elif_conditions ... | [NegatedConditionsViolation]) | modified | 6fc3616a1992b8e08b1d202dbd26d337adc5194aa9b2d8dab23c2ad886f7c131 | assert_*|test_wrong_negated_complex_conditions|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.refactoring import ( NegatedConditionsViolation, ) from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor if_expression = '1 if {0} else 2' simple_conditions = """ if {0... | [NegatedConditionsViolation]) | 109 | 4 |
wemake-services/wemake-python-styleguide | train | 402 | b890f55001ecdfd2aa479ee58c4518b93d784b23 | 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 | 43 | 4 | assert_* | test_vague_method_name_import | # -*- coding: utf-8 -*-
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 i... | [VagueImportViolation]) | added | e91337219b5c82aba6fe127f5e2e5f48fbe3b6776c78455824cca3d9b7ca8ae1 | assert_*|test_vague_method_name_import|# -*- coding: utf-8 -*- 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}' fr... | null | null | null |
wemake-services/wemake-python-styleguide | train | 402 | b890f55001ecdfd2aa479ee58c4518b93d784b23 | 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 | 139 | 4 | assert_* | test_wrong_variable_usage | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsUsedViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongNameVisitor,
WrongVariableUsageVisitor,
)
annotation = 'some_var: {0}'
annotation_value = 'some_var: {0} = None'
... | [UnusedVariableIsUsedViolation]) | modified | 382fdd1626524a0c58cdb4d613a9e4bcb62982615112578e0e0b7d07f2a96cca | assert_*|test_wrong_variable_usage|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnusedVariableIsUsedViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongNameVisitor, WrongVariableUsageVisitor, ) annotation = 'some_var: {0}' annotation_value = 'so... | [UnusedVariableIsUsedViolation]) | 139 | 4 |
wemake-services/wemake-python-styleguide | train | 403 | 593530dc952e1e9e53120286571d3382c4c49b9b | train | tests/test_visitors/test_ast/test_exceptions/test_try_finally.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_try_finally.py | 84 | 4 | assert_* | test_wrong_finally | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.refactoring import (
UselessFinallyViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongTryExceptVisitor,
)
right_try_example = """
try:
...
except:
...
"""
wrong_try_example1 = """
try:
..... | [UselessFinallyViolation]) | added | 2ef9acdb79ae7fc0df7b4414a0942f77a5597b50833aa4b37c84398c81ec279f | assert_*|test_wrong_finally|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.refactoring import ( UselessFinallyViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ( WrongTryExceptVisitor, ) right_try_example = """ try: ... except: ... """ wrong_try_example1 = """ try... | null | null | null |
wemake-services/wemake-python-styleguide | train | 404 | 75328dbf74c491cc1962861d6433c1451a88873b | train | tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_string.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_string.py | 156 | 4 | assert_* | test_string_overuse | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
OverusedStringViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.overuses import (
StringOveruseVisitor,
)
string_actions = """
first = {0}
second({0})
third[{0}]
'new' + {0}
"""
string_functio... | [OverusedStringViolation]) | added | 62e6db0ab344e1301791deab4a60c9355b5584bddc6b238294b7f37134ee62f4 | assert_*|test_string_overuse|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( OverusedStringViolation, ) from wemake_python_styleguide.visitors.ast.complexity.overuses import ( StringOveruseVisitor, ) string_actions = """ first = {0} second({0}) third[{0}] 'new' + {0} "... | null | null | null |
wemake-services/wemake-python-styleguide | train | 404 | 75328dbf74c491cc1962861d6433c1451a88873b | train | tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_string.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_string.py | 157 | 4 | assert_* | test_string_overuse | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
OverusedStringViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.overuses import (
StringOveruseVisitor,
)
string_actions = """
first = {0}
second({0})
third[{0}]
'new' + {0}
"""
string_functio... | default_options.max_string_usages) | added | 46be751c85b3c21b7f5806f71ece3fd35a684db4159ef52b74b8317bbab1e14c | assert_*|test_string_overuse|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( OverusedStringViolation, ) from wemake_python_styleguide.visitors.ast.complexity.overuses import ( StringOveruseVisitor, ) string_actions = """ first = {0} second({0}) third[{0}] 'new' + {0} "... | null | null | null |
wemake-services/wemake-python-styleguide | train | 405 | 878abd79da411f11686329b5602369cece3336d4 | 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 | 36 | 4 | assert_* | test_single_item_container | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.refactoring import (
InCompareWithSingleItemContainerViolation,
WrongInCompareTypeViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
InCompareSanityVisitor,
)
@pytest.mark.parametrize('code', [
'if ... | [InCompareWithSingleItemContainerViolation]) | modified | bdfffa6aab276b0ffeb5a35a2015308522a653fc219978749d8976af10ab1899 | assert_*|test_single_item_container|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.refactoring import ( InCompareWithSingleItemContainerViolation, WrongInCompareTypeViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( InCompareSanityVisitor, ) @pytest.mark.parametriz... | [InCompareWithSingleItemContainerViolation]) | 34 | 4 |
wemake-services/wemake-python-styleguide | train | 405 | 878abd79da411f11686329b5602369cece3336d4 | train | tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | 199 | 4 | assert_* | test_func_expression_overuse | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
OverusedExpressionViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.overuses import (
ExpressionOveruseVisitor,
)
module_context = """
{0}
{1}
"""
function_context1 = """
def function():
{... | [OverusedExpressionViolation]) | added | b7af8c15f001206c46e5c0c8fbfcc24c979e03f869d011158a2666103ee32de4 | assert_*|test_func_expression_overuse|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( OverusedExpressionViolation, ) from wemake_python_styleguide.visitors.ast.complexity.overuses import ( ExpressionOveruseVisitor, ) module_context = """ {0} {1} """ function_context1 =... | null | null | null |
wemake-services/wemake-python-styleguide | train | 405 | 878abd79da411f11686329b5602369cece3336d4 | train | tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | 220 | 4 | assert_* | test_module_expression_overuse | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
OverusedExpressionViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.overuses import (
ExpressionOveruseVisitor,
)
module_context = """
{0}
{1}
"""
function_context1 = """
def function():
{... | [OverusedExpressionViolation]) | added | 91be40a37854111f24ce478a97276f3ee8513346145b45d10c7ba346448c2f4d | assert_*|test_module_expression_overuse|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( OverusedExpressionViolation, ) from wemake_python_styleguide.visitors.ast.complexity.overuses import ( ExpressionOveruseVisitor, ) module_context = """ {0} {1} """ function_context1... | null | null | null |
wemake-services/wemake-python-styleguide | train | 405 | 878abd79da411f11686329b5602369cece3336d4 | train | tests/test_visitors/test_ast/test_functions/test_useless_lambda.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_useless_lambda.py | 50 | 4 | assert_* | test_incorrect_lambda_definition | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
UselessLambdaViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
UselessLambdaDefinitionVisitor,
)
template = '{0}: {1}'
usele... | [UselessLambdaViolation]) | modified | 10b30e076dd65139361d4be3781e05a19c0957a35f00854492a94abc986db9b1 | assert_*|test_incorrect_lambda_definition|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( UselessLambdaViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( UselessLambdaDefinitionVisitor,... | [UselessLambdaViolation]) | 49 | 4 |
wemake-services/wemake-python-styleguide | train | 406 | 393df99c1f7f641607835f6bb06ce0e74de305fa | train | tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return_variables.py | 353 | 4 | assert_* | test_wrong_return_variable | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentReturnVariableViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
ConsistentReturningVariableVisitor,
)
# Correct:
correct_example1 = """
def some_function():
return 1
""... | [InconsistentReturnVariableViolation]) | added | 30d70143d1dc2ff25709b4fc73c817089b99935e9ecc6d6a62a78c3dd1d3161a | assert_*|test_wrong_return_variable|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentReturnVariableViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( ConsistentReturningVariableVisitor, ) # Correct: correct_example1 = """ def some_fun... | null | null | null |
wemake-services/wemake-python-styleguide | train | 406 | 393df99c1f7f641607835f6bb06ce0e74de305fa | train | tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return_variables.py | 407 | 4 | assert_* | test_double_wrong_return_variable | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentReturnVariableViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
ConsistentReturningVariableVisitor,
)
# Correct:
correct_example1 = """
def some_function():
return 1
""... | [ InconsistentReturnVariableViolation, InconsistentReturnVariableViolation, ]) | added | 54f65dca7de9e998d263f8491e476c861b0a7ca134bf7adf2772fac26d657133 | assert_*|test_double_wrong_return_variable|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentReturnVariableViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( ConsistentReturningVariableVisitor, ) # Correct: correct_example1 = """ def s... | null | null | null |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/fixtures/noqa/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa/noqa.py | 295 | 0 | assert | # -*- coding: utf-8 -*- # noqa: WPS323
"""
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 ... | octal_number | modified | 4eac252dcd0d51a84435b7ee86f59552512f0f057242df2124cc8d96fe9192f4 | assert||# -*- coding: utf-8 -*- # noqa: WPS323 """ 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 im... | octal_number | 295 | 0 | |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 293 | 8 | assert | # -*- coding: utf-8 -*-
"""
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/late... | errors | modified | 19d2980c78e649e2b546d86e99fa1e16a6b5ae9cea1e264e43d8f2d1b5f7d15b | assert||# -*- coding: utf-8 -*- """ 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/... | errors | 292 | 8 | |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/test_visitors/test_ast/test_complexity/test_classes/test_method_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_classes/test_method_counts.py | 148 | 4 | assert_* | test_method_counts_violation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.classes import (
MethodMembersVisitor,
TooManyMethodsViolation,
)
module_without_methods = """
def first(): ...
def second(): ...
"""
module_with_async_functions = """
async def first(): ...
async def second(): ...... | option_values.max_methods) | modified | 33c70f3759fbf531f0e8141421846f2083a110cb3927f8ad27b7ec75acfae5fa | assert_*|test_method_counts_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.classes import ( MethodMembersVisitor, TooManyMethodsViolation, ) module_without_methods = """ def first(): ... def second(): ... """ module_with_async_functions = """ async def first(): ...... | option_values.max_methods) | 148 | 4 |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_condition_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_condition_counts.py | 141 | 4 | assert_* | test_module_condition_real_config | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyConditionsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ConditionsVisitor,
)
empty_module = ''
assignment = 'some = x > y or None'
condition_with_single_if = """
if ... | [TooManyConditionsViolation]) | modified | 50ebbf6394a7b3ef9a66224859977c5bee6991e2cf2177543083444727b55263 | assert_*|test_module_condition_real_config|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyConditionsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( ConditionsVisitor, ) empty_module = '' assignment = 'some = x > y or None' con... | [TooManyConditionsViolation]) | 139 | 4 |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_decorators.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_decorators.py | 87 | 4 | assert_* | test_decorators_incorrect | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyDecoratorsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ModuleMembersVisitor,
)
function_with_decorators = """
@first
@second(param=4)
@third()
def function(): ...
""... | option_values.max_decorators) | modified | 352a3ef78b2ebe9833da6a00262ca4f6474f545041d0fd33ee2c19250d4cef75 | assert_*|test_decorators_incorrect|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyDecoratorsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( ModuleMembersVisitor, ) function_with_decorators = """ @first @second(param=4) @third(... | option_values.max_decorators) | 85 | 4 |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_elifs.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_elifs.py | 214 | 4 | assert_* | test_elif_incorrect_count | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyElifsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import ElifVisitor
module_with_one_elif = """
if 1 > 2:
...
elif 2 > 3:
...
else:
...
"""
module_with_two_elifs = "... | [TooManyElifsViolation]) | modified | e710f9863207a33d5e5a7a13f741f412f80c3e23b14cd76a37ef2329829967c0 | assert_*|test_elif_incorrect_count|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyElifsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ElifVisitor module_with_one_elif = """ if 1 > 2: ... elif 2 > 3: ... else: ... """ module_wit... | [TooManyElifsViolation]) | 214 | 4 |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_imports_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_imports_counts.py | 89 | 4 | assert_* | test_module_imported_names_counts_violation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyImportedModuleMembersViolation,
TooManyImportedNamesViolation,
TooManyImportsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ImportMembersVisitor,
)
module_impo... | option_values.max_imported_names) | modified | 8d3bd31a42751738b01c55bf2026eaac4078c214b92d2dd6c1864e8a6658c1a1 | assert_*|test_module_imported_names_counts_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyImportedModuleMembersViolation, TooManyImportedNamesViolation, TooManyImportsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( I... | option_values.max_imported_names) | 86 | 4 |
wemake-services/wemake-python-styleguide | train | 407 | 381fbceb455382b6348f8c2fff59b9726575e7c7 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_module_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_module_counts.py | 163 | 4 | assert_* | test_module_counts_violation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyModuleMembersViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ModuleMembersVisitor,
)
# Multiple module members:
module_with_function_and_class = """
def first(): ...
... | option_values.max_module_members) | modified | 018a3e1e36f5236729247f8327689d48c8c59551141652a917b97ffaa6f1f4d0 | assert_*|test_module_counts_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyModuleMembersViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( ModuleMembersVisitor, ) # Multiple module members: module_with_function_and_clas... | option_values.max_module_members) | 161 | 4 |
wemake-services/wemake-python-styleguide | train | 408 | 6a254a88fee6ee383d45b98f57173723df672be9 | train | tests/test_visitors/test_ast/test_classes/test_methods/test_useless_overwriting_method.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_methods/test_useless_overwriting_method.py | 161 | 4 | assert_* | test_useless_overwriting | # -*- coding: utf-8 -*-
from typing import List, NamedTuple
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations import oop
from wemake_python_styleguide.visitors.ast.classes import WrongMethodVisitor
regular_method_detailed = """
class Useless(object):
... | [oop.UselessOverwrittenMethodViolation]) | added | 183d6572597e0782a734801358cf2337ef38bf805678ff4403ce3e7db43da733 | assert_*|test_useless_overwriting|# -*- coding: utf-8 -*- from typing import List, NamedTuple import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations import oop from wemake_python_styleguide.visitors.ast.classes import WrongMethodVisitor regular_method_detailed ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 409 | 0c165adda690f9bb9e51c259255fb71ab29a9cf8 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 291 | 12 | assert | # -*- coding: utf-8 -*-
"""
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/late... | errors | modified | a6365b18ea3e19c76f45a3e59ab69e84cf2b4108e4856ae5e80df2fb8630ec41 | assert||# -*- coding: utf-8 -*- """ 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/... | errors | 290 | 12 | |
wemake-services/wemake-python-styleguide | train | 409 | 0c165adda690f9bb9e51c259255fb71ab29a9cf8 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 295 | 8 | assert | # -*- coding: utf-8 -*-
"""
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/late... | errors.get(found_error) | modified | 2c5fd0d4f48dfedbd72f4b315e359040edee9f6f850e391aa51043226d8e31ef | assert||# -*- coding: utf-8 -*- """ 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/... | errors.get(found_error) | 294 | 8 | |
wemake-services/wemake-python-styleguide | train | 409 | 0c165adda690f9bb9e51c259255fb71ab29a9cf8 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 304 | 4 | assert | test_codes | # -*- coding: utf-8 -*-
"""
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/late... | len(all_violations) | modified | 66b6fde6277da6a5782701f4e353fe34dea93597d9a73d3b6c51234e02aa3e6a | assert|test_codes|# -*- coding: utf-8 -*- """ 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-style... | len(all_violations) | 303 | 4 |
wemake-services/wemake-python-styleguide | train | 409 | 0c165adda690f9bb9e51c259255fb71ab29a9cf8 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 378 | 4 | assert | test_noqa_fixture_disabled_no_control | # -*- coding: utf-8 -*-
"""
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/late... | len(all_controlled_violations) | modified | 333f5141fffc5b6858089401226d8ee855c71536150e2014874261a7dc31f0e9 | assert|test_noqa_fixture_disabled_no_control|# -*- coding: utf-8 -*- """ 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: ... | len(all_controlled_violations) | 377 | 4 |
wemake-services/wemake-python-styleguide | train | 409 | 0c165adda690f9bb9e51c259255fb71ab29a9cf8 | train | tests/test_visitors/test_tokenize/test_consistency/test_string_newlines.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_consistency/test_string_newlines.py | 55 | 4 | assert_* | test_string_wrong_line_breaks | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
LineCompriseCarriageReturnViolation,
)
from wemake_python_styleguide.visitors.tokenize.syntax import (
WrongKeywordTokenVisitor,
)
# Correct:
correct_newline = 'print(1)\nprint(2)'
correct_nl = 'print(1,\n ... | [LineCompriseCarriageReturnViolation]) | added | 9b210ce8fb5fd71e768b06dfd9271a3452bec10a0fe396c35bd28a15ed0a9703 | assert_*|test_string_wrong_line_breaks|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( LineCompriseCarriageReturnViolation, ) from wemake_python_styleguide.visitors.tokenize.syntax import ( WrongKeywordTokenVisitor, ) # Correct: correct_newline = 'print(1)\nprint(2)' ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 296 | 8 | assert | # -*- coding: utf-8 -*-
"""
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/late... | errors | modified | b0d95306d7f65e715a262cd871cc180e6913968f4f97f77e5d5d25fdcf15aa8c | assert||# -*- coding: utf-8 -*- """ 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/... | errors | 294 | 8 | |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 297 | 8 | assert | # -*- coding: utf-8 -*-
"""
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/late... | errors.get(found_error) | modified | 394d1e2ac78da17b8826f4ad0f264e3db5eea3e4ef0fc6443dfd9bcda803fcbc | assert||# -*- coding: utf-8 -*- """ 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/... | errors.get(found_error) | 295 | 8 | |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | train | tests/test_visitors/test_ast/test_exceptions/test_finally_in_loops.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_finally_in_loops.py | 122 | 4 | assert_* | test_finally_with_break | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
LoopControlFinallyViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongTryExceptVisitor,
)
right_try_example_with_for =... | [LoopControlFinallyViolation]) | added | d6c444c39aac1ba2b014550df42c2ec0f23a7288bff4a817668bc6597908bc88 | assert_*|test_finally_with_break|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( LoopControlFinallyViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ( WrongTryExceptVisitor, ) right_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | train | tests/test_visitors/test_ast/test_exceptions/test_finally_in_loops.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_finally_in_loops.py | 150 | 4 | assert_* | test_finally_with_continue | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
LoopControlFinallyViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongTryExceptVisitor,
)
right_try_example_with_for =... | [LoopControlFinallyViolation]) | added | 434935866276d6f2c9eaf73a80766552f652209f0a572f944b0095e260368168 | assert_*|test_finally_with_continue|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( LoopControlFinallyViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ( WrongTryExceptVisitor, ) rig... | null | null | null |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | train | tests/test_visitors/test_ast/test_exceptions/test_finally_in_loops.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_finally_in_loops.py | 173 | 9 | pytest.raises | test_finally_with_continue_and_exception | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
LoopControlFinallyViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongTryExceptVisitor,
)
right_try_example_with_for =... | SyntaxError) | added | 3637ff0a6de1244433fdcdd16176f6f13f02297db8a89308b4fbbcc1b49b1642 | pytest.raises|test_finally_with_continue_and_exception|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( LoopControlFinallyViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ( WrongTryE... | null | null | null |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | 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 | 399 | 4 | assert_* | test_wrong_return_in_else_or_finally | # -*- coding: utf-8 -*-
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 (
WrongTry... | UselessExceptCaseViolation) | modified | c4bdd5f23d48b02eccbb5b41daf73d56ed144ee1b1d6d9f73ca186eb8b4ac9f1 | assert_*|test_wrong_return_in_else_or_finally|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( TryExceptMultipleReturnPathViolation, ) from wemake_python_styleguide.violations.consistency import ( UselessExceptCaseViolation, ) from wemake_python_styleguide.visitors.... | UselessExceptCaseViolation) | 400 | 4 |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | 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 | 444 | 4 | assert_* | test_correct_return_path_in_try_except | # -*- coding: utf-8 -*-
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 (
WrongTry... | UselessExceptCaseViolation) | modified | dc6fb16ba33a9a012a62e8a38f00010161dffd2fefe44e44a779e88e07804864 | assert_*|test_correct_return_path_in_try_except|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( TryExceptMultipleReturnPathViolation, ) from wemake_python_styleguide.violations.consistency import ( UselessExceptCaseViolation, ) from wemake_python_styleguide.visitor... | UselessExceptCaseViolation) | 446 | 4 |
wemake-services/wemake-python-styleguide | train | 410 | 145a77a741947a8ea23fef55e8c4e709193ce049 | 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 | 497 | 4 | assert_* | test_different_nodes_trigger_violation | # -*- coding: utf-8 -*-
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 (
WrongTry... | [TryExceptMultipleReturnPathViolation]) | added | 582ea85909af89b2ddbfb811be7b166f376c6d80ed5b9bf1fc3c7de13bfb0fb5 | assert_*|test_different_nodes_trigger_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( TryExceptMultipleReturnPathViolation, ) from wemake_python_styleguide.violations.consistency import ( UselessExceptCaseViolation, ) from wemake_python_styleguide.visitor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 411 | b533e71bb89484fe1368146f7ff7ee6c4913c793 | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 131 | 4 | assert_* | test_complex_annotations | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_te... | [TooComplexAnnotationViolation]) | added | da65269e641d52b9d7b25e356fd8535edf911cde599630ebd59149062c7b7971 | assert_*|test_complex_annotations|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationComplexity... | null | null | null |
wemake-services/wemake-python-styleguide | train | 411 | b533e71bb89484fe1368146f7ff7ee6c4913c793 | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 168 | 4 | assert_* | test_complex_annotations_config | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_te... | [TooComplexAnnotationViolation]) | added | 49c859201140d029312e7008609cf1d77266499e0afb52a5d7231f2a27e7ce54 | assert_*|test_complex_annotations_config|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationCom... | null | null | null |
wemake-services/wemake-python-styleguide | train | 411 | b533e71bb89484fe1368146f7ff7ee6c4913c793 | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 169 | 4 | assert_* | test_complex_annotations_config | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_te... | option_values.max_annotation_complexity) | added | 173c092d111c1e6fb37a92498c8321671f9b052abf4d21387826f561cfdb659c | assert_*|test_complex_annotations_config|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationCom... | null | null | null |
wemake-services/wemake-python-styleguide | train | 411 | b533e71bb89484fe1368146f7ff7ee6c4913c793 | 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 | 100 | 4 | assert_* | test_no_arguments_error | # -*- coding: utf-8 -*-
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]) | added | 5ffd2867b62dc1d65e96fbaa348c0cb25fdda6e2e2bd17d07d70e0050e9c0e36 | assert_*|test_no_arguments_error|# -*- coding: utf-8 -*- 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_ar... | null | null | null |
wemake-services/wemake-python-styleguide | train | 411 | b533e71bb89484fe1368146f7ff7ee6c4913c793 | 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 | 101 | 4 | assert_* | test_no_arguments_error | # -*- coding: utf-8 -*-
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:... | option_values.max_arguments) | added | 6338628f824dc59e3adcf8996ecda2a6bee3dd7e7995faa2eb0f4dcf48b39446 | assert_*|test_no_arguments_error|# -*- coding: utf-8 -*- 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_ar... | null | null | null |
wemake-services/wemake-python-styleguide | train | 411 | b533e71bb89484fe1368146f7ff7ee6c4913c793 | train | tests/test_visitors/test_ast/test_functions/test_complex_default_values.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_complex_default_values.py | 94 | 4 | assert_* | test_wrong_function_defaults | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
ComplexDefaultValueViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FunctionDefinitionVisitor,
)
function_with_defaults =... | [ComplexDefaultValueViolation]) | added | 28efe11c569c7054c0e47cffd9b9b33b2fb7be96cdbeaf103105201a5dc21dfb | assert_*|test_wrong_function_defaults|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( ComplexDefaultValueViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FunctionDefinitionVisitor,... | null | null | null |
wemake-services/wemake-python-styleguide | train | 411 | b533e71bb89484fe1368146f7ff7ee6c4913c793 | train | tests/test_visitors/test_ast/test_statements/test_parameters_indentation/test_function_indentation.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_statements/test_parameters_indentation/test_function_indentation.py | 157 | 4 | assert_* | test_wrong_function_indentation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.visitors.ast.statements import (
ParametersIndentationViolation,
WrongParametersIndentationVisitor,
)
# Correct:
correct_single_line_function = 'def test(arg, *args, kw, **kwargs): ... | [ParametersIndentationViolation]) | added | 79b70445f2f5caa053636194f1868992d4dbd5401eff923c99eb5d681cd23359 | assert_*|test_wrong_function_indentation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.visitors.ast.statements import ( ParametersIndentationViolation, WrongParametersIndentationVisitor, ) # Correct: correct_single_line_function = 'def tes... | null | null | null |
wemake-services/wemake-python-styleguide | train | 412 | 467728ad7937195bd124d2f84d4a4f3c09d5bc45 | train | tests/test_visitors/test_ast/test_functions/test_complex_default_values.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_complex_default_values.py | 97 | 4 | assert_* | test_wrong_function_defaults | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
ComplexDefaultValueViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FunctionDefinitionVisitor,
)
function_with_defaults =... | [ComplexDefaultValueViolation]) | modified | 55b7fa1ce9b13b0dc0edb7ccb543bf014f16a6a01e2be79959513676949e538b | assert_*|test_wrong_function_defaults|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( ComplexDefaultValueViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FunctionDefinitionVisitor,... | [ComplexDefaultValueViolation]) | 94 | 4 |
wemake-services/wemake-python-styleguide | train | 413 | 4f58fcf4a5b95b4df580145b52263b2ada7c9896 | train | tests/test_visitors/test_ast/test_functions/test_boolean_args.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_boolean_args.py | 121 | 4 | assert_* | test_wrong_three_boolean_argument | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BooleanPositionalArgumentViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallVisitor,
)
correct_argument = '{1}(0, 1, keyword={0}, other={0})'
correct_three_arguments... | [ BooleanPositionalArgumentViolation, BooleanPositionalArgumentViolation, BooleanPositionalArgumentViolation, ]) | added | 12208c8afd3d5865fd93700230795902f6ee14267ec5f2e9a21788750faf7975 | assert_*|test_wrong_three_boolean_argument|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BooleanPositionalArgumentViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallVisitor, ) correct_argument = '{1}(0, 1, keyword={0}, oth... | null | null | null |
wemake-services/wemake-python-styleguide | train | 413 | 4f58fcf4a5b95b4df580145b52263b2ada7c9896 | train | tests/test_visitors/test_ast/test_functions/test_boolean_args.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_boolean_args.py | 187 | 4 | assert_* | test_wrong_boolean_argument | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BooleanPositionalArgumentViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallVisitor,
)
correct_argument = '{1}(0, 1, keyword={0}, other={0})'
correct_three_arguments... | [ BooleanPositionalArgumentViolation, BooleanPositionalArgumentViolation, ]) | added | b1c51f7b1f426c89264854e4e3f20a39701cd9908628aad2caa439ee87c84bf5 | assert_*|test_wrong_boolean_argument|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BooleanPositionalArgumentViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallVisitor, ) correct_argument = '{1}(0, 1, keyword={0}, other={0}... | null | null | null |
wemake-services/wemake-python-styleguide | train | 414 | 250237702865b2345f216e20efd5fdf899e61062 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 115 | 4 | assert_* | test_complex_lines | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types... | [LineComplexityViolation]) | added | 97b2f65837fe2b91ca51a0ad0f6fadc2764d7419814cc4be20accd884528634d | assert_*|test_complex_lines|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' li... | null | null | null |
wemake-services/wemake-python-styleguide | train | 414 | 250237702865b2345f216e20efd5fdf899e61062 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 116 | 4 | assert_* | test_complex_lines | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types... | option_values.max_line_complexity) | added | b3f219a137e963250382b4b2fa673ce1287c75931e8671bbaa760974883d5f52 | assert_*|test_complex_lines|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' li... | null | null | null |
wemake-services/wemake-python-styleguide | train | 414 | 250237702865b2345f216e20efd5fdf899e61062 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 155 | 4 | assert | test_exact_complexity | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types... | complexity | added | 654dd0521331d422ec5ada9ba32611bdb7d14da7b8ae5dc39590dcbbd6ae2267 | assert|test_exact_complexity|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' l... | null | null | null |
wemake-services/wemake-python-styleguide | train | 414 | 250237702865b2345f216e20efd5fdf899e61062 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 178 | 4 | assert | test_that_some_nodes_are_ignored | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types... | number_of_lines | added | 495368905cfde182b410a859a059cd9c5129242390d06a4b5b05e3c62e7a90c9 | assert|test_that_some_nodes_are_ignored|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import LineComplexityViolation, JonesScoreViolation from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x:... | null | null | null |
wemake-services/wemake-python-styleguide | train | 415 | b30b8a76461d5f296e9d1aaf3ed0868f62516240 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 118 | 4 | assert_* | test_complex_lines | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
JonesScoreViolation,
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_... | [LineComplexityViolation]) | modified | 03ca2feadb0c078ac061a32bf26da06a839a25a17a62e2d992349af1559b8ea7 | assert_*|test_complex_lines|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( JonesScoreViolation, LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = ... | [LineComplexityViolation]) | 115 | 4 |
wemake-services/wemake-python-styleguide | train | 415 | b30b8a76461d5f296e9d1aaf3ed0868f62516240 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 119 | 4 | assert_* | test_complex_lines | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
JonesScoreViolation,
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_... | option_values.max_line_complexity) | modified | 891ea3f6635d3461fc05b89cb8fba217f4bbf27a09bba7d1b552ce24de46ef54 | assert_*|test_complex_lines|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( JonesScoreViolation, LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = ... | option_values.max_line_complexity) | 116 | 4 |
wemake-services/wemake-python-styleguide | train | 415 | b30b8a76461d5f296e9d1aaf3ed0868f62516240 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 157 | 4 | assert | test_exact_complexity | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
JonesScoreViolation,
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_... | complexity | modified | 2437a75948383029c4f5aec3cdab9fe897b3c61c14ca5352d070a46bdbc9da77 | assert|test_exact_complexity|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( JonesScoreViolation, LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int =... | complexity | 155 | 4 |
wemake-services/wemake-python-styleguide | train | 415 | b30b8a76461d5f296e9d1aaf3ed0868f62516240 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 180 | 4 | assert | test_that_some_nodes_are_ignored | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
JonesScoreViolation,
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_... | number_of_lines | modified | 1dffd40decee4692b6655db8abfabb2c313a477fe12b5aea211bf81d77fa10c2 | assert|test_that_some_nodes_are_ignored|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( JonesScoreViolation, LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types ... | number_of_lines | 178 | 4 |
wemake-services/wemake-python-styleguide | train | 416 | 286949dc777f3d6c5b8b749b896d9003625a5e3d | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 117 | 4 | assert_* | test_complex_lines | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types = 'x: Dict[... | [LineComplexityViolation]) | modified | f061d7f7d51a233800d35db5c39517f137accf203c5e1069ad731488ca0b51e3 | assert_*|test_complex_lines|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' line_with_complex_... | [LineComplexityViolation]) | 118 | 4 |
wemake-services/wemake-python-styleguide | train | 416 | 286949dc777f3d6c5b8b749b896d9003625a5e3d | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 118 | 4 | assert_* | test_complex_lines | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types = 'x: Dict[... | option_values.max_line_complexity) | modified | 83b0794a6e86e3cdbf47b69a2900192487384e73b6cf36ff9f1ce73d17cafcd8 | assert_*|test_complex_lines|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' line_with_complex_... | option_values.max_line_complexity) | 119 | 4 |
wemake-services/wemake-python-styleguide | train | 416 | 286949dc777f3d6c5b8b749b896d9003625a5e3d | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 156 | 4 | assert | test_exact_complexity | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types = 'x: Dict[... | complexity | modified | af4974a774372eb80a6ee635c23785915a2cf8d10309d644f938fc9b0c5b008a | assert|test_exact_complexity|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' line_with_complex... | complexity | 157 | 4 |
wemake-services/wemake-python-styleguide | train | 416 | 286949dc777f3d6c5b8b749b896d9003625a5e3d | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 179 | 4 | assert | test_that_some_nodes_are_ignored | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
LineComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_complex_types = 'x: Dict[... | number_of_lines | modified | c5770c4231e9c7136eae897288a388444515f9882cc9f7317fa6e48f6150162a | assert|test_that_some_nodes_are_ignored|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( LineComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' line_w... | number_of_lines | 180 | 4 |
wemake-services/wemake-python-styleguide | train | 417 | c5ecc893e47697ad9bcbcf46010560c898ff6137 | 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 | 175 | 4 | assert_* | test_nested_ternary | # -*- coding: utf-8 -*-
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... | [NestedTernaryViolation]) | added | dfdd7829d33cd7d329f942747b0975a41a82b85dc620276e56029b000266b2a7 | assert_*|test_nested_ternary|# -*- coding: utf-8 -*- 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 = '... | null | null | null |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | 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 | 89 | 4 | assert_* | test_useless | import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantConditionViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConditionalVisitor,
)
create_variable = """
variable = 1
{0}
"""
if_statement = 'if {0}: ...'
ternary = 'ternary = 0 if {0} else 1'
if_s... | [ConstantConditionViolation]) | modified | 21d344ecee2989818cd66c08837cfe93e7a3ee9b5eb3ed578c30621110f8b611 | assert_*|test_useless|import pytest from wemake_python_styleguide.violations.consistency import ( ConstantConditionViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConditionalVisitor, ) create_variable = """ variable = 1 {0} """ if_statement = 'if {0}: ...' ternary = 'ternary = 0 if {0} el... | [ConstantConditionViolation]) | 91 | 4 |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | train | tests/test_visitors/test_ast/test_complexity/test_classes/test_public_attrs_count.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_classes/test_public_attrs_count.py | 96 | 4 | assert_* | test_wrong_attributes_count | import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyPublicAttributesViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.classes import (
ClassComplexityVisitor,
)
class_template = """
class Test(object):
def __init__(self):
{0}
def other(self):
... | [TooManyPublicAttributesViolation]) | modified | ada6bc4d950efe2bdf9d4cf6dc9cd32c4035911b8857dcb70fbaa7925700c967 | assert_*|test_wrong_attributes_count|import pytest from wemake_python_styleguide.violations.complexity import ( TooManyPublicAttributesViolation, ) from wemake_python_styleguide.visitors.ast.complexity.classes import ( ClassComplexityVisitor, ) class_template = """ class Test(object): def __init__(self): {0} def other(... | [TooManyPublicAttributesViolation]) | 98 | 4 |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | train | tests/test_visitors/test_ast/test_conditions/test_implicit_complex_compare.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_implicit_complex_compare.py | 91 | 4 | assert_* | test_implicit_complex_compare | import pytest
from wemake_python_styleguide.violations.consistency import (
ImplicitComplexCompareViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import (
ImplicitBoolPatternsVisitor,
)
# Wrong:
less_or_less = '{0} < {1} or {2} < {3}'
less_or_more = '{0} < {1} or {2} > {3}'
more_or_more = ... | [ImplicitComplexCompareViolation]) | modified | 2840ddbc38fcff507683cc3946c1e88961c1afdc684b0d97126b0547376b385b | assert_*|test_implicit_complex_compare|import pytest from wemake_python_styleguide.violations.consistency import ( ImplicitComplexCompareViolation, ) from wemake_python_styleguide.visitors.ast.conditions import ( ImplicitBoolPatternsVisitor, ) # Wrong: less_or_less = '{0} < {1} or {2} < {3}' less_or_more = '{0} < {1} o... | [ImplicitComplexCompareViolation]) | 93 | 4 |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | train | tests/test_visitors/test_ast/test_exceptions/test_useless_except_case.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_useless_except_case.py | 88 | 4 | assert_* | test_useless_except_case | import pytest
from wemake_python_styleguide.violations.consistency import (
UselessExceptCaseViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongExceptHandlerVisitor,
)
right_empty_bare_except = """
try:
...
except:
...
"""
right_logging_except = """
try:
...
except E... | [UselessExceptCaseViolation]) | modified | 325d7464984531592d3d22e094c34701b12a11da88421453d451ebbb30604338 | assert_*|test_useless_except_case|import pytest from wemake_python_styleguide.violations.consistency import ( UselessExceptCaseViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ( WrongExceptHandlerVisitor, ) right_empty_bare_except = """ try: ... except: ... """ right_logging_except = """ try: .... | [UselessExceptCaseViolation]) | 90 | 4 |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | 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 | 73 | 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... | short_name) | modified | 4f18987aa9dc0149e50ad9dc7fc46523844168f59e3b0405b2d033a834666785 | 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(... | short_name) | 75 | 4 |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | train | tests/test_visitors/test_ast/test_statements/test_pointless_starred.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_statements/test_pointless_starred.py | 54 | 4 | assert_* | test_pointless_starred_arg_and_keyword | import pytest
from wemake_python_styleguide.violations.refactoring import (
PointlessStarredViolation,
)
from wemake_python_styleguide.visitors.ast.statements import (
PointlessStarredVisitor,
)
@pytest.mark.parametrize('code', [
'print(*[])',
'print(*())',
'print(*{})', # noqa: P103
'print(... | [PointlessStarredViolation, PointlessStarredViolation]) | modified | 4499b8d09d821a875329d340378b1653f4f48fe953963f3a54f991a5fa077725 | assert_*|test_pointless_starred_arg_and_keyword|import pytest from wemake_python_styleguide.violations.refactoring import ( PointlessStarredViolation, ) from wemake_python_styleguide.visitors.ast.statements import ( PointlessStarredVisitor, ) @pytest.mark.parametrize('code', [ 'print(*[])', 'print(*())', 'print(*{})', ... | [PointlessStarredViolation, PointlessStarredViolation]) | 56 | 4 |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | train | tests/test_visitors/test_tokenize/test_primitives/test_numbers/test_partial_floats.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_numbers/test_partial_floats.py | 35 | 4 | assert_* | test_partial_float | import pytest
from wemake_python_styleguide.violations.consistency import (
NumberWithMeaninglessZeroViolation,
PartialFloatViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongNumberTokenVisitor,
)
@pytest.mark.parametrize('primitive', [
'10.',
'.05',
'.0',
... | [PartialFloatViolation]) | modified | c1aadf1b042b24464dabf4588583daa9a5814c8e5f3dcd960aa65b31cbcb886b | assert_*|test_partial_float|import pytest from wemake_python_styleguide.violations.consistency import ( NumberWithMeaninglessZeroViolation, PartialFloatViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongNumberTokenVisitor, ) @pytest.mark.parametrize('primitive', [ '10.', '.05', '.0', ... | [PartialFloatViolation]) | 37 | 4 |
wemake-services/wemake-python-styleguide | train | 418 | 58b96219a39390c35353aa9a29d483d5ed3f1cf7 | train | tests/test_visitors/test_tokenize/test_primitives/test_numbers/test_underscored_numbers.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_numbers/test_underscored_numbers.py | 33 | 4 | assert_* | test_underscored_number | import pytest
from wemake_python_styleguide.violations.consistency import (
UnderscoredNumberViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongNumberTokenVisitor,
)
@pytest.mark.parametrize('primitive', [
'333_555',
'3_3.3',
'+1_000_000',
'-5_000',
'-1_... | [UnderscoredNumberViolation]) | modified | 8c962450bd508e5531bea824de29f121c230911e15db7f94e2c2828e484cdc6f | assert_*|test_underscored_number|import pytest from wemake_python_styleguide.violations.consistency import ( UnderscoredNumberViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongNumberTokenVisitor, ) @pytest.mark.parametrize('primitive', [ '333_555', '3_3.3', '+1_000_000', '-5_000', '-... | [UnderscoredNumberViolation]) | 35 | 4 |
wemake-services/wemake-python-styleguide | train | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | train | tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_hash_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_hash_elements.py | 120 | 4 | assert_* | test_collection_with_pure_duplicate | import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInHashViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
nested_set_template = """
{{
*{{
{0},
{1},
}},
}}... | [NonUniqueItemsInHashViolation]) | modified | 52691c0eb1a8ab024f53051767339f48142617256e14028f145ce3ecd80c1d79 | assert_*|test_collection_with_pure_duplicate|import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInHashViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' nested_set_template = """ {{ *{{ {0}, ... | [NonUniqueItemsInHashViolation]) | 120 | 4 |
wemake-services/wemake-python-styleguide | train | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | train | tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_hash_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_hash_elements.py | 145 | 4 | assert_* | test_set_with_pure_duplicate | import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInHashViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
nested_set_template = """
{{
*{{
{0},
{1},
}},
}}... | [NonUniqueItemsInHashViolation]) | modified | 51fcbc6fffeb9b0bee49f7557eafbd3e69dc42e2067d98253d9162b1eb719d8b | assert_*|test_set_with_pure_duplicate|import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInHashViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' nested_set_template = """ {{ *{{ {0}, {1}, }}... | [NonUniqueItemsInHashViolation]) | 145 | 4 |
wemake-services/wemake-python-styleguide | train | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | train | tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_hash_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_collection_hashes/test_hash_elements.py | 174 | 4 | assert_* | test_set_with_similar_values | import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInHashViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
nested_set_template = """
{{
*{{
{0},
{1},
}},
}}... | [NonUniqueItemsInHashViolation]) | modified | 476ec38596f1c762aac86ef14ac9ac46ec104b6185c24e1a5d0e391091112f84 | assert_*|test_set_with_similar_values|import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInHashViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' nested_set_template = """ {{ *{{ {0}, {1}, }}... | [NonUniqueItemsInHashViolation]) | 174 | 4 |
wemake-services/wemake-python-styleguide | train | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | train | tests/test_visitors/test_ast/test_loops/test_loops/test_lambda_in_loop.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_loops/test_lambda_in_loop.py | 110 | 4 | assert_* | test_lambda_body | import pytest
from wemake_python_styleguide.violations.best_practices import (
LambdaInsideLoopViolation,
)
from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor
# Wrong:
lambda_inside_for_loop = """
def wrapper():
for index in range(10):
print(lambda: index)
"""
nested_lambda_ins... | [LambdaInsideLoopViolation]) | added | b68a47d7369b68454a832bc4f0cf1230b1e31547c617b3738c3722f27a643de5 | assert_*|test_lambda_body|import pytest from wemake_python_styleguide.violations.best_practices import ( LambdaInsideLoopViolation, ) from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor # Wrong: lambda_inside_for_loop = """ def wrapper(): for index in range(10): print(lambda: index) """ nested_lamb... | null | null | null |
wemake-services/wemake-python-styleguide | train | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | 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 | 799e3262fd6a39b3a344154bc77216e45ba1ce3733bc7b929164d78e2f03115f | 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 | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | 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 | 55 | 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... | non_snake_case_name) | modified | 7ca725d0443ca03fa2eb100e16aa4775af82abc14b7db8362075970083588a98 | 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... | non_snake_case_name) | 55 | 4 |
wemake-services/wemake-python-styleguide | train | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | train | tests/test_visitors/test_ast/test_naming/test_module_metadata.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_module_metadata.py | 49 | 4 | assert_* | test_wrong_metadata | import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongModuleMetadataViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
MODULE_METADATA_VARIABLES_BLACKLIST,
WrongModuleMetadataVisitor,
)
module_metadata = """
{0} = 'Nikita'
"""
module_type_metadata = """
... | [WrongModuleMetadataViolation]) | modified | 8d85af9bf3c9a395f590d7a528e36f4b71bd1843da36cafa010ff307309b38cb | assert_*|test_wrong_metadata|import pytest from wemake_python_styleguide.violations.best_practices import ( WrongModuleMetadataViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( MODULE_METADATA_VARIABLES_BLACKLIST, WrongModuleMetadataVisitor, ) module_metadata = """ {0} = 'Nikita' """ module_type_m... | [WrongModuleMetadataViolation]) | 49 | 4 |
wemake-services/wemake-python-styleguide | train | 419 | 716a6047b3ed7debf580d88115b25d2881245e62 | train | tests/test_visitors/test_ast/test_naming/test_module_metadata.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_module_metadata.py | 50 | 4 | assert_* | test_wrong_metadata | import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongModuleMetadataViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
MODULE_METADATA_VARIABLES_BLACKLIST,
WrongModuleMetadataVisitor,
)
module_metadata = """
{0} = 'Nikita'
"""
module_type_metadata = """
... | bad_name) | modified | cd60bc7742bfd4e4a9c94f56d65e5552c0665653e18808133c7da9099ed8496d | assert_*|test_wrong_metadata|import pytest from wemake_python_styleguide.violations.best_practices import ( WrongModuleMetadataViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( MODULE_METADATA_VARIABLES_BLACKLIST, WrongModuleMetadataVisitor, ) module_metadata = """ {0} = 'Nikita' """ module_type_m... | bad_name) | 50 | 4 |
wemake-services/wemake-python-styleguide | train | 420 | 75ea8907d5b2f9a93995852bb3f492b4a125b342 | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 130 | 4 | assert_* | test_complex_annotations | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_template = 'some: {0}'
fun... | [TooComplexAnnotationViolation]) | modified | c61d37359b24bdab425c6bed41a6de52e70d87d8116430998e708f2a9515faf4 | assert_*|test_complex_annotations|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationComplexityVisitor, ) annassign_tem... | [TooComplexAnnotationViolation]) | 129 | 4 |
wemake-services/wemake-python-styleguide | train | 420 | 75ea8907d5b2f9a93995852bb3f492b4a125b342 | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 167 | 4 | assert_* | test_complex_annotations_config | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_template = 'some: {0}'
fun... | [TooComplexAnnotationViolation]) | modified | 32772898366cf5e4bf1a11efb1974fcea858d972a55dc854e274986f28e085f4 | assert_*|test_complex_annotations_config|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationComplexityVisitor, ) annass... | [TooComplexAnnotationViolation]) | 166 | 4 |
wemake-services/wemake-python-styleguide | train | 420 | 75ea8907d5b2f9a93995852bb3f492b4a125b342 | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 168 | 4 | assert_* | test_complex_annotations_config | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_template = 'some: {0}'
fun... | option_values.max_annotation_complexity) | modified | 52bef014dd9b541c0bc556e2fc38d311465b3d170b119fe467eddf88889552ec | assert_*|test_complex_annotations_config|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationComplexityVisitor, ) annass... | option_values.max_annotation_complexity) | 167 | 4 |
wemake-services/wemake-python-styleguide | train | 421 | cf3aef9466168f1a44709fe8fc2f1e460e17ef53 | train | tests/fixtures/external_plugins.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/external_plugins.py | 20 | 0 | assert | from sys import *
import sys
from typing import List, Union, Dict
int = 12
++int
extra_parens = list((node for node in 'abc'))
some_tuple = (1, 2, )
breaking_pycodestyle=3
# commented: str = 'comment'
def camelCase(): ...
'{}'.format(1)
""
'%s' % 'test'
assert | True | modified | 65894cc1c4fe25247947e4c203b981a70b178bb77a25085c935493e167ef34cc | assert||from sys import * import sys from typing import List, Union, Dict int = 12 ++int extra_parens = list((node for node in 'abc')) some_tuple = (1, 2, ) breaking_pycodestyle=3 # commented: str = 'comment' def camelCase(): ... '{}'.format(1) "" '%s' % 'test' assert | True | 21 | 0 | |
wemake-services/wemake-python-styleguide | train | 421 | cf3aef9466168f1a44709fe8fc2f1e460e17ef53 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 295 | 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 | c32bed17768cfd2e47bdd22c12902d4d7b453c752ec6090a06b64c2db5bb70d9 | 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 | 8 | |
wemake-services/wemake-python-styleguide | train | 421 | cf3aef9466168f1a44709fe8fc2f1e460e17ef53 | 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 | 7de78b139399a50fbf737a1487ea5a93c798daed460c02bd473097c5666e25ff | 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) | 295 | 8 | |
wemake-services/wemake-python-styleguide | train | 421 | cf3aef9466168f1a44709fe8fc2f1e460e17ef53 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 305 | 4 | assert | test_codes | """
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_violations) | modified | d04dd82c5e96f70da7e5a38c930603781d2189fc74fa2e938d255c38e3eefdf2 | assert|test_codes|""" 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/a... | len(all_violations) | 304 | 4 |
wemake-services/wemake-python-styleguide | train | 421 | cf3aef9466168f1a44709fe8fc2f1e460e17ef53 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 379 | 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 | e3307872e3481233fdb70ccba7b093c2bd452530b40c6b2c14cb159b02b3fdb6 | 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) | 378 | 4 |
wemake-services/wemake-python-styleguide | train | 421 | cf3aef9466168f1a44709fe8fc2f1e460e17ef53 | train | tests/test_visitors/test_tokenize/test_comments/test_valid_shebang.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_comments/test_valid_shebang.py | 197 | 4 | assert_* | test_exe_posititve | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import ShebangViolation
from wemake_python_styleguide.visitors.tokenize.comments import ShebangVisitor
# Correct
exe001_neg_shouldnt_be_executable = """
if __name__ == '__main__':
print('I am not executable.')
"""
exe... | [ShebangViolation]) | added | 0bc590b2787a0b6189ef72307c5b59187de974a57de262fc8bca6c9ea1bcbf42 | assert_*|test_exe_posititve|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ShebangViolation from wemake_python_styleguide.visitors.tokenize.comments import ShebangVisitor # Correct exe001_neg_shouldnt_be_executable = """ if __name__ == '__main__': print('I am not ex... | null | null | null |
wemake-services/wemake-python-styleguide | train | 422 | fe020a9c352594b7d593f26eb54e3a8a7a2cad4d | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_condition_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_condition_counts.py | 110 | 4 | assert_* | test_module_condition_real_config | import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyConditionsViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ConditionsVisitor,
)
empty_module = ''
assignment = 'some = x > y or None'
condition_with_single_if = """
if 4 > 2 and 3 / 2 == 1.5:
... | [TooManyConditionsViolation]) | added | 5a1a5fe0c08bb352fbebfb22844a42734157ae8b1e576dd83831dd39ee53f802 | assert_*|test_module_condition_real_config|import pytest from wemake_python_styleguide.violations.complexity import ( TooManyConditionsViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( ConditionsVisitor, ) empty_module = '' assignment = 'some = x > y or None' condition_with_single_if = ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | train | tests/fixtures/external_plugins.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/external_plugins.py | 19 | 0 | assert | from sys import *
import sys
from typing import List, Union, Dict
int = 12
++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 | fcb0c2d9afd5dba4f1714a859e997fe379ebf7658ddf6c39af270aad1e38579b | assert||from sys import * import sys from typing import List, Union, Dict int = 12 ++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 | 20 | 0 | |
wemake-services/wemake-python-styleguide | train | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | 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 | 8562511dcdd951e81f6228047540b7654e225cd031b587db3c094fc99ad81c2d | 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 | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | train | tests/test_visitors/test_ast/test_builtins/test_strings/test_alphabet_string.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_strings/test_alphabet_string.py | 45 | 4 | assert_* | test_alphabet_as_string_violation | import string
import pytest
from wemake_python_styleguide.violations.best_practices import (
StringConstantRedefinedViolation,
)
from wemake_python_styleguide.violations.consistency import (
FormattedStringViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor
@pytest.mar... | [StringConstantRedefinedViolation]) | added | 885b615d33b62480701a45d9447a3ffde38b3828309410795ee4705ab307266a | assert_*|test_alphabet_as_string_violation|import string import pytest from wemake_python_styleguide.violations.best_practices import ( StringConstantRedefinedViolation, ) from wemake_python_styleguide.violations.consistency import ( FormattedStringViolation, ) from wemake_python_styleguide.visitors.ast.builtins import... | null | null | null |
wemake-services/wemake-python-styleguide | train | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | train | tests/test_visitors/test_ast/test_builtins/test_strings/test_formatted_string.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_strings/test_formatted_string.py | 55 | 4 | assert_* | test_wrong_string | import pytest
from wemake_python_styleguide.violations.consistency import (
FormattedStringViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor
regular_string = "'some value'"
binary_string = "b'binary'"
unicode_string = "u'unicode'"
string_variable = "some = '123'"
formated_... | [FormattedStringViolation]) | modified | c0e7bd280571873d1fad6372c100597bc18f2512c27fff07af25658c130f84a7 | assert_*|test_wrong_string|import pytest from wemake_python_styleguide.violations.consistency import ( FormattedStringViolation, ) from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor regular_string = "'some value'" binary_string = "b'binary'" unicode_string = "u'unicode'" string_variable = "so... | [FormattedStringViolation]) | 57 | 4 |
wemake-services/wemake-python-styleguide | train | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | 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 | 77 | 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',
)
@pytest.mark.para... | ( FormattedStringViolation, )) | added | 4a358fe55a2320fe31f731b5339a178b1e7082afa32a742ea8a7123b5cfac373 | 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', ) @pytest.mark.parametrize(... | null | null | null |
wemake-services/wemake-python-styleguide | train | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | train | tests/test_visitors/test_ast/test_classes/test_class_attributes/test_slots_syntax.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_class_attributes/test_slots_syntax.py | 90 | 4 | assert_* | test_incorrect_slots | import pytest
from wemake_python_styleguide.violations.oop import WrongSlotsViolation
from wemake_python_styleguide.visitors.ast.classes import WrongSlotsVisitor
class_body_template = """
class ClassWithSlots(object):
__slots__ = {0}
"""
class_body_typed_template = """
class ClassWithSlots(object):
__slots__... | [WrongSlotsViolation]) | modified | be11cc0fd4bd5043dcfef2d1034ac8477f3cc361d121abf6af793115f347d537 | assert_*|test_incorrect_slots|import pytest from wemake_python_styleguide.violations.oop import WrongSlotsViolation from wemake_python_styleguide.visitors.ast.classes import WrongSlotsVisitor class_body_template = """ class ClassWithSlots(object): __slots__ = {0} """ class_body_typed_template = """ class ClassWithSlots... | [WrongSlotsViolation]) | 89 | 4 |
wemake-services/wemake-python-styleguide | train | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | 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 | 35 | 4 | assert_* | test_single_item_container | import pytest
from wemake_python_styleguide.violations.refactoring import (
InCompareWithSingleItemContainerViolation,
WrongInCompareTypeViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
InCompareSanityVisitor,
)
@pytest.mark.parametrize('code', [
'a in {1}',
'a in {1: "a"... | [InCompareWithSingleItemContainerViolation]) | added | f02c1cc2e4f5993bc7f29d7a7c8c33e1e32928187cf50c02374245e49b76530c | assert_*|test_single_item_container|import pytest from wemake_python_styleguide.violations.refactoring import ( InCompareWithSingleItemContainerViolation, WrongInCompareTypeViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( InCompareSanityVisitor, ) @pytest.mark.parametrize('code', [ 'a in {1}', ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 423 | 256de41bebbe53f60cd5ce87cb4031f120eb9615 | train | tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_string.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_string.py | 161 | 4 | assert_* | test_string_overuse | import pytest
from wemake_python_styleguide.violations.complexity import (
OverusedStringViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.overuses import (
StringOveruseVisitor,
)
string_actions = """
first = {0}
second({0})
third[{0}]
'new' + {0}
"""
string_function_type_annotations1 = """... | default_options.max_string_usages) | added | ce62496fe05ae8f2cac9634218a5dbc254030bae5269af0a317ab376ce8036c1 | assert_*|test_string_overuse|import pytest from wemake_python_styleguide.violations.complexity import ( OverusedStringViolation, ) from wemake_python_styleguide.visitors.ast.complexity.overuses import ( StringOveruseVisitor, ) string_actions = """ first = {0} second({0}) third[{0}] 'new' + {0} """ string_function_type_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 424 | 475a16600acd54c3e087acf07ff65767831cf46b | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 137 | 4 | assert_* | test_complex_annotations | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_template = 'some: {0}'
fun... | [TooComplexAnnotationViolation]) | added | 8d051a8847cfafd65c79c62f626fa7769e9b78f1de67b3a82597be5192281654 | assert_*|test_complex_annotations|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationComplexityVisitor, ) annassign_tem... | null | null | null |
wemake-services/wemake-python-styleguide | train | 424 | 475a16600acd54c3e087acf07ff65767831cf46b | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 174 | 4 | assert_* | test_complex_annotations_config | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_template = 'some: {0}'
fun... | [TooComplexAnnotationViolation]) | added | 474e325843227fec9e98bdc22142b681f1e2811cf84a2edb702024950bfb2bb8 | assert_*|test_complex_annotations_config|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationComplexityVisitor, ) annass... | null | null | null |
wemake-services/wemake-python-styleguide | train | 424 | 475a16600acd54c3e087acf07ff65767831cf46b | train | tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py | 175 | 4 | assert_* | test_complex_annotations_config | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.complexity import (
TooComplexAnnotationViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.annotations import (
AnnotationComplexityVisitor,
)
annassign_template = 'some: {0}'
fun... | option_values.max_annotation_complexity) | added | 090fe1a85b51f42303633064ee95a2f1806de7be366719a6cb848a3070790963 | assert_*|test_complex_annotations_config|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.complexity import ( TooComplexAnnotationViolation, ) from wemake_python_styleguide.visitors.ast.complexity.annotations import ( AnnotationComplexityVisitor, ) annass... | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.