Code Duplication    Length = 20-20 lines in 2 locations

tests/test_compat.py 2 locations

@@ 207-226 (lines=20) @@
204
    assert D().footer() == 4
205
206
207
def test_abstractstaticmethod_namespaced(abc, namespace):
208
    """Test interaction between namespaces and abstract staticmethods."""
209
    class C(metaclass=abc.NamespaceableABCMeta):
210
        """A throwaway test class."""
211
        with namespace() as ns:
212
            @staticmethod
213
            @abstractmethod
214
            def footer():
215
                return 3
216
    with pytest.raises(TypeError):
217
        print(C())
218
219
    class D(C):
220
        """A throwaway test class."""
221
        with namespace() as ns:
222
            @staticmethod
223
            def footer():
224
                return 4
225
    assert D.ns.footer() == 4
226
    assert D().ns.footer() == 4
227
228
229
def test_abstractmethod_integration(abc):
@@ 151-170 (lines=20) @@
148
    assert D().footer() == 'D'
149
150
151
def test_abstractclassmethod_namespaced(abc, namespace):
152
    """Test interaction between namespaces and abstract classmethods."""
153
    class C(metaclass=abc.NamespaceableABCMeta):
154
        """A throwaway test class."""
155
        with namespace() as ns:
156
            @classmethod
157
            @abstractmethod
158
            def footer(cls):
159
                return cls.__name__
160
    with pytest.raises(TypeError):
161
        print(C())
162
163
    class D(C):
164
        """A throwaway test class."""
165
        with namespace() as ns:
166
            @classmethod
167
            def footer(cls):
168
                return super().ns.footer()
169
    assert D.ns.footer() == 'D'
170
    assert D().ns.footer() == 'D'
171
172
173
def test_abstractstaticmethod_basics(abc):