Skip to content

Commit 65481b5

Browse files
committed
Moved warnings settings from manage.py and test_runner.py to one single place, settings.py. Decreased the verbosity level when invoking 'loaddata' from the test runner.
- Legacy-Id: 12535
1 parent fec5772 commit 65481b5

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

ietf/manage.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env python
22

3-
import warnings
4-
warnings.filterwarnings("ignore",category=DeprecationWarning)
5-
63
import os
74
import sys
85

ietf/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
import os
88
import sys
99
import datetime
10+
import warnings
11+
12+
warnings.simplefilter("always", DeprecationWarning)
13+
warnings.filterwarnings("ignore", message="Report.file_reporters will no longer be available in Coverage.py 4.2", module="coverage.report")
14+
warnings.filterwarnings("ignore", message="initial_data fixtures are deprecated. Use data migrations instead.", module="django.core.management.commands.loaddata")
15+
warnings.filterwarnings("ignore", message="The popen2 module is deprecated. Use the subprocess module.", module="ietf.utils.pipe")
1016

1117
try:
1218
import syslog

ietf/utils/test_runner.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import pytz
4242
import importlib
4343
import socket
44-
import warnings
4544
import datetime
4645
import codecs
4746
import gzip
@@ -87,7 +86,7 @@ def safe_create_1(self, verbosity, *args, **kwargs):
8786
if settings.GLOBAL_TEST_FIXTURES:
8887
print " Loading global test fixtures: %s" % ", ".join(settings.GLOBAL_TEST_FIXTURES)
8988
loadable = [f for f in settings.GLOBAL_TEST_FIXTURES if "." not in f]
90-
call_command('loaddata', *loadable, verbosity=verbosity, commit=False, database="default")
89+
call_command('loaddata', *loadable, verbosity=int(verbosity)-1, commit=False, database="default")
9190

9291
for f in settings.GLOBAL_TEST_FIXTURES:
9392
if f not in loadable:
@@ -96,8 +95,6 @@ def safe_create_1(self, verbosity, *args, **kwargs):
9695
module = importlib.import_module(".".join(components[:-1]))
9796
fn = getattr(module, components[-1])
9897
fn()
99-
if verbosity < 2:
100-
warnings.simplefilter("ignore", DeprecationWarning)
10198

10299
return test_database_name
103100

0 commit comments

Comments
 (0)