Kaydet (Commit) b9dd8512 authored tarafından Tim Graham's avatar Tim Graham

Advanced deprecation warnings for Django 2.2.

üst 74a31394
...@@ -2,14 +2,17 @@ import inspect ...@@ -2,14 +2,17 @@ import inspect
import warnings import warnings
class RemovedInDjango30Warning(PendingDeprecationWarning): class RemovedInDjango30Warning(DeprecationWarning):
pass pass
class RemovedInNextVersionWarning(DeprecationWarning): class RemovedInDjango31Warning(PendingDeprecationWarning):
pass pass
RemovedInNextVersionWarning = RemovedInDjango30Warning
class warn_about_renamed_method: class warn_about_renamed_method:
def __init__(self, class_name, old_method_name, new_method_name, deprecation_warning): def __init__(self, class_name, old_method_name, new_method_name, deprecation_warning):
self.class_name = class_name self.class_name = class_name
......
...@@ -7,6 +7,14 @@ in a backward incompatible way, following their deprecation, as per the ...@@ -7,6 +7,14 @@ in a backward incompatible way, following their deprecation, as per the
:ref:`deprecation policy <internal-release-deprecation-policy>`. More details :ref:`deprecation policy <internal-release-deprecation-policy>`. More details
about each item can often be found in the release notes of two versions prior. about each item can often be found in the release notes of two versions prior.
.. _deprecation-removed-in-3.1:
3.1
---
See the :ref:`Django 2.2 release notes <deprecated-features-2.2>` for more
details on these changes.
.. _deprecation-removed-in-3.0: .. _deprecation-removed-in-3.0:
3.0 3.0
......
...@@ -17,7 +17,9 @@ from django.test import TestCase, TransactionTestCase ...@@ -17,7 +17,9 @@ from django.test import TestCase, TransactionTestCase
from django.test.runner import default_test_processes from django.test.runner import default_test_processes
from django.test.selenium import SeleniumTestCaseBase from django.test.selenium import SeleniumTestCaseBase
from django.test.utils import get_runner from django.test.utils import get_runner
from django.utils.deprecation import RemovedInDjango30Warning from django.utils.deprecation import (
RemovedInDjango30Warning, RemovedInDjango31Warning,
)
from django.utils.log import DEFAULT_LOGGING from django.utils.log import DEFAULT_LOGGING
try: try:
...@@ -30,6 +32,7 @@ else: ...@@ -30,6 +32,7 @@ else:
# Make deprecation warnings errors to ensure no usage of deprecated features. # Make deprecation warnings errors to ensure no usage of deprecated features.
warnings.simplefilter("error", RemovedInDjango30Warning) warnings.simplefilter("error", RemovedInDjango30Warning)
warnings.simplefilter('error', RemovedInDjango31Warning)
# Make runtime warning errors to ensure no usage of error prone patterns. # Make runtime warning errors to ensure no usage of error prone patterns.
warnings.simplefilter("error", RuntimeWarning) warnings.simplefilter("error", RuntimeWarning)
# Ignore known warnings in test dependencies. # Ignore known warnings in test dependencies.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment