
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
pytest-factoryboy-state
Advanced tools
.. image:: https://img.shields.io/pypi/v/pytest-factoryboy-state.svg :target: https://pypi.org/project/pytest-factoryboy-state :alt: PyPI version
.. image:: https://img.shields.io/pypi/pyversions/pytest-factoryboy-state.svg :target: https://pypi.org/project/pytest-factoryboy-state :alt: Python versions
.. image:: https://github.com/hrother/pytest-factoryboy-state/workflows/build/badge.svg :target: https://github.com/hrother/pytest-factoryboy-state/actions?workflow=build :alt: Status tests
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white :target: https://github.com/pre-commit/pre-commit :alt: pre-commit
.. image:: https://results.pre-commit.ci/badge/github/hrother/pytest-factoryboy-state/main.svg :target: https://results.pre-commit.ci/latest/github/hrother/pytest-factoryboy-state/main :alt: pre-commit.ci status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Black
pytest
_ plugin to manage random state in factory_boy
_.
factory_boy
_ uses randomness in order to generate its fuzzed values which makes it hard to reproduce tests which fail due to a fuzzed value.
This plugin shows the random state used by factory_boy (and faker) when there are test failurs. And allows to run the tests with a specific random state.
--show-state
or by setting an environment variable.--set-state
pytest
_factory_boy
_You can install "pytest-factoryboy-state" via pip
_ from PyPI
_::
$ pip install pytest-factoryboy-state
Show the random state of factoryboy on test failure with::
$ pytest --show-state
Or by defining the environment variable SHOW_FACTORYBOY_STATE
to True
.
Rerun the tests with a given state::
$ pytest --set-state=<factoryboy_state>
You can also set the environment variable FACTORYBOY_STATE
to the state and run pytest as usual.
Contributions are very welcome. Tests can be run with tox
_, please ensure
the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the MIT
_ license, "pytest-factoryboy-state" is free and open source software
If you encounter any problems, please file an issue
_ along with a detailed description.
This pytest
_ plugin was generated with Cookiecutter
_ along with @hackebrot
's cookiecutter-pytest-plugin
template.
.. _Cookiecutter
: https://github.com/audreyr/cookiecutter
.. _@hackebrot
: https://github.com/hackebrot
.. _MIT
: http://opensource.org/licenses/MIT
.. _BSD-3
: http://opensource.org/licenses/BSD-3-Clause
.. _GNU GPL v3.0
: http://www.gnu.org/licenses/gpl-3.0.txt
.. _Apache Software License 2.0
: http://www.apache.org/licenses/LICENSE-2.0
.. _cookiecutter-pytest-plugin
: https://github.com/pytest-dev/cookiecutter-pytest-plugin
.. _file an issue
: https://github.com/hrother/pytest-factoryboy-state/issues
.. _pytest
: https://github.com/pytest-dev/pytest
.. _tox
: https://tox.readthedocs.io/en/latest/
.. _pip
: https://pypi.org/project/pip/
.. _PyPI
: https://pypi.org/project
.. _factory_boy
: https://factoryboy.readthedocs.io/en/stable/
FAQs
Simple factoryboy random state management
We found that pytest-factoryboy-state demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.