Skip to content

Commit

Permalink
Fix minor issues introduced in async migration
Browse files Browse the repository at this point in the history
Remove mislabeled async from synchronous functions.

Move test dependency to `dev` section.
  • Loading branch information
intendednull committed Jul 5, 2019
1 parent db4e670 commit f5ecc99
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions gentle_gnomes/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gentle_gnomes/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ scipy = "^1.3"
aiohttp = "^3.5"
quart = "^0.9.1"
uvloop = "^0.12.2"
pytest-asyncio = "^0.10.0"

[tool.poetry.dev-dependencies]
pytest = "^4.6"
coverage = "^4.5"
flake8 = "^3.7"
pytest-asyncio = "^0.10.0"

[tool.poetry.scripts]
start = "app:main"
Expand Down
2 changes: 1 addition & 1 deletion gentle_gnomes/src/azavea.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class City(t.NamedTuple):
admin: str
id: int

async def __str__(self):
def __str__(self):
return f'{self.name}, {self.admin}'


Expand Down
4 changes: 2 additions & 2 deletions gentle_gnomes/src/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@


class Indicator:
async def __init__(self, name: str, city: City):
def __init__(self, name: str, city: City):
self.name = name
self.city = city
await self._populate_data()

async def _populate_data(self):
items = []
Expand Down Expand Up @@ -57,6 +56,7 @@ async def get_top_indicators(city: City, n: int = 5) -> Tuple[Indicator, ...]:

for name in INDICATORS:
indicator = Indicator(name, city)
await indicator._populate_data()

rates[name] = indicator.rate
indicators[name] = indicator
Expand Down

0 comments on commit f5ecc99

Please sign in to comment.