diff --git a/news/2 Fixes/16962.md b/news/2 Fixes/16962.md new file mode 100644 index 000000000000..40271ed918c8 --- /dev/null +++ b/news/2 Fixes/16962.md @@ -0,0 +1 @@ +Ensure 2.7 unittest still work with new test support. diff --git a/news/2 Fixes/16963.md b/news/2 Fixes/16963.md new file mode 100644 index 000000000000..a02735ae72d2 --- /dev/null +++ b/news/2 Fixes/16963.md @@ -0,0 +1 @@ +Fix issue with parsing test run ids for reporting test status. diff --git a/src/client/testing/testController/common/testItemUtilities.ts b/src/client/testing/testController/common/testItemUtilities.ts index ea26c872160c..dca65d6267ac 100644 --- a/src/client/testing/testController/common/testItemUtilities.ts +++ b/src/client/testing/testController/common/testItemUtilities.ts @@ -90,10 +90,10 @@ function getRangeFromRawSource(raw: { source: string }): Range | undefined { function getRunIdFromRawData(raw: { id: string }): string { // This is the id that will be used to compare with the results. const runId = raw.id + .replace(/\.py/g, '') .replace(/[\\\:\/]/g, '.') .replace(/\:\:/g, '.') - .replace(/\.\./g, '.') - .replace(/\.py/g, ''); + .replace(/\.\./g, '.'); return runId.startsWith('.') ? runId.substr(1) : runId; } diff --git a/src/client/testing/testController/unittest/unittestController.ts b/src/client/testing/testController/unittest/unittestController.ts index dc676b1e0f54..f0baf6f0cf6c 100644 --- a/src/client/testing/testController/unittest/unittestController.ts +++ b/src/client/testing/testController/unittest/unittestController.ts @@ -127,7 +127,8 @@ def generate_test_cases(suite): if isinstance(test, unittest.TestCase): yield test else: - yield from generate_test_cases(test) + for test_case in generate_test_cases(test): + yield test_case loader = unittest.TestLoader() suite = loader.discover("${startDir}", pattern="${pattern}")