interTwin-eu / itwinai

Advanced AI workflows for digital twins applications in science.
https://itwinai.readthedocs.io
MIT License
15 stars 5 forks source link

Change the temporary directory for pytest to use the tempfile library #212

Closed jarlsondre closed 2 months ago

jarlsondre commented 2 months ago

Currently, when running the tests using make test-jsc on the JSC, a folder called /tmp/pytest/ is created. This is problematic as whoever creates it is considered the owner. Anyone else would therefore not have permission to use this folder, meaning that if someone else tries to run the tests on the JSC, they would reach an error as the tests attempt to modify this directory.

This can easily be fixed by using the Python tempfile library, a built-in library that allows you to create temporary files that will be removed after use. This way, there will no longer be any permission problems.