[py-svn] commit/pytest: gutworth: cleanup test a bit
Bitbucket
commits-noreply at bitbucket.org
Sat Jul 7 17:01:49 CEST 2012
1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/changeset/d691d36de2cc/
changeset: d691d36de2cc
user: gutworth
date: 2012-07-07 17:01:44
summary: cleanup test a bit
affected #: 1 file
diff -r 1e9f8d37d4bf6f51aa651546ed37c5579a30fec7 -r d691d36de2cc36ea05e02731d39e4a0461b6b1ab testing/test_assertrewrite.py
--- a/testing/test_assertrewrite.py
+++ b/testing/test_assertrewrite.py
@@ -10,7 +10,7 @@
pytest.skip("assert rewrite does currently not work on jython")
from _pytest.assertion import util
-from _pytest.assertion.rewrite import rewrite_asserts
+from _pytest.assertion.rewrite import rewrite_asserts, PYTEST_TAG
def setup_module(mod):
@@ -353,7 +353,6 @@
@pytest.mark.skipif('"__pypy__" in sys.modules')
def test_pyc_vs_pyo(self, testdir, monkeypatch):
- import _pytest.assertion.rewrite
testdir.makepyfile("""
import pytest
def test_optimized():
@@ -364,12 +363,11 @@
tmp = "--basetemp=%s" % p
monkeypatch.setenv("PYTHONOPTIMIZE", "2")
assert testdir.runpybin("py.test", tmp).ret == 0
- fname = 'test_pyc_vs_pyo.%s.pyo' % _pytest.assertion.rewrite.PYTEST_TAG
- assert fname in os.listdir('__pycache__')
+ tagged = "test_pyc_vs_pyo." + PYTEST_TAG
+ assert tagged + ".pyo" in os.listdir("__pycache__")
monkeypatch.undo()
assert testdir.runpybin("py.test", tmp).ret == 1
- fname = 'test_pyc_vs_pyo.%s.pyc' % _pytest.assertion.rewrite.PYTEST_TAG
- assert fname in os.listdir('__pycache__')
+ assert tagged + ".pyc" in os.listdir("__pycache__")
def test_package(self, testdir):
pkg = testdir.tmpdir.join("pkg")
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