Closed AlthausKonstantin closed 8 months ago
You can look at end of work_item.py and see how work item types are generated with meta classes.
Okay, I will write a full-fledged TestRun
to replace the MWE above.
I did https://github.com/RedHatQE/pylero/pull/169 in the assumption that import of TestCase will succeed if that exists in the server. If only _WorkItem is imported it'll fail when we use TestCase methods explicitly
Okay, thanks for clarifying. My goal is to make all the code in test_run.py
work, even if the TestCase work item does not exist on the server.
even if the TestCase work item does not exist on the server.
- that was more than a bit involved for me 😅, by all means pls go ahead if you want to give it a try and thanks a lot for all your contributions!
Dear all,
I am sorry, but I have to reopen the problems already discussed at length in https://github.com/RedHatQE/pylero/pull/132, https://github.com/RedHatQE/pylero/issues/134, https://github.com/RedHatQE/pylero/pull/169.
Problem
Currently, in
test_run.py
we conditionally import the work itemTestCase
. If this work item does not exist, we just ignore that:This leads to problems because
TestCase
is still used in the subsequent code. E.g.:Question
I could not comprehend why the
TestCase
work item must be used instead of the generic_WorkItem
class (cf. https://github.com/RedHatQE/pylero/pull/169). Can someone elaborate on that?Proposal
If the
TestCase
class really must be used, I propose to conditionally create aTestCase
class intest_run.py
if this work item type does not exist. Something like this (in the following there are still missing the things that make theTestCase
class indispensable):What do you think about this?