fake
A basic instance of Faker to generate test data.
Last updated
A basic instance of Faker to generate test data.
Last updated
Put simply, Faker is a library that generates fake data for you.
py.fake
- A basic Faker instance for UI tests
fake fixture
- A fixture of Faker for any tests
Create your own
- Some users may need advanced functionality like Locales and Providers
To see a full list of all the default providers that come out of the box, go to the link below:
When I type py.fake.
, I'm not seeing address()
or anything else in your examples. What gives?
Because of the way Faker works with their Providers, you don't get IntelliSense. This is good and bad. Bad because you don't see all the options that are available, but good because you can create your own, custom Providers to generate almost everything you'd need for your applications and systems. Just type py.fake.address()
and it will work!
Which of the three approaches should I use?
It's entirely up to you and your needs and style. This is completely valid:
If you need more advanced power, you can always create your own instance of Faker: