Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Dec 12, 2023
1 parent af0325b commit 514c5c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,10 @@ def faker(self, value):

def _add_provider_methods(self, faker_instance):
for class_name, methods in PROVIDER_REGISTRY.items():
if class_name == "fake.Faker" or class_name == self.faker.uid:
if (
class_name == f"{__name__}.{Faker.__name__}"
or class_name == self.faker.uid
):
for method_name in methods:
if hasattr(faker_instance, method_name):
bound_method = create_factory_method(method_name)
Expand Down Expand Up @@ -2709,7 +2712,7 @@ def test_faker_init(self) -> None:
self.assertNotEqual(faker.alias, "default")

def test_get_by_uid(self) -> None:
faker = Faker.get_by_uid(f"{__name__}.Faker")
faker = Faker.get_by_uid(f"{__name__}.{Faker.__name__}")
self.assertIs(faker, self.faker)

def test_get_by_alias(self) -> None:
Expand Down

0 comments on commit 514c5c9

Please sign in to comment.