Code Duplication    Length = 12-15 lines in 2 locations

test/test_namespaces.py 2 locations

@@ 394-408 (lines=15) @@
391
    assert Test.ns.var2 == 1
392
393
394
def test_multiple_inheritance(namespaces):
395
    class Test1(namespaces.Namespaceable):
396
        with namespaces.Namespace() as ns:
397
            with namespaces.Namespace() as ns:
398
                var = 1
399
400
    class Test2(namespaces.Namespaceable):
401
        with namespaces.Namespace() as ns:
402
            var = 2
403
404
    class Test3(Test2, Test1):
405
        pass
406
407
    assert Test3.ns.ns.var == 1
408
    assert Test3.ns.var == 2
409
@@ 319-330 (lines=12) @@
316
    assert Test.ns.d.name == 'd'
317
318
319
def test_basic_meta(namespaces):
320
    class Meta(namespaces.Namespaceable, type(namespaces.Namespaceable)):
321
        with namespaces.Namespace() as ns:
322
            meta_var = 1
323
324
    class Test(namespaces.Namespaceable, metaclass=Meta):
325
        pass
326
327
    assert Meta.ns.meta_var == 1
328
    assert Test.ns.meta_var == 1
329
    with pytest.raises(AttributeError):
330
        Test().ns.meta_var
331
332
333
def test_somewhat_weirder_meta(namespaces):