[py-svn] commit/pytest: hpk42: fix issue206 - unset PYTHONDONTWRITEBYTECODE in assertrewrite test
Bitbucket
commits-noreply at bitbucket.org
Mon Oct 22 11:14:28 CEST 2012
1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/changeset/f8223edf9072/
changeset: f8223edf9072
user: hpk42
date: 2012-10-22 11:14:18
summary: fix issue206 - unset PYTHONDONTWRITEBYTECODE in assertrewrite test
affected #: 5 files
diff -r a2b978e586f2e09a90106ccdabf5860f15b6b928 -r f8223edf907244076e98eeae576f896489354d55 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,9 @@
- fix exception message check of test_nose.py to pass on python33 as well
+- fix issue206 - fix test_assertrewrite.py to work when a global
+ PYTHONDONTWRITEBYTECODE=1 is present
+
- add tox.ini to pytest distribution so that ignore-dirs and others config
bits are properly distributed for maintainers who run pytest-own tests
diff -r a2b978e586f2e09a90106ccdabf5860f15b6b928 -r f8223edf907244076e98eeae576f896489354d55 _pytest/__init__.py
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
#
-__version__ = '2.3.2.dev4'
+__version__ = '2.3.2.dev5'
diff -r a2b978e586f2e09a90106ccdabf5860f15b6b928 -r f8223edf907244076e98eeae576f896489354d55 setup.py
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@
name='pytest',
description='py.test: simple powerful testing with Python',
long_description = long_description,
- version='2.3.2.dev4',
+ version='2.3.2.dev5',
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
diff -r a2b978e586f2e09a90106ccdabf5860f15b6b928 -r f8223edf907244076e98eeae576f896489354d55 testing/test_assertrewrite.py
--- a/testing/test_assertrewrite.py
+++ b/testing/test_assertrewrite.py
@@ -354,18 +354,21 @@
@pytest.mark.skipif('"__pypy__" in sys.modules')
def test_pyc_vs_pyo(self, testdir, monkeypatch):
testdir.makepyfile("""
-import pytest
-def test_optimized():
- "hello"
- assert test_optimized.__doc__ is None""")
+ import pytest
+ def test_optimized():
+ "hello"
+ assert test_optimized.__doc__ is None"""
+ )
p = py.path.local.make_numbered_dir(prefix="runpytest-", keep=None,
rootdir=testdir.tmpdir)
tmp = "--basetemp=%s" % p
monkeypatch.setenv("PYTHONOPTIMIZE", "2")
+ monkeypatch.delenv("PYTHONDONTWRITEBYTECODE", raising=False)
assert testdir.runpybin("py.test", tmp).ret == 0
tagged = "test_pyc_vs_pyo." + PYTEST_TAG
assert tagged + ".pyo" in os.listdir("__pycache__")
monkeypatch.undo()
+ monkeypatch.delenv("PYTHONDONTWRITEBYTECODE", raising=False)
assert testdir.runpybin("py.test", tmp).ret == 1
assert tagged + ".pyc" in os.listdir("__pycache__")
diff -r a2b978e586f2e09a90106ccdabf5860f15b6b928 -r f8223edf907244076e98eeae576f896489354d55 tox.ini
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
distshare={homedir}/.tox/distshare
-envlist=py26,py27,py31,py32,py33,py27-xdist,py25,trial
+envlist=py26,py27,py27-nobyte,py31,py32,py33,py27-xdist,py25,trial
indexserver=
pypi = http://pypi.python.org/simple
testrun = http://pypi.testrun.org
@@ -24,7 +24,17 @@
deps=pytest-xdist
commands=
py.test -n3 -rfsxX \
- --ignore .tox --junitxml={envlogdir}/junit-{envname}.xml testing
+ --junitxml={envlogdir}/junit-{envname}.xml testing
+
+[testenv:py27-nobyte]
+changedir=.
+basepython=python2.7
+deps=pytest-xdist
+setenv=
+ PYTHONDONTWRITEBYTECODE=1
+commands=
+ py.test -n3 -rfsxX \
+ --junitxml={envlogdir}/junit-{envname}.xml []
[testenv:trial]
changedir=.
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