Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Bugfix to allow loading test cases from name#121

Closed
stonier wants to merge 1 commit intoros:indigo-develfrom
stonier:patch-2
Closed

Bugfix to allow loading test cases from name#121
stonier wants to merge 1 commit intoros:indigo-develfrom
stonier:patch-2

Conversation

@stonier
Copy link
Copy Markdown
Contributor

@stonier stonier commented Sep 11, 2016

This fixes the problem identified in PR #104. Alternatively could be done by doing the exception handling for TypeError if you wish to handle the majority case (class object) first.

This fixes the problem identified in PR #104.
@stonier
Copy link
Copy Markdown
Contributor Author

stonier commented Sep 11, 2016

If this is confirmed, I'll spin up a PR for kinetic and also similar changes over in ros_comm/rostest/__init__.py

if issubclass(test, unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromTestCase(test)
else:
if isinstance(test, basestring):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will raise a NameError in Python 3.

@dirk-thomas
Copy link
Copy Markdown
Member

Thank you for the pull request. I did't notice that the slight change to the logic had that negative side effect. The fix in general looks good beside the comments I added inline.

@dirk-thomas
Copy link
Copy Markdown
Member

I created #123 with a much smaller patch. Therefore I will close this as a duplicate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants