From 296f752ccafaf7c111e5ba07a6b9e65905d7dd48 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 12 Feb 2013 22:59:29 +0100 Subject: [PATCH] fix --genscript option to generate standalone scripts that also work with python3.3 (importer ordering) --- CHANGELOG | 3 +++ _pytest/standalonetemplate.py | 2 +- testing/conftest.py | 3 ++- tox.ini | 7 ------- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0d06ed0df..449724af7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,9 @@ Changes between 2.3.4 and 2.3.5dev - issue257, assertion-triggered compilation of source ending in a comment line doesn't blow up in python2.5 (fixed through py>=1.4.13.dev6) +- fix --genscript option to generate standalone scripts that also + work with python3.3 (importer ordering) + - issue171 - in assertion rewriting, show the repr of some global variables diff --git a/_pytest/standalonetemplate.py b/_pytest/standalonetemplate.py index 5aaceaa9e..d7cac06e2 100755 --- a/_pytest/standalonetemplate.py +++ b/_pytest/standalonetemplate.py @@ -57,7 +57,7 @@ if __name__ == "__main__": sources = pickle.loads(zlib.decompress(base64.decodestring(sources))) importer = DictImporter(sources) - sys.meta_path.append(importer) + sys.meta_path.insert(0, importer) entry = "@ENTRY@" do_exec(entry, locals()) diff --git a/testing/conftest.py b/testing/conftest.py index 1ea82936a..f79e8802e 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -66,7 +66,8 @@ def pytest_generate_tests(metafunc): metafunc.addcall(funcargs={name: val}) elif 'anypython' in metafunc.fixturenames: for name in ('python2.4', 'python2.5', 'python2.6', - 'python2.7', 'python3.1', 'pypy', 'jython'): + 'python2.7', 'python3.2', "python3.3", + 'pypy', 'jython'): metafunc.addcall(id=name, param=name) # XXX copied from execnet's conftest.py - needs to be merged diff --git a/tox.ini b/tox.ini index 76440747b..6a41a27af 100644 --- a/tox.ini +++ b/tox.ini @@ -80,13 +80,6 @@ commands= py.test -n3 -rfsxX \ --junitxml={envlogdir}/junit-{envname}.xml [] -[testenv:py32] -deps=py>=1.4.0 - -[testenv:py33] -deps=py>=1.4.0 - :pypi:nose - [testenv:jython] changedir=testing commands=