diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-01-14 08:25:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-14 08:25:37 -0500 |
| commit | 6a596373d464d1d8e9014d952286ab5f6d2a9983 (patch) | |
| tree | e08e4ab29c97a6612a6d2c8c6c334add51047ea5 /tests/backends | |
| parent | 040bb3eba72eb45020dd025d3f83094a0fcaf22f (diff) | |
Fixed #35402 -- Fixed crash in DatabaseFeatures.django_test_skips when running a subset of tests.
Thanks Tim Graham for the report and the review.
Diffstat (limited to 'tests/backends')
| -rw-r--r-- | tests/backends/base/test_creation.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/backends/base/test_creation.py b/tests/backends/base/test_creation.py index 2542407f0b..8fd8f490b2 100644 --- a/tests/backends/base/test_creation.py +++ b/tests/backends/base/test_creation.py @@ -1,6 +1,7 @@ import copy import datetime import os +import sys from unittest import mock from django.db import DEFAULT_DB_ALIAS, connection, connections @@ -333,6 +334,10 @@ class TestMarkTests(SimpleTestCase): "backends.base.test_creation.skip_test_function", }, } + # Emulate the scenario where the parent module for + # backends.base.test_creation has not been imported yet. + popped_module = sys.modules.pop("backends.base") + self.addCleanup(sys.modules.__setitem__, "backends.base", popped_module) creation.mark_expected_failures_and_skips() self.assertIs( expected_failure_test_function.__unittest_expecting_failure__, |
