summaryrefslogtreecommitdiff
path: root/testing/test_cacheprovider.py
diff options
context:
space:
mode:
authoravirlrma <aviral1701@gmail.com>2018-06-21 17:43:10 +0530
committeravirlrma <aviral1701@gmail.com>2018-06-21 17:43:10 +0530
commitc672bfa32ea9e3602225eb45b0ffdc4cdb1ce47a (patch)
tree1734e1e7cbccdb6049d8079e3e12669c84e39806 /testing/test_cacheprovider.py
parent8f1d8ac970efb1fb5c00af4a0c5575922577afda (diff)
downloadpytest-c672bfa32ea9e3602225eb45b0ffdc4cdb1ce47a.tar.gz
added changelog entry
moved cache readme tests to test_cacheprovider.py
Diffstat (limited to 'testing/test_cacheprovider.py')
-rw-r--r--testing/test_cacheprovider.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py
index 33d1dd844..4a7c25aa0 100644
--- a/testing/test_cacheprovider.py
+++ b/testing/test_cacheprovider.py
@@ -6,7 +6,7 @@ import pytest
import os
import shutil
-pytest_plugins = "pytester",
+pytest_plugins = ("pytester",)
class TestNewAPI(object):
@@ -818,3 +818,31 @@ class TestNewFirst(object):
"*test_1/test_1.py::test_1[2*",
]
)
+
+
+class TestReadme(object):
+
+ def check_readme(self, testdir):
+ config = testdir.parseconfigure()
+ readme = config.cache._cachedir.join("README.md")
+ return readme.isfile()
+
+ def test_readme_passed(self, testdir):
+ testdir.makepyfile(
+ """
+ def test_always_passes():
+ assert 1
+ """
+ )
+ testdir.runpytest()
+ assert self.check_readme(testdir) is True
+
+ def test_readme_failed(self, testdir):
+ testdir.makepyfile(
+ """
+ def test_always_passes():
+ assert 0
+ """
+ )
+ testdir.runpytest()
+ assert self.check_readme(testdir) is True