[py-svn] commit/pytest: 4 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Jun 29 21:59:17 CEST 2011
4 new changesets in pytest:
http://bitbucket.org/hpk42/pytest/changeset/f04325787e45/
changeset: f04325787e45
user: gutworth
date: 2011-06-29 19:16:47
summary: don't try to remove pycs twice
affected #: 1 file (22 bytes)
--- a/_pytest/assertion/rewrite.py Wed Jun 29 10:52:39 2011 -0500
+++ b/_pytest/assertion/rewrite.py Wed Jun 29 12:16:47 2011 -0500
@@ -103,6 +103,7 @@
state.trace("couldn't find pyc: %r" % (pyc,))
else:
state.trace("removed pyc: %r" % (pyc,))
+ del state.pycs[:]
def _write_pyc(co, source_path, pyc):
mtime = int(source_path.mtime())
http://bitbucket.org/hpk42/pytest/changeset/807b00f7bec3/
changeset: 807b00f7bec3
user: gutworth
date: 2011-06-29 20:28:04
summary: adjust for new option
affected #: 1 file (5 bytes)
--- a/testing/test_assertion.py Wed Jun 29 12:16:47 2011 -0500
+++ b/testing/test_assertion.py Wed Jun 29 13:28:04 2011 -0500
@@ -120,7 +120,7 @@
expl = ' '.join(callequal('foo', 'bar'))
assert 'raised in repr()' not in expl
- at pytest.mark.skipif("config._assertstate.mode != 'on'")
+ at pytest.mark.skipif("config._assertstate.mode != 'rewrite'")
def test_rewritten():
assert "@py_builtins" in globals()
http://bitbucket.org/hpk42/pytest/changeset/bd4a738bbd71/
changeset: bd4a738bbd71
user: gutworth
date: 2011-06-29 20:55:26
summary: we want second resolution on mtime
affected #: 1 file (5 bytes)
--- a/_pytest/assertion/rewrite.py Wed Jun 29 13:28:04 2011 -0500
+++ b/_pytest/assertion/rewrite.py Wed Jun 29 13:55:26 2011 -0500
@@ -147,7 +147,7 @@
def _use_cached_pyc(source, cache):
try:
- mtime = source.mtime()
+ mtime = int(source.mtime())
fp = cache.open("rb")
try:
data = fp.read(8)
http://bitbucket.org/hpk42/pytest/changeset/dc3a2bda9df9/
changeset: dc3a2bda9df9
user: gutworth
date: 2011-06-29 21:00:13
summary: simplify
affected #: 1 file (56 bytes)
--- a/_pytest/assertion/rewrite.py Wed Jun 29 13:55:26 2011 -0500
+++ b/_pytest/assertion/rewrite.py Wed Jun 29 14:00:13 2011 -0500
@@ -155,13 +155,10 @@
fp.close()
except EnvironmentError:
return False
- if (len(data) != 8 or
- data[:4] != imp.get_magic() or
- struct.unpack("<l", data[4:])[0] != mtime):
- # Invalid or out of date.
- return False
- # The cached pyc exists and is up to date.
- return True
+ # Check for invalid or out of date pyc file.
+ return (len(data) == 8 and
+ data[:4] == imp.get_magic() and
+ struct.unpack("<l", data[4:])[0] == mtime)
def _cache_pyc(state, pyc, cache):
try:
Repository URL: https://bitbucket.org/hpk42/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