File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -527,6 +527,22 @@ def method2(self):
527
527
assert C ().has_default () == 3
528
528
529
529
530
+ def test_override_default ():
531
+
532
+ class IFace (Interface ): # pragma: nocover
533
+
534
+ @default
535
+ def default (self ):
536
+ return 'ayy'
537
+
538
+ class C (implements (IFace )): # pragma: nocover
539
+
540
+ def default (self ):
541
+ return 'lmao'
542
+
543
+ assert C ().default () == 'lmao'
544
+
545
+
530
546
def test_conflicting_defaults ():
531
547
532
548
class IFace1 (Interface ): # pragma: nocover
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ class TypedSignature(object):
21
21
"""
22
22
def __init__ (self , obj ):
23
23
self ._type = type (obj )
24
+ if self ._type is default :
25
+ self ._type = type (obj .implementation )
26
+
24
27
self ._signature = signature (extract_func (obj ))
25
28
26
29
@property
You can’t perform that action at this time.
0 commit comments