Cache not respecting cache_dir config option #3260
Comments
I take it :) |
Cool @feuillemorte, thanks! (In the future feel free to assign yourself to the issues if you want |
reproduced only with option "-c setup.cfg" |
Seems that problem is in setup.cfg file:
The problem is here: Lines 1326 to 1349 in 44fa5a7 Code goes in the first "if" and not calls getcfg function (which parses [tool:pytest] section) because inifilename defined by "-c" option:
prints me
@nicoddemus is it a bug or smth was changed from 3.3.0 version? |
@feuillemorte thanks for the investigation! Now I see that this is actually a duplicate of #1831. I think we should change that line to section = 'tool:pytest' if inifile.ext == '.cfg' else 'pytest'
try:
inicfg = iniconfig[section]
except KeyError:
inicfg = None |
But section might be [tool:pytest] or [pytest] in .cfg file, isn't it? |
Oh you are right, so we need to have a list of possible sections then, and check each one. |
The current docs on this are unclear or pointing towards it being |
@dbeckwith you are right, just to be clear:
EDIT: the bug here is that |
Okay, and the I guess the issue I was running into was that specifying the file with |
Exactly. If you don't pass |
I'm trying to direct all test and coverage output to a single
.cache
directory in my project, but pytest won't respect thecache_dir
option I'm setting to.cache/pytest
and keeps creating.pytest_cache
instead. This used to work fine in another project withpytest 3.3.0
.The text was updated successfully, but these errors were encountered: