Repository navigation
Broken: running individual python tests #45
Description
Activity
Humm, yes, this cannot work, because we are doing a relative import (
from .xxx).We need that for python3 compat. I think the real answer of this issue is to have a real test runner instead of running them file by file. Do you want me to work on this?
But aren't we using nose? You should be able to limit the ran tests to this file passing arguments to nose.
@springmeyer
python setup.py nosetests -w test/python_tests/csv_test.py?Is this absolutely necessary for python3? Can't we support both 2 and 3 without breaking things?
Yes, it's absolutely necessary for python3: there is not way any more to make false relative import (i.e.
import xxxwhere xxx is supposed to be relative).
By "breaking things", you mean thatpython path/to/test.pyis not possible anymore? Is it a problem to replace with the line I pasted above?By "breaking things", you mean that python path/to/test.py is not possible anymore?
Correct. This is the way I run tests that I develop.
Is it a problem to replace with the line I pasted above?
Correct, its not sufficient. Running that is slower, not easy to remember, and outputs of bunch of noise:
running nosetests running egg_info writing mapnik.egg-info/PKG-INFO writing top-level names to mapnik.egg-info/top_level.txt writing dependency_links to mapnik.egg-info/dependency_links.txt reading manifest file 'mapnik.egg-info/SOURCES.txt' writing manifest file 'mapnik.egg-info/SOURCES.txt' copying build/lib.macosx-10.10-x86_64-2.7/mapnik/_mapnik.so -> mapnik /Library/Python/2.7/site-packages/nose/config.py:435: DeprecationWarning: Use of multiple -w arguments is deprecated and support may be removed in a future release. You can get the same behavior by passing directories without the -w argument on the command line, or by using the --tests argument in a configuration file. DeprecationWarning)Running that is slower
How much slower? :) I see
Ran 40 tests in 0.011swhen I run it myself ;)not easy to remember
Humm, would a Makefile entry help? Like
make test path/to/file.py?outputs of bunch of noise
I'll see how to fix that.
Another problem @yohanboniface. But certain files, when run from the command line, are meant to print more debugging info. For example
mainis overridden for test/python_tests/image_encoding_speed_test.py so that running it directly will print benchmarking info. This now no longer works because your proposed workaround of doingpython setup.py nosetests -w test/python_tests/image_encoding_speed_test.pydoes not invokemain. This is quite frustrating for me because honestly python 3 support is much less important to me than trying to get things working and I'm loosing time hitting this whenever I try to run old scripts.- added a commit that references this issue
on Sep 24, 2015 What about #53 ? :)
- added a commit that references this issue
on Sep 24, 2015 Running individual test module like this works:
cd test/ python -m python_tests.csv_test
This used to work:
//cc @flippmoke @yohanboniface - any ideas?