async_factory_boy
=================
`factory_boy <https://github.com/FactoryBoy/factory_boy>`__ extension
with asynchronous ORM support
Requirements
------------
- python (3.8, 3.9, 3.10)
Instalation
-----------
Install using ``pip``
::
pip install async_factory_boy
Usage
-----
async_factory_boy integrate with Object Relational Mapping (ORM) through
subclass of ``factory.Factory``. All supported are listed below.
- SQLAlchemy, with
``async_factory_boy.factory.sqlalchemy.AsyncSQLAlchemyFactory``
.. code:: python
from async_factory_boy.factory.sqlalchemy import AsyncSQLAlchemyFactory
class TestModelFactory(AsyncSQLAlchemyFactory):
class Meta:
model = TestModel
session = session
name = Faker("name")
created_at = Faker("date_time")
- Tortoise ORM, with
``async_factory_boy.factory.tortoise.AsyncTortoiseFactory``
.. code:: python
from async_factory_boy.factory.tortoise import AsyncTortoiseFactory
class TestModelFactory(AsyncTortoiseFactory):
class Meta:
model = TestModel
name = Faker("name")
created_at = Faker("date_time")
and factory usage
.. code:: python
test = await TestModelFactory.create()
test = await TestModelFactory.build()
For test configuration examples check ``tests/`` directory.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Raw data
{
"_id": null,
"home_page": "https://github.com/kuzxnia/async_factory_boy",
"name": "async-factory-boy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "factory_boy,factory,fixtures,async,SQLAlchemy,Tortoise,async_factory_boy",
"author": "Kacper Ku\u017aniarski",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/0e/e5/a1eb125af7020d94e75caf4a994bf8d8c8c54924fd6b90b4a2a157583ced/async_factory_boy-1.0.1.tar.gz",
"platform": null,
"description": "async_factory_boy\n=================\n\n`factory_boy <https://github.com/FactoryBoy/factory_boy>`__ extension\nwith asynchronous ORM support\n\nRequirements\n------------\n\n- python (3.8, 3.9, 3.10)\n\nInstalation\n-----------\n\nInstall using ``pip``\n\n::\n\n pip install async_factory_boy\n\nUsage\n-----\n\nasync_factory_boy integrate with Object Relational Mapping (ORM) through\nsubclass of ``factory.Factory``. All supported are listed below.\n\n- SQLAlchemy, with\n ``async_factory_boy.factory.sqlalchemy.AsyncSQLAlchemyFactory``\n\n.. code:: python\n\n from async_factory_boy.factory.sqlalchemy import AsyncSQLAlchemyFactory\n\n\n class TestModelFactory(AsyncSQLAlchemyFactory):\n class Meta:\n model = TestModel\n session = session\n\n name = Faker(\"name\")\n created_at = Faker(\"date_time\")\n\n- Tortoise ORM, with\n ``async_factory_boy.factory.tortoise.AsyncTortoiseFactory``\n\n.. code:: python\n\n from async_factory_boy.factory.tortoise import AsyncTortoiseFactory\n\n\n class TestModelFactory(AsyncTortoiseFactory):\n class Meta:\n model = TestModel\n\n name = Faker(\"name\")\n created_at = Faker(\"date_time\")\n\nand factory usage\n\n.. code:: python\n\n test = await TestModelFactory.create()\n test = await TestModelFactory.build()\n\nFor test configuration examples check ``tests/`` directory.\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "factory_boy extension with asynchronous ORM support",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/kuzxnia/async_factory_boy"
},
"split_keywords": [
"factory_boy",
"factory",
"fixtures",
"async",
"sqlalchemy",
"tortoise",
"async_factory_boy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "79aa244bc0c1a1076217648d8268503656d5f08f9d7c319d4115fd13118dae1a",
"md5": "7688815c278017376c95d59a47d20103",
"sha256": "a0a652776ee164b60a45be06aca44a18781710447de1c534dda82d6cfe23f026"
},
"downloads": -1,
"filename": "async_factory_boy-1.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "7688815c278017376c95d59a47d20103",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 5688,
"upload_time": "2023-08-12T13:44:43",
"upload_time_iso_8601": "2023-08-12T13:44:43.146273Z",
"url": "https://files.pythonhosted.org/packages/79/aa/244bc0c1a1076217648d8268503656d5f08f9d7c319d4115fd13118dae1a/async_factory_boy-1.0.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0ee5a1eb125af7020d94e75caf4a994bf8d8c8c54924fd6b90b4a2a157583ced",
"md5": "236cbbbace1c0ebbdfbcdbc0bacf511c",
"sha256": "af3a42d9c26b86cc427faf5159ac2e8541b5564bf30424282eb866620af4e143"
},
"downloads": -1,
"filename": "async_factory_boy-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "236cbbbace1c0ebbdfbcdbc0bacf511c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8667,
"upload_time": "2023-08-12T13:44:44",
"upload_time_iso_8601": "2023-08-12T13:44:44.458023Z",
"url": "https://files.pythonhosted.org/packages/0e/e5/a1eb125af7020d94e75caf4a994bf8d8c8c54924fd6b90b4a2a157583ced/async_factory_boy-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-12 13:44:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kuzxnia",
"github_project": "async_factory_boy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "async-factory-boy"
}