Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove full path from unittest title on test UI #21461

Closed
eleanorjboyd opened this issue Jun 20, 2023 · 2 comments · Fixed by #21497
Closed

Remove full path from unittest title on test UI #21461

eleanorjboyd opened this issue Jun 20, 2023 · 2 comments · Fixed by #21497
Assignees
Labels
area-testing feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@eleanorjboyd
Copy link
Member

Currently for unittest the full dot path displays for the test explorer UI, for example test_subtests.NumbersTest.test_even(i=0). This is unneeded information as it already sits nested in test_subtests.py / NumbersTest / test_even in the UI tree. Switch so the name for the subtests is only the part in parenthesis.

@eleanorjboyd eleanorjboyd added feature-request Request for new features or functionality area-testing labels Jun 20, 2023
@eleanorjboyd eleanorjboyd self-assigned this Jun 20, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jun 20, 2023
@eleanorjboyd eleanorjboyd added this to the June 2023 milestone Jun 21, 2023
@eleanorjboyd eleanorjboyd added the verification-needed Verification of issue is requested label Jun 27, 2023
@eleanorjboyd
Copy link
Member Author

verification steps:
use unittest subtests, check that the name of the test in the test explorer after running is just a number for subtests of the following test case. So the subtests would be case [0], [1] ....

import unittest


class NumbersTest(unittest.TestCase):
    def test_even(self):
        """
        Test that numbers between 0 and 5 are all even.
        """
        for i in range(0, 5):
            with self.subTest(i=i):
                self.assertEqual(i % 2, 0)

@alexr00
Copy link
Member

alexr00 commented Jun 28, 2023

I think this is right

image

@alexr00 alexr00 added the verified Verification succeeded label Jun 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
2 participants