From 920b5afe458b6a4448f8bb8a83d8551b8281684f Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 4 May 2015 14:42:01 +0200 Subject: [PATCH] now that we are going to have wheels, py source code might be not be installed and the resulting genscript is useless --HG-- branch : pluggy1 --- _pytest/genscript.py | 3 +++ doc/en/goodpractises.txt | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/_pytest/genscript.py b/_pytest/genscript.py index 15b6841b1..33b844a69 100755 --- a/_pytest/genscript.py +++ b/_pytest/genscript.py @@ -34,6 +34,9 @@ def pkg_to_mapping(name): for pyfile in toplevel.visit('*.py'): pkg = pkgname(name, toplevel, pyfile) name2src[pkg] = pyfile.read() + # with wheels py source code might be not be installed + # and the resulting genscript is useless, just bail out. + assert name2src, "no source code found for %r at %r" %(name, toplevel) return name2src def compress_mapping(mapping): diff --git a/doc/en/goodpractises.txt b/doc/en/goodpractises.txt index 31979618a..9e2b0cd97 100644 --- a/doc/en/goodpractises.txt +++ b/doc/en/goodpractises.txt @@ -169,6 +169,14 @@ You can tell people to download the script and then e.g. run it like this:: python runtests.py +.. note:: + + You must have pytest and its dependencies installed as an sdist, not + as wheels because genscript need the source code for generating a + standalone script. + + + Integrating with distutils / ``python setup.py test`` --------------------------------------------------------