Giter VIP home page Giter VIP logo

pytest-faker's Introduction

Faker integration with the pytest test runner

image

image

image

image

Documentation Status

pytest-faker adds Faker fixtures for easy use of Faker for your tests under pytest runner.

Attention

This plugin is included in the faker itself. This repository is not supported since then.

Install pytest-faker

pip install pytest-faker

Example

An example of Faker and pytest integration.

tests/test_faker.py:

from faker.generator import Generator

def test_faker(faker):
    """Faker factory is a fixture."""
    assert isinstance(faker, Generator)
    assert isinstance(faker.name(), str)

License

This software is licensed under the MIT license.

© 2015 Anatoly Bubenkov, Oleg Pidsadnyi and others

pytest-faker's People

Contributors

bubenkoff avatar jeffwidman avatar nicoddemus avatar ronnypfannschmidt avatar smarlowucf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

pytest-faker's Issues

Repo missing LICENSE

I am attempting to package this project. However, there is no copy of the MIT LICENSE in the repo. Can a LICENSE file be added and included in the MANIFEST so it is added to tarball?

The plugin doesn't support fixtures for unittest style classes

I get the following error when I try to use the faker fixture for a class fixture:

ScopeMismatch: You tried to access the 'function' scoped fixture 'faker' with a 'class' scoped request object, involved factories
celery/tests/unit/utils/conftest.py:21:  def text(request, faker)

Including pytest-faker into Faker

Hi,

I’m the maintainer of https://github.com/joke2k/faker.

I think it would make sense to include this plugin right into Faker. Users will have one less package to install, and the pytest-dev team will have one less package to maintain. I can submit the PR myself, and have you review it.

Let me know if you’re interested :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.