return code 0 to gracefully exit if python bindings are not available
This commit is contained in:
parent
ea5b4f56d0
commit
2f08dc29ef
3 changed files with 16 additions and 11 deletions
|
@ -1010,13 +1010,6 @@ struct is_null : public boost::static_visitor<bool>
|
|||
boost::ignore_unused_variable_warning(val);
|
||||
return false;
|
||||
}
|
||||
|
||||
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
||||
bool operator() (boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& val)
|
||||
const
|
||||
{
|
||||
return boost::apply_visitor(*this, val);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace impl
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
|
||||
|
@ -7,6 +8,12 @@ try:
|
|||
except ImportError, e:
|
||||
sys.stderr.write("Unable to run python tests: the third party 'nose' module is required\nTo install 'nose' do:\n\tsudo pip install nose (or on debian systems: apt-get install python-nose): %s\n" % e)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import mapnik3
|
||||
except ImportError:
|
||||
print '\x1b[31m✘\x1b[0m (\x1b[34m%s\x1b[0m)' % 'import mapnik failed - tests require python bindings'
|
||||
sys.exit(0)
|
||||
|
||||
from python_tests.utilities import TodoPlugin
|
||||
from nose.plugins.doctests import Doctest
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import mapnik
|
||||
mapnik.logger.set_severity(mapnik.severity_type.None)
|
||||
#mapnik.logger.set_severity(mapnik.severity_type.Debug)
|
||||
import sys
|
||||
|
||||
try:
|
||||
import mapnik3
|
||||
mapnik.logger.set_severity(mapnik.severity_type.None)
|
||||
#mapnik.logger.set_severity(mapnik.severity_type.Debug)
|
||||
except ImportError:
|
||||
print '\x1b[31m✘\x1b[0m (\x1b[34m%s\x1b[0m)' % 'import mapnik failed - tests require python bindings'
|
||||
sys.exit(0)
|
||||
|
||||
import shutil
|
||||
import sys
|
||||
import os.path
|
||||
from compare import compare, compare_grids
|
||||
|
||||
|
|
Loading…
Reference in a new issue