<reponame>atollk/flake8-typing-collections<gh_stars>1-10
from tests.util import BaseTest


class Test_TYCO106(BaseTest):
    def error_code(self) -> str:
        return "TYCO106"

    @classmethod
    def flags(cls):
        return ["--tyco_generic_alt"]

    def test_pass_1(self):
        code = """
        import typing
        def foo(x: typing.Collection):
            ...
        """
        result = self.run_flake8(code)
        assert result == []

    def test_fail_1(self):
        code = """
        import collections.abc
        def foo(x: collections.abc.Collection):
            ...
        """
        result = self.run_flake8(code)
        self.assert_error_at(result, "TYCO106", 2, 12)

    def test_fail_2(self):
        code = """
        from collections.abc import Collection
        def foo(x) -> Collection:
            ...
        """
        result = self.run_flake8(code)
        self.assert_error_at(result, "TYCO106", 2, 15)

from tests.util import BaseTest


class Test_TYCO106(BaseTest):
    def error_code(self) -> str:
        return "TYCO106"

    @classmethod
    def flags(cls):
        return ["--tyco_generic_alt"]

    def test_pass_1(self):
        code = """
        import typing
        def foo(x: typing.Collection):
            ...
        """
        result = self.run_flake8(code)
        assert result == []

    def test_fail_1(self):
        code = """
        import collections.abc
        def foo(x: collections.abc.Collection):
            ...
        """
        result = self.run_flake8(code)
        self.assert_error_at(result, "TYCO106", 2, 12)

    def test_fail_2(self):
        code = """
        from collections.abc import Collection
        def foo(x) -> Collection:
            ...
        """
        result = self.run_flake8(code)
        self.assert_error_at(result, "TYCO106", 2, 15)
import typing         def foo(x: typing.Collection):             ... import collections.abc         def foo(x: collections.abc.Collection):             ... from collections.abc import Collection         def foo(x) -> Collection:             ...