[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: running tests against installed version of package



> > By default pybuild runs tests I think using the source tree.

pybuild tells build system to build .py/.so files in temporary
directory (with a _stable_ name), copies tests dir there as well,
changes current directory to that dir (so that sys.path[0] doesn't point
to sources), runs tests and removes them (so that install target doesn't
pick them up)

> In most cases, Pybuild isn't very helpful for running tests and fails in
> the most common traps (like the one I'm solving for you below), which is
> why I don't really think it's useful at all. YMMV...

file bugs please. Works fine for me.

> > However I have a package where the tests require the entry points from
> > setup.py to be configured, the tests fail without this.
> 
> Most of the time, you get by this doing:
> PYTHONPATH=$(CURDIR) python -m pytest tests

this will test python2.7 only and will most probably ignore extensions, etc.
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


Reply to: