Skip to content

Commit

Permalink
Apply updates from cookiecutter
Browse files Browse the repository at this point in the history
This automated commit applies the latest updates from our cookiecutters [1] to
this repo.

[1]: https://github.com/hypothesis/cookiecutters
  • Loading branch information
github-actions[bot] authored and seanh committed Jul 11, 2023
1 parent 5de305d commit 1e67f82
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ filterwarnings = [
"error", # Fail the tests if there are any warnings.
"ignore:^find_module\\(\\) is deprecated and slated for removal in Python 3.12; use find_spec\\(\\) instead$:DeprecationWarning:importlib",
"ignore:^FileFinder.find_loader\\(\\) is deprecated and slated for removal in Python 3.12; use find_spec\\(\\) instead$:DeprecationWarning:importlib",
"ignore:^pkg_resources is deprecated as an API:DeprecationWarning:pkg_resources",
"ignore:^pkg_resources is deprecated as an API:DeprecationWarning:pyramid",
"ignore:^Deprecated call to .pkg_resources\\.declare_namespace\\('.*'\\).\\.:DeprecationWarning:pkg_resources",
]
Expand Down
10 changes: 10 additions & 0 deletions tests/pytest_plugins/factory_boy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import factory.random
import pytest


@pytest.fixture(scope="session", autouse=True)
def factory_boy_random_seed():
# Set factory_boy's random seed so that it produces the same random values
# in each run of the tests.
# See: https://factoryboy.readthedocs.io/en/latest/index.html#reproducible-random-values
factory.random.reseed_random("hypothesis/h-vialib")
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ setenv =
dev: SENTRY_ENVIRONMENT = {env:SENTRY_ENVIRONMENT:dev}
dev: NEW_RELIC_APP_NAME = {env:NEW_RELIC_APP_NAME:h-vialib}
dev: NEW_RELIC_ENVIRONMENT = {env:NEW_RELIC_ENVIRONMENT:dev}
tests,functests: PYTEST_PLUGINS = tests.pytest_plugins.factory_boy
passenv =
HOME
PYTEST_ADDOPTS
Expand All @@ -36,6 +37,7 @@ deps =
lint,tests,coverage: coverage[toml]
lint,tests,functests: pytest
lint,tests,functests: factory-boy
lint,tests,functests: pytest-factoryboy
lint,tests,functests: h-matchers
lint,template: cookiecutter
lint,tests,functests: freezegun
Expand All @@ -52,7 +54,7 @@ commands =
lint: pydocstyle src tests bin
lint: pycodestyle src tests bin
tests: coverage run -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/unit/}
functests: pytest --failed-first --new-first --no-header --quiet {posargs:tests/functional/}
functests: python -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/functional/}
coverage: -coverage combine
coverage: coverage report
template: python3 bin/make_template {posargs}

0 comments on commit 1e67f82

Please sign in to comment.