Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerkin committed Feb 12, 2018
1 parent 220a5c7 commit 9e8df51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions sciunit/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ def _properties(self, keys=None, exclude=None):
props = self.raw_props()
exclude = exclude if exclude else []
exclude += ['state','hash','id']
for prop in set(props).difference(exclude).intersection:
if not keys or prop in keys:
for prop in set(props).difference(exclude):
if prop == 'properties':
pass # Avoid infinite recursion
elif not keys or prop in keys:
result[prop] = getattr(self,prop)
return result

Expand Down
3 changes: 2 additions & 1 deletion sciunit/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def judge(self, model, skip_incapable=False, stop_on_error=True,

if isinstance(model,(list,tuple,set)):
# If a collection of models is provided
suite = TestSuite(self.name, self)
from .suites import TestSuite
suite = TestSuite([self], name=self.name)
# then test them using a one-test suite.
return suite.judge(model, skip_incapable=skip_incapable,
stop_on_error=stop_on_error,
Expand Down

0 comments on commit 9e8df51

Please sign in to comment.