[Pytest-commit] commit/pytest: RonnyPfannschmidt: finish last mistakes in onchage/cache
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Sat Mar 14 11:27:52 CET 2015
1 new commit in pytest:
https://bitbucket.org/pytest-dev/pytest/commits/552d1d498bf3/
Changeset: 552d1d498bf3
Branch: merge-cache
User: RonnyPfannschmidt
Date: 2015-03-14 10:27:43+00:00
Summary: finish last mistakes in onchage/cache
Affected #: 3 files
diff -r b5727cc6632c148ce6b3ef27f46d980b0f90034f -r 552d1d498bf39e4118f02eb9653bd6fad774c2db _pytest/cache.py
--- a/_pytest/cache.py
+++ b/_pytest/cache.py
@@ -1,7 +1,6 @@
import py
import pytest
import json
-import pkg_resources
from os.path import sep as _sep, altsep as _altsep
@@ -63,7 +62,7 @@
like e. g. lists of dictionaries.
"""
path = self._getvaluepath(key)
- path.dirpath().ensure(dir=1)
+ path.dirpath().ensure_dir()
with path.open("w") as f:
self.trace("cache-write %s: %r" % (key, value,))
json.dump(value, f, indent=2, sort_keys=True)
@@ -184,7 +183,7 @@
basedir = config.cache._cachedir
vdir = basedir.join("v")
tw.sep("-", "cache values")
- for valpath in vdir.visit(lambda x: x.check(file=1)):
+ for valpath in vdir.visit(lambda x: x.isfile()):
key = valpath.relto(vdir).replace(valpath.sep, "/")
val = config.cache.get(key, dummy)
if val is dummy:
@@ -198,12 +197,13 @@
tw.line(" " + line)
ddir = basedir.join("d")
- if ddir.check(dir=1) and ddir.listdir():
+ if ddir.isdir() and ddir.listdir():
tw.sep("-", "cache directories")
for p in basedir.join("d").visit():
#if p.check(dir=1):
# print("%s/" % p.relto(basedir))
- if p.check(file=1):
+ if p.isfile():
key = p.relto(basedir)
tw.line("%s is a file of length %d" % (
key, p.size()))
+ return 0
diff -r b5727cc6632c148ce6b3ef27f46d980b0f90034f -r 552d1d498bf39e4118f02eb9653bd6fad774c2db _pytest/config.py
--- a/_pytest/config.py
+++ b/_pytest/config.py
@@ -51,7 +51,7 @@
default_plugins = (
"mark main terminal runner python pdb unittest capture skipping "
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion genscript "
- "junitxml resultlog doctest cache").split()
+ "junitxml resultlog doctest cache onchange").split()
def _preloadplugins():
assert not _preinit
diff -r b5727cc6632c148ce6b3ef27f46d980b0f90034f -r 552d1d498bf39e4118f02eb9653bd6fad774c2db _pytest/onchange.py
--- a/_pytest/onchange.py
+++ b/_pytest/onchange.py
@@ -1,5 +1,6 @@
import py
import subprocess
+import pkg_resources
SCRIPT = """
import pytest
Repository URL: https://bitbucket.org/pytest-dev/pytest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list