Skip to content

Commit

Permalink
add test and rc file
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Nov 28, 2022
1 parent d52669e commit b90b442
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/functional/p/protocol_classes_abstract.py
@@ -1,5 +1,7 @@
"""Test that classes inheriting from protocols should not warn about abstract-method."""

# pylint: disable=too-few-public-methods,disallowed-name,invalid-name

from abc import abstractmethod
from typing import Protocol, Literal

Expand All @@ -14,18 +16,22 @@ def foo(self) -> Literal["foo"]:
def foo_no_abstract(self) -> Literal["foo"]:
"""foo not abstract method"""


class BarProtocol(Protocol):
"""Bar Protocol"""
@abstractmethod
def bar(self) -> Literal["bar"]:
"""bar method"""



class FooBarProtocol(FooProtocol, BarProtocol, Protocol):
"""FooBar Protocol"""


class IndirectProtocol(FooProtocol):
"""Doesn't subclass typing.Protocol directly"""


class FooBar(FooBarProtocol):
"""FooBar object"""

Expand Down
2 changes: 2 additions & 0 deletions tests/functional/p/protocol_classes_abstract.rc
@@ -0,0 +1,2 @@
[testoptions]
min_pyver=3.8

0 comments on commit b90b442

Please sign in to comment.