Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various Python 3.8 warnings #206

Merged
merged 1 commit into from Aug 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/python_tests/filter_test.py
Expand Up @@ -174,21 +174,21 @@ def test_regex_replace():
context.push('name')
f = mapnik.Feature(context, 0)
f["name"] = 'test'
expr = mapnik.Expression("[name].replace('(\B)|( )','$1 ')")
expr = mapnik.Expression("[name].replace('(\\B)|( )','$1 ')")
eq_(expr.evaluate(f), 't e s t')


def test_unicode_regex_replace_to_str():
expr = mapnik.Expression("[name].replace('(\B)|( )','$1 ')")
eq_(str(expr), "[name].replace('(\B)|( )','$1 ')")
expr = mapnik.Expression("[name].replace('(\\B)|( )','$1 ')")
eq_(str(expr), "[name].replace('(\\B)|( )','$1 ')")


def test_unicode_regex_replace():
context = mapnik.Context()
context.push('name')
f = mapnik.Feature(context, 0)
f["name"] = 'Québec'
expr = mapnik.Expression("[name].replace('(\B)|( )','$1 ')")
expr = mapnik.Expression("[name].replace('(\\B)|( )','$1 ')")
# will fail if -DBOOST_REGEX_HAS_ICU is not defined
eq_(expr.evaluate(f), u'Q u é b e c')

Expand Down
2 changes: 1 addition & 1 deletion test/python_tests/json_feature_properties_test.py
Expand Up @@ -35,7 +35,7 @@
{
"name": "reverse_solidus", # backslash
"test": "string with \\ quote",
"json": '{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\\ quote"}}'
"json": '{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\\\ quote"}}'
},
{
"name": "solidus", # forward slash
Expand Down
4 changes: 2 additions & 2 deletions test/python_tests/mapnik_test_data_test.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_opening_data():
else:
for plugin in plugin_mapping[ext]:
kwargs = {'type': plugin, 'file': filepath}
if plugin is 'ogr':
if plugin == 'ogr':
kwargs['layer_by_index'] = 0
try:
mapnik.Datasource(**kwargs)
Expand Down