You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
Yes, it's absolutely necessary for python3: there is not way any more to make false relative import (i.e. import xxx where xxx is supposed to be relative).
By "breaking things", you mean that python path/to/test.py is 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)
Another problem @yohanboniface. But certain files, when run from the command line, are meant to print more debugging info. For example main is 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 doing python setup.py nosetests -w test/python_tests/image_encoding_speed_test.py does not invoke main. 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.
Activity
yohanboniface commentedon Aug 26, 2015
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?
yohanboniface commentedon Aug 26, 2015
But aren't we using nose? You should be able to limit the ran tests to this file passing arguments to nose.
yohanboniface commentedon Aug 26, 2015
@springmeyer
python setup.py nosetests -w test/python_tests/csv_test.py?springmeyer commentedon Aug 27, 2015
Is this absolutely necessary for python3? Can't we support both 2 and 3 without breaking things?
yohanboniface commentedon Aug 27, 2015
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 that
python path/to/test.pyis not possible anymore? Is it a problem to replace with the line I pasted above?springmeyer commentedon Aug 27, 2015
Correct. This is the way I run tests that I develop.
Correct, its not sufficient. Running that is slower, not easy to remember, and outputs of bunch of noise:
yohanboniface commentedon Aug 27, 2015
How much slower? :) I see
Ran 40 tests in 0.011swhen I run it myself ;)Humm, would a Makefile entry help? Like
make test path/to/file.py?I'll see how to fix that.
springmeyer commentedon Sep 23, 2015
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.Add makefile for short test command lines (cf mapnik#45)
yohanboniface commentedon Sep 24, 2015
What about #53 ? :)
Add makefile for short test command lines (cf #45)
lightmare commentedon Aug 30, 2019
Running individual test module like this works:
cd test/ python -m python_tests.csv_test