Skip to content

Commit

Permalink
adjust code to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rinigus committed Jan 5, 2021
1 parent 35e91dd commit 8b984e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion guides/foursquare.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def normalize(x):
return x.lower().replace("é", "e")
query = normalize(query)
results = []
for _, type in get_types().items():
for _ignore_, type in get_types().items():
pos = normalize(type.label).find(query)
if pos < 0: continue
results.append(poor.AttrDict(
Expand Down
4 changes: 2 additions & 2 deletions poor/test/delayed_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# This test is performed after other tests to avoid changes in poor.conf
# with the respect to used API keys

import imp
import importlib
import os
import poor.test
import tempfile
Expand All @@ -28,7 +28,7 @@
class TestConfigurationStore(poor.test.TestCase):

def setup_method(self, method):
imp.reload(poor.config)
importlib.reload(poor.config)
poor.conf = poor.ConfigurationStore()
handle, self.path = tempfile.mkstemp()

Expand Down
2 changes: 1 addition & 1 deletion poor/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def format_decimal(value, n=0, lang=None):
if lang is not None:
result = "{{:.{:d}f}}".format(max(0, ndigits)).format(value)
return result.replace('.', decimal.get(lang, '.'))
return locale.format("%.{:d}f".format(max(0, ndigits)), value)
return locale.format_string("%.{:d}f".format(max(0, ndigits)), value)

def format_distance(meters, n=2, short=True, lang=None):
"""Format `meters` to `n` significant digits and unit label."""
Expand Down

0 comments on commit 8b984e9

Please sign in to comment.