fix issue206 - unset PYTHONDONTWRITEBYTECODE in assertrewrite test
This commit is contained in:
parent
1b61fbc8ed
commit
036557ac18
|
@ -6,6 +6,9 @@ Changes between 2.3.1 and 2.3.2.dev
|
|||
|
||||
- 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
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#
|
||||
__version__ = '2.3.2.dev4'
|
||||
__version__ = '2.3.2.dev5'
|
||||
|
|
2
setup.py
2
setup.py
|
@ -24,7 +24,7 @@ def main():
|
|||
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'],
|
||||
|
|
|
@ -354,18 +354,21 @@ def test_no_bytecode():
|
|||
@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__")
|
||||
|
||||
|
|
14
tox.ini
14
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 @@ basepython=python2.7
|
|||
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=.
|
||||
|
|
Loading…
Reference in New Issue