Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.8.6'
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
Loading