Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to change the location of pytest's .cache directory?

Tags:

I need to be able to change the location of pytest's .cache directory to the env variable, WORKSPACE. Due to server permissions out of my control, I am running into this error because my user does not have permission to write in the directory where the tests are being run from:

py.error.EACCES: [Permission denied]: open('/path/to/restricted/directory/tests/.cache/v/cache/lastfailed', 'w') 

Is there a way to set the path of the .cache directory to the environment variable WORKSPACE?

like image 639
nonbot Avatar asked Oct 23 '15 20:10

nonbot


People also ask

Where is cache directory located?

Cache files are stored in C:/Documents and Settings/<UserName>/Local Settings/Temporary Internet Files. You can also discover the person's cookies in a similar location, C:/Documents and Settings/<User Name>/Cookies.

Where does Pytest INI go?

Users can customize some pytest behavior using a configuration file called pytest. ini . This file is usually placed at the root of the repository and contains a number of configuration values that are applied to all test runs for that project.


1 Answers

You can prevent the creation of .cache/ by disabling the "cacheprovider" plugin:

py.test -p no:cacheprovider ... 
like image 157
vog Avatar answered Sep 28 '22 03:09

vog