File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1318,3 +1318,17 @@ def test_dummy():
13181318 # with stacklevel=2 the warning originates from resultlog.pytest_configure
13191319 # and is thrown when --result-log is used
13201320 result .stdout .fnmatch_lines (["*resultlog.py:35*" , "*--result-log is deprecated*" ])
1321+
1322+
1323+ def test_issue4445_cacheprovider_set (testdir ):
1324+ """#4445: Make sure the warning points to a reasonable location
1325+ See origin of _issue_warning_captured at: _pytest.cacheprovider.py:59
1326+ """
1327+ testdir .tmpdir .join (".pytest_cache" ).write ("something wrong" )
1328+ result = testdir .runpytest ()
1329+ # with stacklevel=3 the warning originates from one stacklevel above
1330+ # _issue_warning_captured in cacheprovider.Cache.set and is thrown
1331+ # when there are errors during cache folder creation
1332+ result .stdout .fnmatch_lines (
1333+ ["*cacheprovider.py:120*" , "*could not create cache path*" ]
1334+ )
You can’t perform that action at this time.
0 commit comments