diff --git a/_pytest/cacheprovider.py b/_pytest/cacheprovider.py index 11023dc7c..5f7b476db 100755 --- a/_pytest/cacheprovider.py +++ b/_pytest/cacheprovider.py @@ -11,7 +11,7 @@ import json from os.path import sep as _sep, altsep as _altsep -class Cache: +class Cache(object): def __init__(self, config): self.config = config self._cachedir = config.rootdir.join(".cache") @@ -152,7 +152,7 @@ def pytest_addoption(parser): "This may re-order tests and thus lead to " "repeated fixture setup/teardown") group.addoption( - '--cache', action='store_true', dest="showcache", + '--show-cache', action='store_true', dest="showcache", help="show cache contents, don't perform collection or tests") group.addoption( '--clearcache', action='store_true', dest="clearcache", diff --git a/testing/test_cache.py b/testing/test_cache.py index 142d676a8..c4c2c3e78 100755 --- a/testing/test_cache.py +++ b/testing/test_cache.py @@ -67,7 +67,7 @@ def test_cache_reportheader(testdir): ]) def test_cache_show(testdir): - result = testdir.runpytest("--cache") + result = testdir.runpytest("--show-cache") assert result.ret == 0 result.stdout.fnmatch_lines([ "*cache is empty*" @@ -82,7 +82,7 @@ def test_cache_show(testdir): """) result = testdir.runpytest() assert result.ret == 0 - result = testdir.runpytest("--cache") + result = testdir.runpytest("--show-cache") result.stdout.fnmatch_lines_random([ "*cachedir:*", "-*cache values*-",