Code Duplication    Length = 20-20 lines in 2 locations

tests/test_compat.py 2 locations

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