reframe-hpc / reframe

A powerful Python framework for writing and running portable regression tests and benchmarks for HPC systems.
https://reframe-hpc.readthedocs.org
BSD 3-Clause "New" or "Revised" License
214 stars 102 forks source link

Allow setting a variable of an existing fixture in a subclass #3073

Open vkarak opened 9 months ago

vkarak commented 9 months ago

Currently, this is not possible. The subclass must redefine the fixture and set the variable in its argument. Also, setting the variable in the fixture proxy object prior the setup phase does not work either. It'd be nice to be able to do the following:

class BaseFixture(...):
    x = variable(int)

class MyBaseTest(...):
    fixt = fixture(BaseFixture, ...)

class MyTest(MyBaseTest):
    # Ideally
    fixt.x = 10

    # Or this
    @run_after('init')
    def set_x(self):
        self.fixt.x = 10