Skip to content

Commit

Permalink
Upgrade pytest to 8.2.1
Browse files Browse the repository at this point in the history
Also add `pytest` and `pytest-bdd` as default dependencies in project template.
  • Loading branch information
subhashb committed May 29, 2024
1 parent f4d9a76 commit edd7665
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
18 changes: 9 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ optional = true

[tool.poetry.group.test.dependencies]
mock = "5.1.0"
pluggy = "1.3.0"
pytest-asyncio = ">=0.21.1"
pytest-cov = ">=4.1.0"
pytest-mock = "3.12.0"
pytest = ">=7.4.3"
pytest = "^8.2.1"

[tool.poetry.group.docs]
optional = true
Expand Down
8 changes: 7 additions & 1 deletion src/protean/template/domain_template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version = "0.1.0"
description = "{{ short_description }}"
authors = ["{{ author_name }} <{{ author_email }}>"]
readme = "README.md"
packages = [{include = "{{ package_name|replace('_','-') }}"}]
classifiers=[
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Programming Language :: Python",
Expand Down Expand Up @@ -41,6 +40,13 @@ python = "^3.11"
{%- endif %}
protean = {version = "0.11.0", extras={{ extras }} }

[tool.poetry.group.test]
optional = true

[tool.poetry.group.test.dependencies]
pytest = "^8.2.1"
pytest-bdd = "^7.1.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def pytest_sessionstart(session):

Fetch and activate the domain by pushing the associated domain_context. The activated domain can then be referred to elsewhere as `current_domain`
"""
os.environ["{{ package_name|upper }}_ENV"] = session.config.option.env
os.environ["PROTEAN_ENV"] = session.config.option.env

from {{ package_name }}.domain import {{ package_name }}
{{ package_name }}.domain_context().push()
Expand All @@ -27,7 +27,7 @@ def run_around_tests():
"""Fixture to automatically cleanup infrastructure after every test"""
yield

from protean.globals import current_domain, g
from protean.globals import current_domain

# Clear all databases
for _, provider in current_domain.providers.items():
Expand Down

0 comments on commit edd7665

Please sign in to comment.