Skip to content

Make illegal to set a regular Python class attribute as required #2011

@jjotero

Description

@jjotero

Users should get an error when this is attempted. Otherwise the code below would be legal (and it probably shouldn't!)

@rfm.simple_test
class MyTest(rfm.RunOnlyRegressionTest):
    ...
    my_attr = required

    @run_after('init')
    def my_hook(self):
        print(self.my_attr) # This would print the reframe.core.variables._UndefinedType object.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions