[ 
https://issues.apache.org/jira/browse/DISPATCH-2186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17370589#comment-17370589
 ] 

ASF GitHub Bot commented on DISPATCH-2186:
------------------------------------------

jiridanek edited a comment on pull request #1276:
URL: https://github.com/apache/qpid-dispatch/pull/1276#issuecomment-869685993


   > So, this change is to suppress test collection on those classes so that 
the following warning does not show up ?
   
   Exactly. And the test collection should be suppressed, because these classes 
contain no unittests methods of their own. They get originally collected just 
by accident, due to their name.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> 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