Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#63)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.5.0...v5.0.0)
- [github.com/psf/black: 23.12.1 → 24.10.0](psf/black@23.12.1...24.10.0)
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.9.1](astral-sh/ruff-pre-commit@v0.1.14...v0.9.1)
- [github.com/asottile/pyupgrade: v3.15.0 → v3.19.1](asottile/pyupgrade@v3.15.0...v3.19.1)
- [github.com/adamchainz/django-upgrade: 1.15.0 → 1.22.2](adamchainz/django-upgrade@1.15.0...1.22.2)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Leonardo Cavallucci <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and protoroto authored Jan 17, 2025
1 parent 26fd498 commit 93bef62
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exclude: "(.idea|node_modules|.tox)"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: "setup.cfg"
Expand All @@ -22,21 +22,21 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.14'
rev: 'v0.9.1'
hooks:
- id: ruff
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.19.1
hooks:
- id: pyupgrade
args:
- --py3-plus
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.15.0"
rev: "1.22.2"
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
Expand Down
1 change: 1 addition & 0 deletions tests/sample/test_project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
Expand Down
16 changes: 10 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def test_cli_sys_path(project_dir, blog_package):

def test_cli_install(project_dir, blog_package):
"""Running install command calls the business functions with the correct arguments."""
with patch("app_enabler.cli.enable_fun") as enable_fun, patch(
"app_enabler.cli.install_fun"
) as install_fun, working_directory(project_dir):
with (
patch("app_enabler.cli.enable_fun") as enable_fun,
patch("app_enabler.cli.install_fun") as install_fun,
working_directory(project_dir),
):
runner = CliRunner()
result = runner.invoke(cli, ["--verbose", "install", "djangocms-blog"])
assert result.exit_code == 0
Expand Down Expand Up @@ -80,9 +82,11 @@ def test_cli_install_error_verbose(verbose: bool):
@pytest.mark.parametrize("verbose", (True, False))
def test_cli_install_bad_application_verbose(verbose: bool):
"""Error due to bad application name is reported to the user."""
with patch("app_enabler.cli.enable_fun") as enable_fun, patch("app_enabler.cli.install_fun"), patch(
"app_enabler.cli.get_application_from_package"
) as get_application_from_package:
with (
patch("app_enabler.cli.enable_fun") as enable_fun,
patch("app_enabler.cli.install_fun"),
patch("app_enabler.cli.get_application_from_package") as get_application_from_package,
):
get_application_from_package.return_value = None

runner = CliRunner()
Expand Down
8 changes: 5 additions & 3 deletions tests/test_enable.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def test_enable_minimal(capsys, pytester, project_dir, addon_config_minimal, tea
def test_verify_fail(capsys, pytester, project_dir, addon_config_minimal, blog_package, teardown_django):
"""Enabling application load the addon configuration in settings and urlconf - minimal addon config."""

with working_directory(project_dir), patch("app_enabler.enable.load_addon") as load_addon, patch(
"app_enabler.enable.verify_installation"
) as verify_installation:
with (
working_directory(project_dir),
patch("app_enabler.enable.load_addon") as load_addon,
patch("app_enabler.enable.verify_installation") as verify_installation,
):
load_addon.return_value = addon_config_minimal
verify_installation.return_value = False
os.environ["DJANGO_SETTINGS_MODULE"] = "test_project.settings"
Expand Down

0 comments on commit 93bef62

Please sign in to comment.