[ 
https://issues.apache.org/jira/browse/DISPATCH-2186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiri Daněk updated DISPATCH-2186:
---------------------------------
    Status: Reviewable  (was: In Progress)

> Pytest runner reports test collection warnings which proved to be misleading 
> to the unwarry
> -------------------------------------------------------------------------------------------
>
>                 Key: DISPATCH-2186
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-2186
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Tests
>    Affects Versions: 1.16.0
>            Reporter: Jiri Daněk
>            Assignee: Jiri Daněk
>            Priority: Major
>             Fix For: 1.17.0
>
>
> The affected classes are
> * TestTimeout
> The issue was discussed between me ([~jdanek]) and [~fgiorget] on the 
> original DISPATCH-1933 where we decided it should be eventually fixed, 
> somehow.
> {noformat}
>  39: =============================== warnings summary 
> ===============================
> 39: ../../tests/system_test.py:1259
> 39:   
> /home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/tests/system_test.py:1259:
>  PytestCollectionWarning: cannot collect test class 'TestTimeout' because it 
> has a __init__ constructor (from: )
> 39:     class TestTimeout(object):
> 39: 
> 39: -- Docs: https://docs.pytest.org/en/stable/warnings.html
> 39: - generated xml file: 
> /home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/build/tests/junitxmls/system_tests_multi_tenancy_policy.xml
>  -
> 39: ======================== 36 passed, 1 warning in 14.84s 
> ========================
> 22/38 Test #39: system_tests_multi_tenancy_policy .......   Passed   15.09 sec
> {noformat}
> The problem is that Pytest's test discovery looks for test classes by name 
> (in addition to lookup by superclass, the way Python unittest lib works). 
> When Pytest finds a class that matches name pattern, it will try to collect 
> it, but that will fail in cases the class is a test helper which has an 
> __init__ method.
> One solution would be to rename the affected classes. Or modify Pytests test 
> discovery logic (it is configurable) or to suppress the warning.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to