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

Explicit hint to subtests in progress and summary #30

Merged

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 <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
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 <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
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 <tim.orling@konsulko.com>
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 <tim.orling@konsulko.com>
daregit pushed a commit to daregit/yocto-combined that referenced this pull request May 22, 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 <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
daregit pushed a commit to daregit/yocto-combined that referenced this pull request May 22, 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 <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants