Skip to content

Commit

Permalink
fix: re-enable Django deprecation warnings (#32277)
Browse files Browse the repository at this point in the history
* fix: re-enable Django deprecation warnings
---------

Co-authored-by: UsamaSadiq <[email protected]>
  • Loading branch information
iamsobanjaved and UsamaSadiq authored Aug 7, 2023
1 parent 4e75a89 commit 2732934
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 0 additions & 2 deletions cms/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit:UserWarning
ignore::xblock.exceptions.FieldDataDeprecationWarning
ignore::django.utils.deprecation.RemovedInDjango40Warning
ignore::django.utils.deprecation.RemovedInDjango41Warning
norecursedirs = envs
python_classes =
python_files = test.py tests.py test_*.py *_tests.py
2 changes: 0 additions & 2 deletions common/test/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit:UserWarning
ignore::xblock.exceptions.FieldDataDeprecationWarning
ignore::django.utils.deprecation.RemovedInDjango40Warning
ignore::django.utils.deprecation.RemovedInDjango41Warning
norecursedirs = .cache
16 changes: 8 additions & 8 deletions openedx/core/lib/logsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ def log_python_warnings():
warnings.filterwarnings('ignore', 'Setting _field_data is deprecated')
warnings.filterwarnings('ignore', 'Setting _field_data via the constructor is deprecated')
warnings.filterwarnings('ignore', '.*unclosed.*', category=ResourceWarning)
try:
# There are far too many of these deprecation warnings in startup to output for every management command;
# suppress them until we've fixed at least the most common ones as reported by the test suite
from django.utils.deprecation import RemovedInDjango40Warning, RemovedInDjango41Warning
warnings.simplefilter('ignore', RemovedInDjango40Warning)
warnings.simplefilter('ignore', RemovedInDjango41Warning)
except ImportError:
pass
# try:
# # There are far too many of these deprecation warnings in startup to output for every management command;
# # suppress them until we've fixed at least the most common ones as reported by the test suite
# from django.utils.deprecation import RemovedInDjango50Warning, RemovedInDjango51Warning
# warnings.simplefilter('ignore', RemovedInDjango50Warning)
# warnings.simplefilter('ignore', RemovedInDjango51Warning)
# except ImportError:
# pass
logging.captureWarnings(True)


Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit:UserWarning
ignore::xblock.exceptions.FieldDataDeprecationWarning
ignore::django.utils.deprecation.RemovedInDjango40Warning
ignore::django.utils.deprecation.RemovedInDjango41Warning
junit_family = xunit2
norecursedirs = .* *.egg build conf dist node_modules test_root cms/envs lms/envs
python_classes =
Expand Down

0 comments on commit 2732934

Please sign in to comment.