Check the type annotations at runtime with typeguard #15
2 changed files with 2 additions and 3 deletions
Generate the fake coordinates as floats
Also, remove the misleading comment in `Location`
commit
8abc93987e
|
|
@ -22,7 +22,6 @@ class Location:
|
|||
|
||||
def __init__(self, latitude: float, longitude: float) -> None:
|
||||
"""Create a location from a WGS84-conforming `latitude`-`longitude` pair."""
|
||||
# The SQLAlchemy columns come as `Decimal`s due to the `DOUBLE_PRECISION`.
|
||||
self._latitude = float(latitude)
|
||||
self._longitude = float(longitude)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ class AddressFactory(alchemy.SQLAlchemyModelFactory):
|
|||
)
|
||||
|
||||
# Place the addresses somewhere in downtown Paris.
|
||||
latitude = factory.Faker("coordinate", center=48.855, radius=0.01)
|
||||
longitude = factory.Faker("coordinate", center=2.34, radius=0.03)
|
||||
latitude = factory.Faker("pyfloat", min_value=48.845, max_value=48.865)
|
||||
longitude = factory.Faker("pyfloat", min_value=2.31, max_value=2.37)
|
||||
# city -> set by the `make_address` fixture as there is only one `city`
|
||||
city_name = "Paris"
|
||||
zip_code = factory.LazyFunction(lambda: random.randint(75001, 75020))
|
||||
|
|
|
|||
Loading…
Reference in a new issue