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

Integration with pytest-subtests #205

Open
C0DK opened this issue Aug 10, 2020 · 4 comments
Open

Integration with pytest-subtests #205

C0DK opened this issue Aug 10, 2020 · 4 comments
Labels
3rd-party Third party plugin incompatibility

Comments

@C0DK
Copy link

C0DK commented Aug 10, 2020

When using pytest-subtests and pytest-sugar, the actual subtest name is not reported in the results.

example:

import unittest


class T(unittest.TestCase):
    def test_foo(self):
        for i in range(5):
            with self.subTest("custom message", i=i):
                self.assertEqual(i % 2, 0)


if __name__ == "__main__":
    unittest.main()

output

Test session starts (platform: linux, Python 3.8.3, pytest 5.4.3, pytest-sugar 0.9.4)
rootdir: /home/cdk/dev/expecthon
plugins: django-3.9.0, sugar-0.9.4, cov-2.10.0, black-0.3.10, subtests-0.3.2
 bla.py ⨯✓                                                                              100% ██████████
======================================= short test summary info =======================================
FAILED bla.py::T::test_foo - AssertionError: 1 != 0
FAILED bla.py::T::test_foo - AssertionError: 1 != 0

Results (0.13s):
       1 passed
       2 failed
         - bla.py:5 T.test_foo
         - bla.py:5 T.test_foo

Expected output

Test session starts (platform: linux, Python 3.8.3, pytest 5.4.3, pytest-sugar 0.9.4)
rootdir: /home/cdk/dev/expecthon
plugins: django-3.9.0, sugar-0.9.4, cov-2.10.0, black-0.3.10, subtests-0.3.2
 bla.py ⨯✓                                                                              100% ██████████
======================================= short test summary info =======================================
FAILED bla.py::T::test_foo (custom message, i=1) - AssertionError: 1 != 0
FAILED bla.py::T::test_foo (custom message, i=3) - AssertionError: 1 != 0

Results (0.13s):
       1 passed
       2 failed
         - bla.py:5 T.test_foo
           - (custom message, i=1)
           - (custom message, i=3)
@Teemu
Copy link
Owner

Teemu commented Aug 25, 2020

Maybe you could try --old-summary as a fallback

@Teemu Teemu added the 3rd-party Third party plugin incompatibility label Aug 25, 2020
@C0DK
Copy link
Author

C0DK commented Oct 21, 2020

Can i do something regarding the PR? @Teemu

@Teemu
Copy link
Owner

Teemu commented Oct 21, 2020

I just need to do general maintenance on this project first

@C0DK
Copy link
Author

C0DK commented Oct 21, 2020

Alright. Say the word if you need help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd-party Third party plugin incompatibility
Projects
None yet
Development

No branches or pull requests

2 participants