Skip to content

gopar/pyfta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyfta

Create fixtures from type annotations!

from pyfta import Pyfta

class World():
    def __init__(self, c: float, d: Text) -> None:
        self.c = c
        self.d = d


class Hello():
    def __init__(self, a: int, b: str, c: World) -> None:
        self.a = a
        self.b = b
        self.c = c


class HelloFactory(Pyfta):
    class Meta:
        model = Hello

hw = HelloFactory()
# Will output the following
print(hw.a,   # 17
      hw.b,   # ajvumVRiMV
      hw.c.c, # 52.70540728114681
      hw.c.d) # gJzmUnmsIP

The more detailed your type annotations, the better

About

Fixtures from Type Annotations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages