diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-03-12 19:19:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-12 19:19:09 +0100 |
commit | 7dcb3ae9020729e9fb3b53b171567620138d485b (patch) | |
tree | 76fd0c127592c8ea994a10a6b270dd2203ddfdd7 /tests/regrtest_data | |
parent | ae3853648ac012467c0c99e9388ffa008fc014af (diff) | |
download | pylint-git-7dcb3ae9020729e9fb3b53b171567620138d485b.tar.gz |
Add regression test for #5679 (#5725)
Diffstat (limited to 'tests/regrtest_data')
3 files changed, 151 insertions, 0 deletions
diff --git a/tests/regrtest_data/max_inferable_limit_for_classes/main.py b/tests/regrtest_data/max_inferable_limit_for_classes/main.py new file mode 100644 index 000000000..2588d916f --- /dev/null +++ b/tests/regrtest_data/max_inferable_limit_for_classes/main.py @@ -0,0 +1,38 @@ +"""This example is based on sqlalchemy. + +See https://github.com/PyCQA/pylint/issues/5679 +""" +from other_funcs import FromClause + +from .nodes import roles + + +class HasMemoized(object): + ... + + +class Generative(HasMemoized): + ... + + +class ColumnElement( + roles.ColumnArgumentOrKeyRole, + roles.BinaryElementRole, + roles.OrderByRole, + roles.ColumnsClauseRole, + roles.LimitOffsetRole, + roles.DMLColumnRole, + roles.DDLConstraintColumnRole, + roles.StatementRole, + Generative, +): + ... + + +class FunctionElement(ColumnElement, FromClause): + ... + + +class months_between(FunctionElement): + def __init__(self): + super().__init__() diff --git a/tests/regrtest_data/max_inferable_limit_for_classes/nodes/roles.py b/tests/regrtest_data/max_inferable_limit_for_classes/nodes/roles.py new file mode 100644 index 000000000..2f58f1b50 --- /dev/null +++ b/tests/regrtest_data/max_inferable_limit_for_classes/nodes/roles.py @@ -0,0 +1,82 @@ +class SQLRole(object): + ... + + +class UsesInspection(object): + ... + + +class AllowsLambdaRole(object): + ... + + +class ColumnArgumentRole(SQLRole): + ... + + +class ColumnArgumentOrKeyRole(ColumnArgumentRole): + ... + + +class ColumnListRole(SQLRole): + ... + + +class ColumnsClauseRole(AllowsLambdaRole, UsesInspection, ColumnListRole): + ... + + +class LimitOffsetRole(SQLRole): + ... + + +class ByOfRole(ColumnListRole): + ... + + +class OrderByRole(AllowsLambdaRole, ByOfRole): + ... + + +class StructuralRole(SQLRole): + ... + + +class ExpressionElementRole(SQLRole): + ... + + +class BinaryElementRole(ExpressionElementRole): + ... + + +class JoinTargetRole(AllowsLambdaRole, UsesInspection, StructuralRole): + ... + + +class FromClauseRole(ColumnsClauseRole, JoinTargetRole): + ... + + +class StrictFromClauseRole(FromClauseRole): + ... + + +class AnonymizedFromClauseRole(StrictFromClauseRole): + ... + + +class ReturnsRowsRole(SQLRole): + ... + + +class StatementRole(SQLRole): + ... + + +class DMLColumnRole(SQLRole): + ... + + +class DDLConstraintColumnRole(SQLRole): + ... diff --git a/tests/regrtest_data/max_inferable_limit_for_classes/other_funcs.py b/tests/regrtest_data/max_inferable_limit_for_classes/other_funcs.py new file mode 100644 index 000000000..f737fbf5a --- /dev/null +++ b/tests/regrtest_data/max_inferable_limit_for_classes/other_funcs.py @@ -0,0 +1,31 @@ +from operator import attrgetter + +from .nodes import roles + + +class HasCacheKey(object): + ... + + +class HasMemoized(object): + ... + + +class MemoizedHasCacheKey(HasCacheKey, HasMemoized): + ... + + +class ClauseElement(MemoizedHasCacheKey): + ... + + +class ReturnsRows(roles.ReturnsRowsRole, ClauseElement): + ... + + +class Selectable(ReturnsRows): + ... + + +class FromClause(roles.AnonymizedFromClauseRole, Selectable): + c = property(attrgetter("columns")) |