Skip to content
This repository was archived by the owner on Nov 11, 2025. It is now read-only.

Conversation

@maxnikulin
Copy link
Contributor

Use "SUBPASS" and "," for passed subtests instead of general "PASSED",
"SUBFAIL" and "u" for failed ones instead of "FAILED".

Use "SUBPASS" and "," for passed subtests instead of general "PASSED",
"SUBFAIL" and "u" for failed ones instead of "FAILED".
@maxnikulin
Copy link
Contributor Author

Let's discuss one more idea. Do you think it is better to report progress and summary in a such way so subtest results could be easily distinguished from complete test items?

============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.3, py-1.5.2, pluggy-0.13.1
rootdir: /home/ptst/pytest-subtests-test
plugins: xdist-1.32.0, forked-1.1.3, subtests-0.3.2.dev4+gd942684
collected 1 item

test_demo.py u,.                                                         [100%]

=================================== FAILURES ===================================
___________________________ test_demo [binary math] ____________________________

subtests = SubTests(ihook=<pluggy.hooks._HookRelay object at 0x7fd3542c3208>, suspend_capture_ctx=<bound method CaptureManager.gl...state='resumed' _in_suspended=False> _capture_fixture=None>>, request=<SubRequest 'subtests' for <Function test_demo>>)

    def test_demo(subtests):
        with subtests.test("binary math"):
>           assert 1 + 1 == 10
E           assert (1 + 1) == 10

test_demo.py:4: AssertionError
=========================== short test summary info ============================
SUBFAIL test_demo.py::test_demo - assert (1 + 1) == 10
========================= 1 failed, 1 passed in 0.03s ==========================

Verbose progress report:

test_demo.py::test_demo 
[gw0] [100%] SUBFAIL test_demo.py::test_demo 
[gw0] [100%] SUBPASS test_demo.py::test_demo 
[gw0] [100%] PASSED test_demo.py::test_demo 

@radkujawa
Copy link

What's with this PR? Could it be merged? It would be nice to simply use it.

@nicoddemus
Copy link
Member

Unfortunately this went under the radar, sorry about that.

I will try to take a look this week.

@nicoddemus nicoddemus merged commit d52f6ad into pytest-dev:main Jan 15, 2022
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Jan 17, 2022
0.6.0 (2022-01-15)
* pytest>=6.0 is now required.
* Added official support for Python 3.10.
* Dropped support for Python 3.5.
* Users no longer need to configure a warnings filter for the internal A private pytest class or function was used pytest warning (openembedded#52).
* Experimental: Use SUBPASS and , for passed subtests instead of general PASSED, SUBFAIL and u for failed ones instead of FAILED (openembedded#30).

References:
pytest-dev/pytest-subtests#52
pytest-dev/pytest-subtests#30

Signed-off-by: Tim Orling <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
halstead pushed a commit to openembedded/meta-openembedded that referenced this pull request Jan 18, 2022
0.6.0 (2022-01-15)
* pytest>=6.0 is now required.
* Added official support for Python 3.10.
* Dropped support for Python 3.5.
* Users no longer need to configure a warnings filter for the internal A private pytest class or function was used pytest warning (#52).
* Experimental: Use SUBPASS and , for passed subtests instead of general PASSED, SUBFAIL and u for failed ones instead of FAILED (#30).

References:
pytest-dev/pytest-subtests#52
pytest-dev/pytest-subtests#30

Signed-off-by: Tim Orling <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]>
sgunin pushed a commit to sgunin/oe-meta-openembedded-contrib that referenced this pull request Mar 17, 2024
0.6.0 (2022-01-15)
* pytest>=6.0 is now required.
* Added official support for Python 3.10.
* Dropped support for Python 3.5.
* Users no longer need to configure a warnings filter for the internal A private pytest class or function was used pytest warning (#52).
* Experimental: Use SUBPASS and , for passed subtests instead of general PASSED, SUBFAIL and u for failed ones instead of FAILED (#30).

References:
pytest-dev/pytest-subtests#52
pytest-dev/pytest-subtests#30

Signed-off-by: Tim Orling <[email protected]>
sgunin pushed a commit to sgunin/oe-meta-openembedded-contrib that referenced this pull request Mar 17, 2024
0.6.0 (2022-01-15)
* pytest>=6.0 is now required.
* Added official support for Python 3.10.
* Dropped support for Python 3.5.
* Users no longer need to configure a warnings filter for the internal A private pytest class or function was used pytest warning (#52).
* Experimental: Use SUBPASS and , for passed subtests instead of general PASSED, SUBFAIL and u for failed ones instead of FAILED (#30).

References:
pytest-dev/pytest-subtests#52
pytest-dev/pytest-subtests#30

Signed-off-by: Tim Orling <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants