diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index b1904fbb1..5d9b58a65 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -18,6 +18,7 @@ from os.path import sep as _sep, altsep as _altsep class Cache(object): + def __init__(self, config): self.config = config self._cachedir = Cache.cache_dir_from_config(config) @@ -108,7 +109,7 @@ class Cache(object): content_readme = """# pytest cache directory # This directory contains data from the pytest's cache plugin, \ -which provides the `--lf` and `--ff` options, as well as the `cache` fixture. +which provides the `--lf` and `--ff` options, as well as the `cache` fixture. **Do not** commit this to version control. @@ -214,7 +215,9 @@ class NFPlugin(object): items[:] = self._get_increasing_order( six.itervalues(new_items) - ) + self._get_increasing_order(six.itervalues(other_items)) + ) + self._get_increasing_order( + six.itervalues(other_items) + ) self.cached_nodeids = [x.nodeid for x in items if isinstance(x, pytest.Item)] def _get_increasing_order(self, items): diff --git a/testing/test_cacheREADME.py b/testing/test_cacheREADME.py index fe8879bd2..3e5673609 100644 --- a/testing/test_cacheREADME.py +++ b/testing/test_cacheREADME.py @@ -1,15 +1,11 @@ from __future__ import absolute_import, division, print_function -import sys -import py import _pytest -import pytest -import os -import shutil pytest_plugins = ("pytester",) class Helper(object): + def check_readme(self, testdir): config = testdir.parseconfigure() readme = config.cache._cachedir.join("README.md") @@ -17,6 +13,7 @@ class Helper(object): class TestReadme(Helper): + def test_readme_passed(self, testdir): testdir.tmpdir.join("test_a.py").write( _pytest._code.Source( @@ -26,8 +23,8 @@ class TestReadme(Helper): """ ) ) - result = testdir.runpytest() - assert self.check_readme(testdir) == True + testdir.runpytest() + assert self.check_readme(testdir) is True def test_readme_failed(self, testdir): testdir.tmpdir.join("test_a.py").write( @@ -38,5 +35,5 @@ class TestReadme(Helper): """ ) ) - result = testdir.runpytest() - assert self.check_readme(testdir) == True + testdir.runpytest() + assert self.check_readme(testdir) is True