Skip to content

Attributes of fields defined at the class level should not be shared between instances #325

Closed
@ylep

Description

@ylep

I am having trouble with the Capsul tests for highres-cortex:

  • when I test each process or pipeline separately all works as expected

    python -m highres_cortex.test.test_capsul SphereTestCase.test_laplacian
    python -m highres_cortex.test.test_capsul SphereTestCase.test_equivolumetric_pipeline
    ...
    
  • but, whenever I run the whole test suite, I get random failures

    python -m highres_cortex.test.test_capsul SphereTestCase
    

The problem is that when I call highres_cortex.capsul.processes.Laplacian after is has been run as part of a pipeline, its fields retain the generate_temporary attribute!

I am using class-level attributes and not instance attributes, because I thought that it was more in line with the philosophy behind traits / pydantic typing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions