diff --git a/changelog/4272.trivial.rst b/changelog/4272.trivial.rst new file mode 100644 index 000000000..4709f141d --- /dev/null +++ b/changelog/4272.trivial.rst @@ -0,0 +1 @@ +Display cachedir also in non-verbose mode if non-default. diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 8e7f7a804..a78d857f6 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -319,7 +319,8 @@ def cache(request): def pytest_report_header(config): - if config.option.verbose: + """Display cachedir with --cache-show and if non-default.""" + if config.option.verbose or config.getini("cache_dir") != ".pytest_cache": cachedir = config.cache._cachedir # TODO: evaluate generating upward relative paths # starting with .., ../.. if sensible