Skip to content

Tests write files to disk #153

Open
Open
@pdiercks

Description

@pdiercks

I noticed that some of the tests or at least test_thermo_mechanical_cube
write xdmf files to disk for no apparent reason.

If there is a reason, but the files are not compared to some reference data afterwards, I would suggest that these could simply be temporary files. Something like

import tempfile
import pathlib

tf = tempfile.NamedTemporaryFile(suffix=".xmdf")
pv_name = pathlib.Path(tf.name).stem  # it seems class below does not want suffix?

# ... lots of code ...

problem_elastic = LinearElasticity(experiment, parameters, pv_name=f"{pv_name}_{dim}", pv_path="")
problem_elastic.solve()
problem_elastic.pv_plot()

tf.close()  # temporary file is deleted when closed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions