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

Re: pybuild: where to put --test-pytest?



>>> ROOT/python-dugong-2.1/.pybuild/pythonX.Y_3.4/build. The latter seems to
[...]
> I was assuming that there's some rationale for pybuild looking for the
> tests in this directory. If they have to be copied there manually, or if
> pybuild has to be told to look for them elsewhere, then why look for
> them in this weird location in the first place?

Short version: that's a hack to workaround distutils "features".
For long version, see distutils/setuptools' sources (and check how it
handles files/locations or parameters from previous steps)

> It seems to me I'm missing something here.. maybe the right question to
> ask is: in what situation would I *not* need to copy the files manually
> or modify PYBUILD_TEST_ARGS?

You don't have to change a thing if unit tests are installed with the
library (f.e. as foo.tests or when all tests are in docstrings).

I just added this to my TODO list:
"detect test/tests/unitests directory, copy it to {build_dir}, run 2to3
if needed (this is the tricky part) and add path to this dir in test
plugins that support it"

but that's yet another hack, what I'd really want is a *standard*.

In distutils build plugin, pybuild already checks for "test_suite" in
setup.py (which apparently is not the only case where 
`{interpreter} setup.py test` should be invoked), invokes
`{interpreter} -m unittest discover -v`... but only for some interpreter
versions or nose/pytest/tox equivalents (which you have enable because,
guess what, it's not that obvious when you can use one instead of the
other).

Please try to convince upstream authors to use ONE AND ONLY ONE
interface.
-- 
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: