Address more ignored pytest warnings, co-authored with Opus 4.6 (#16298)

* Address more ignored pytest warnings

* Fix what we can with CI results

* Add new migration file
This commit is contained in:
Alan Rominger
2026-03-05 13:51:19 -05:00
committed by GitHub
parent 7384c73c9a
commit 670dfeed25
4 changed files with 34 additions and 22 deletions

View File

@@ -0,0 +1,29 @@
# Generated by Django 5.2.8 on 2026-02-20 03:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0204_squashed_deletions'),
]
operations = [
migrations.AlterModelOptions(
name='instancegroup',
options={
'default_permissions': ('change', 'delete', 'view'),
'ordering': ('pk',),
'permissions': [('use_instancegroup', 'Can use instance group in a preference list of a resource')],
},
),
migrations.AlterModelOptions(
name='workflowjobnode',
options={'ordering': ('pk',)},
),
migrations.AlterModelOptions(
name='workflowjobtemplatenode',
options={'ordering': ('pk',)},
),
]

View File

@@ -485,6 +485,7 @@ class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin, ResourceMi
class Meta: class Meta:
app_label = 'main' app_label = 'main'
ordering = ('pk',)
permissions = [('use_instancegroup', 'Can use instance group in a preference list of a resource')] permissions = [('use_instancegroup', 'Can use instance group in a preference list of a resource')]
# Since this has no direct organization field only superuser can add, so remove add permission # Since this has no direct organization field only superuser can add, so remove add permission
default_permissions = ('change', 'delete', 'view') default_permissions = ('change', 'delete', 'view')

View File

@@ -200,6 +200,7 @@ class WorkflowJobTemplateNode(WorkflowNodeBase):
indexes = [ indexes = [
models.Index(fields=['identifier']), models.Index(fields=['identifier']),
] ]
ordering = ('pk',)
def get_absolute_url(self, request=None): def get_absolute_url(self, request=None):
return reverse('api:workflow_job_template_node_detail', kwargs={'pk': self.pk}, request=request) return reverse('api:workflow_job_template_node_detail', kwargs={'pk': self.pk}, request=request)
@@ -286,6 +287,7 @@ class WorkflowJobNode(WorkflowNodeBase):
models.Index(fields=["identifier", "workflow_job"]), models.Index(fields=["identifier", "workflow_job"]),
models.Index(fields=['identifier']), models.Index(fields=['identifier']),
] ]
ordering = ('pk',)
@property @property
def event_processing_finished(self): def event_processing_finished(self):

View File

@@ -15,9 +15,6 @@ markers =
filterwarnings = filterwarnings =
error error
# FIXME: Upgrade protobuf https://github.com/protocolbuffers/protobuf/issues/15077
once:Type google._upb._message.* uses PyType_Spec with a metaclass that has custom tp_new:DeprecationWarning
# FIXME: Upgrade python-dateutil https://github.com/dateutil/dateutil/issues/1340 # FIXME: Upgrade python-dateutil https://github.com/dateutil/dateutil/issues/1340
once:datetime.datetime.utcfromtimestamp\(\) is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC:DeprecationWarning once:datetime.datetime.utcfromtimestamp\(\) is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC:DeprecationWarning
@@ -31,29 +28,12 @@ filterwarnings =
# FIXME: Delete this entry once `zope` is updated. # FIXME: Delete this entry once `zope` is updated.
once:Deprecated call to `pkg_resources.declare_namespace.'zope'.`.\nImplementing implicit namespace packages .as specified in PEP 420. is preferred to `pkg_resources.declare_namespace`. See https.//setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages:DeprecationWarning: once:Deprecated call to `pkg_resources.declare_namespace.'zope'.`.\nImplementing implicit namespace packages .as specified in PEP 420. is preferred to `pkg_resources.declare_namespace`. See https.//setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages:DeprecationWarning:
# FIXME: Delete this entry once `coreapi` is deleted from the dependencies
# FIXME: and is no longer imported at runtime.
once:CoreAPI compatibility is deprecated and will be removed in DRF 3.17:rest_framework.RemovedInDRF317Warning:rest_framework.schemas.coreapi
# FIXME: Delete this entry once the deprecation is acted upon. # FIXME: Delete this entry once the deprecation is acted upon.
# Note: RemovedInDjango51Warning may not exist in newer Django versions # Note: RemovedInDjango51Warning may not exist in newer Django versions
ignore:'index_together' is deprecated. Use 'Meta.indexes' in 'main.\w+' instead. ignore:'index_together' is deprecated. Use 'Meta.indexes' in 'main.\w+' instead.
# FIXME: Update `awx.main.migrations._dab_rbac` and delete this entry. # FIXME: Add ordering to Resource model in django-ansible-base and delete this entry.
# Note: RemovedInDjango50Warning may not exist in newer Django versions once:Pagination may yield inconsistent results with an unordered object_list.*Resource:django.core.paginator.UnorderedObjectListWarning
ignore:Using QuerySet.iterator.. after prefetch_related.. without specifying chunk_size is deprecated.
# FIXME: Figure this out, fix and then delete the entry. It's not entirely
# FIXME: clear what emits it and where.
once:Pagination may yield inconsistent results with an unordered object_list. .class 'awx.main.models.workflow.WorkflowJobTemplateNode'. QuerySet.:django.core.paginator.UnorderedObjectListWarning:django.core.paginator
# FIXME: Figure this out, fix and then delete the entry.
once::django.core.paginator.UnorderedObjectListWarning:rest_framework.pagination
# FIXME: Use `open()` via a context manager
# FIXME: in `awx/main/tests/unit/test_tasks.py` to close hanging file
# FIXME: descriptors and then delete the entry.
once:unclosed file <_io.TextIOWrapper name='[^']+' mode='r' encoding='UTF-8'>:ResourceWarning:awx.main.tests.unit.test_tasks
# https://docs.pytest.org/en/stable/usage.html#creating-junitxml-format-files # https://docs.pytest.org/en/stable/usage.html#creating-junitxml-format-files
junit_duration_report = call junit_duration_report = call