Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Fix failing test.
Browse files Browse the repository at this point in the history
MagicMock will say that they have any method, for example "api_method",
however they have no __name__ member so a simple verification that the method
has a __name__ is added.
  • Loading branch information
forslund committed May 29, 2019
1 parent e491506 commit 07f18ac
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mycroft/skills/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,7 @@ def wrapper(message):
attributes = [a for a in dir(self) if a not in excluded]
for attr_name in attributes:
method = getattr(self, attr_name)

if hasattr(method, 'api_method'):
if hasattr(method, 'api_method') and hasattr(method, '__name__'):
doc = method.__doc__ or ''
name = method.__name__
self.public_api[name] = {
Expand Down

0 comments on commit 07f18ac

Please sign in to comment.