testing: Fix search key.

The problem this commit solves is related to how we search for
testcases in the test files. We use a simple 'search_key' in file_data.
This will return a false positive if there is a 'longer_search_key' in
file_data.

While searching for TestCases we should use a longer key to remove the
possibility of collision. Using 'class TestCase(' should be precise
enough.

Fixes #4983
This commit is contained in:
Umair Khan 2017-06-16 11:20:03 +05:00 committed by showell
parent f1b3e943c6
commit bccd2caacb
1 changed files with 1 additions and 1 deletions

View File

@ -236,7 +236,7 @@ if __name__ == "__main__":
classname = suite.rsplit('.', 1)[0]
rewrite_arguments(classname)
elif suite[0].isupper():
rewrite_arguments(suite)
rewrite_arguments('class %s(' % (suite,))
for suite in args:
if suite.startswith('test'):