This repository was archived by the owner on May 31, 2025. It is now read-only.
add ability to load tests using dotnames in rosunit#104
Merged
dirk-thomas merged 1 commit intoindigo-develfrom Mar 1, 2016
Merged
add ability to load tests using dotnames in rosunit#104dirk-thomas merged 1 commit intoindigo-develfrom
dirk-thomas merged 1 commit intoindigo-develfrom
Conversation
dirk-thomas
added a commit
that referenced
this pull request
Mar 1, 2016
add ability to load tests using dotnames in rosunit
Member
Author
|
Cherry picked to jade-devel: 7b8a64d |
| if issubclass(test, unittest.TestCase): | ||
| suite = unittest.TestLoader().loadTestsFromTestCase(test) | ||
| else: | ||
| suite = unittest.TestLoader().loadTestsFromName(test) |
Contributor
There was a problem hiding this comment.
This fails. I guess it broke when simplifying the logic in #101 to create PR #104.
The intention is for a string to pass through the first check into the loadTestsFromName call, but it never gets there since the first method throws a TypeError.
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import unittest
>>> issubclass("foo", unittest.TestCase)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: issubclass() arg 1 must be a class
>>>
Not a very intuitive function that. If it's not going to return False, it's going to be a good source of bugs like this.
Member
Author
There was a problem hiding this comment.
Thank you for reporting this and providing a PR (#121).
Contributor
|
Thanks @dirk-thomas. Had Korean thanksgiving get in the way and just got back only to find it already done. |
Member
Author
|
No problem. I just wanted to release a new version so went ahead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #101.
Simplify the selection logic and cleanup new Python code.