otp.TmpFile#
- class TmpFile(suffix='', name='', clean_up=default, force=False)#
Bases:
onetick.py.utils.temp.File,os.PathLike,onetick.py.utils.temp.CleanUpFinalizerClass to create a temporary file. By default, this file will be deleted automatically after all references to it are gone. Base path where temporary files are created could be set using the
ONE_TICK_TMP_DIR. By default they are created under thetempfile.gettempdir()folder.- Parameters
name (str) – name of the temporary file without suffix. By default some random name will be generated.
suffix (str) – suffix of the name of the temporary file.
clean_up (bool) –
Controls whether this temporary file will be deleted automatically after all references to it are gone.
By default,
otp.config.clean_up_tmp_filesis used.force (bool) – Rewrite temporary file if it exists and parameter
nameis set.
See also
The testing framework has a
--keep-generatedflag that controls clean up for all related instances Plugin features