Closed frankenjoe closed 3 years ago
I added a unit test for hide
, but I locally verified that borrow
and resolvers
are also working.
Merging #13 (50b7fba) into master (82dd562) will not change coverage. The diff coverage is
100.0%
.
Impacted Files | Coverage Δ | |
---|---|---|
audobject/core/decorator.py | 100.0% <100.0%> (ø) |
When I execute your code above I get:
/home/audeering.local/hwierstorf/git/audeering/audobject/audobject/core/object.py:292: RuntimeWarning: Could not determine a version for module '__main__'.
RuntimeWarning,
$__main__.Child: {}
Did you just suppress the warning in your example, because it's not relevant?
I just double checked what happens if parent shouldn't be hidden and it works as well:
class Parent(audobject.Object):
def __init__(
self,
parent: bool = False,
):
self.parent = parent
class Child(Parent):
@audobject.init_decorator(
hide=[
'child',
],
)
def __init__(
self,
child: bool = False,
parent: bool = False,
):
super().__init__(parent=parent)
self.child = child
c = Child()
print(c.to_yaml_s())
$__main__.Child:
parent: false
Did you just suppress the warning in your example, because it's not relevant?
you can suppress it by adding:
__version__ = '1.0.0'
I just double checked what happens if parent shouldn't be hidden and it works as well:
Well, that was already working before, which is the reason we only found the bug now :)
Closes https://github.com/audeering/audobject/issues/12
Example