refactor: replace isort, black and flake8 with ruff (#1346)
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run

This commit is contained in:
Juro Oravec 2025-09-10 14:06:53 +02:00 committed by GitHub
parent 5279fd372a
commit f100cc1836
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
128 changed files with 3076 additions and 2599 deletions

View file

@ -3,8 +3,8 @@ from functools import wraps
from django.template import Context, Template
from django_components import Component, registry, types
from django_components.testing import djc_test
from .testutils import PARAMETRIZE_CONTEXT_BEHAVIOR, setup_test_config
setup_test_config({"autodiscover": False})
@ -16,7 +16,7 @@ def _get_templates_used_to_render(subject_template, render_context=None):
templates_used = []
def receive_template_signal(sender, template, context, **_kwargs):
def receive_template_signal(sender, template, context, **_kwargs): # noqa: ARG001
templates_used.append(template.name)
template_rendered.connect(receive_template_signal, dispatch_uid="test_method")
@ -29,8 +29,8 @@ def with_template_signal(func):
@wraps(func)
def wrapper(*args, **kwargs):
# Emulate Django test instrumentation for TestCase (see setup_test_environment)
from django.test.utils import instrumented_test_render
from django.template import Template
from django.test.utils import instrumented_test_render
original_template_render = Template._render
Template._render = instrumented_test_render