Commit f8aa406d authored by Dmitry Blinov's avatar Dmitry Blinov

work around setUpModule vs setUpClass timing issues

parent af65375c
......@@ -39,6 +39,9 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
bases = SlapOSInstanceTestCase.__bases__
bases[0]._instance_parameter_dict = {}
class TestProviewR(SlapOSInstanceTestCase):
def setUp(self):
......
  • This is for errors like this when building software fail ?

    INFO Finished software releases.
    ERROR:slapos.testing.testcase:Error during request destruction
    Traceback (most recent call last):
      File "parts/slapos.core-repository/slapos/testing/testcase.py", line 615, in _cleanup
        cls.requestDefaultInstance(state='destroyed')
      File "parts/slapos.core-repository/slapos/testing/testcase.py", line 680, in requestDefaultInstance
        cls._instance_parameter_dict)
    AttributeError: type object 'SlapOSInstanceTestCase for ...' has no attribute '_instance_parameter_dict'

    this is probably something we can fix in slapos/testing/testcase

  • I did something for this in nexedi/slapos.core!202 (merged)

  • Sorry, missed your comment.
    @jerome, yes.
    There was a fundamental flaw in the design of this part of testing.testcase.
    Basically, SetUpModule is always called before SetUpClass, so _instance_parameter_dict = {} which is in SetUpClass can never be done at SetUpModule time.
    Design-wise SetUpModule can never be dependent on what SetUpclass is doing.

    Edited by Dmitry Blinov
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment