From bacfd73de3bde2b4e680a7e28b2e3140b3a61d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Freitag?= Date: Sun, 22 Nov 2020 14:59:05 +0100 Subject: [PATCH] Simplify handling of the locale argument to Faker Reviewed-by: Jon Dufresne --- factory/faker.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/factory/faker.py b/factory/faker.py index 1c9e28aa..dfd0bdaa 100644 --- a/factory/faker.py +++ b/factory/faker.py @@ -36,14 +36,11 @@ class Faker(declarations.ParameteredDeclaration): >>> foo = factory.Faker('name') """ def __init__(self, provider, **kwargs): - locale = kwargs.pop('locale', None) self.provider = provider - super().__init__( - locale=locale, - **kwargs) + super().__init__(**kwargs) def generate(self, params): - locale = params.pop('locale') + locale = params.pop('locale', None) subfaker = self._get_faker(locale) return subfaker.format(self.provider, **params)