Code Monkey home page Code Monkey logo

autofaker's Introduction

autofaker's People

Contributors

christianhelle avatar jmpcm avatar marksmayo avatar qodana-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jmpcm flobz

autofaker's Issues

Enum support in the future?

Love the idea of this! Our use case makes heavy use of enums. Are there plans for enum support in the future?

pytest support

This is a very helpful project. Cannot imagine there is no AutoFixture correspondence in python.

It would be more useful if there is pytest support:

from autofaker import autodata
@autodata()
def test_2(tstr: str):
  pass

Output: NotImplementedError: This way of creating anonymous objects are only supported from unit test

Include Literals as for Enums

Hello,

I make use of typing: Literals in my code, where an enum would be overkill. Would you consider incorporating this as a feature?

def test_():

    from dataclasses import dataclass
    from autofaker import Autodata

    from typing import Literal
    MyLiteral = Literal['a', 'b']

    @dataclass
    class DTO:
        id: int
        thing: MyLiteral

    data = Autodata.create(DTO, use_fake_data=True)

    print(f'id:     {data.id}')
    print(f'thing:   {data.thing}')

Many thanks!

The enum generation only works with direct classes of Enum.

The current code to generate an enum is the following:

def is_enum(t) -> bool:
    return t.__base__.__name__ == 'Enum'

This allows only direct classes of Enum to be generated. If you have something like

class BasicEnum(Enum):
   some stuff

class MyEnum(BasicEnum):
   VALUE_1 = 1
   VALUE_2 = 2

it wont work.
This can be fixed by just asking if it is instance of Enum instead

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/build-for-os.yml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/build.yml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/codecov.yml
  • actions/checkout v4
  • actions/setup-python v5
  • codecov/codecov-action v4.5.0
.github/workflows/integration-tests.yml
.github/workflows/pre-release.yml
  • actions/setup-python v5
.github/workflows/release.yml
  • actions/setup-python v5
  • actions/github-script v7
.github/workflows/sonar-cloud.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/setup-python v5
  • actions/upload-artifact v4
.github/workflows/test.yml
  • actions/checkout v4
  • actions/setup-python v5
pep621
pyproject.toml
  • setuptools >=46.4.0
pip_requirements
requirements.txt

  • Check this box to trigger a request for Renovate to run again on this repository

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.