Skip to content

Commit 4d390ea

Browse files
authored
Test Suite Updates & Cleanup (#240)
* Remove deprecated assert_equals * Use logger.warning instead of logger.warn * Use self.assertEqual * Skip unstable tests * Update test methods * Skip unstable tests
1 parent 5f661ff commit 4d390ea

File tree

15 files changed

+250
-258
lines changed

15 files changed

+250
-258
lines changed

instana/agent/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def can_send(self):
2727
return True
2828

2929
def report_traces(self, spans):
30-
logger.warn("Tried to report_traces with a TestAgent!")
30+
logger.warning("Tried to report_traces with a TestAgent!")
3131

3232

instana/collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def start(self):
3131
t.setDaemon(True)
3232
t.start()
3333
else:
34-
logger.warn("Collector started but the agent tells us we can't send anything out.")
34+
logger.warning("Collector started but the agent tells us we can't send anything out.")
3535

3636
def shutdown(self):
3737
logger.debug("Collector.shutdown: Reporting final data.")

instana/hooks/hook_uwsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
opt_lazy_apps = uwsgi.opt.get('lazy-apps', False)
1717

1818
if uwsgi.opt.get('enable-threads', False) is False and uwsgi.opt.get('gevent', False) is False:
19-
logger.warn("Required: Neither uWSGI threads or gevent is enabled. " +
19+
logger.warning("Required: Neither uWSGI threads or gevent is enabled. " +
2020
"Please enable by using the uWSGI --enable-threads or --gevent option.")
2121

2222
if opt_master and opt_lazy_apps is False:

instana/instrumentation/django/middleware.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def load_middleware_wrapper(wrapped, instance, args, kwargs):
9090
elif type(settings.MIDDLEWARE) is list:
9191
settings.MIDDLEWARE = [DJ_INSTANA_MIDDLEWARE] + settings.MIDDLEWARE
9292
else:
93-
logger.warn("Instana: Couldn't add InstanaMiddleware to Django")
93+
logger.warning("Instana: Couldn't add InstanaMiddleware to Django")
9494

9595
elif hasattr(settings, 'MIDDLEWARE_CLASSES') and settings.MIDDLEWARE_CLASSES is not None:
9696
if DJ_INSTANA_MIDDLEWARE in settings.MIDDLEWARE_CLASSES:
@@ -104,14 +104,14 @@ def load_middleware_wrapper(wrapped, instance, args, kwargs):
104104
elif type(settings.MIDDLEWARE_CLASSES) is list:
105105
settings.MIDDLEWARE_CLASSES = [DJ_INSTANA_MIDDLEWARE] + settings.MIDDLEWARE_CLASSES
106106
else:
107-
logger.warn("Instana: Couldn't add InstanaMiddleware to Django")
107+
logger.warning("Instana: Couldn't add InstanaMiddleware to Django")
108108

109109
else:
110-
logger.warn("Instana: Couldn't find middleware settings")
110+
logger.warning("Instana: Couldn't find middleware settings")
111111

112112
return wrapped(*args, **kwargs)
113113
except Exception:
114-
logger.warn("Instana: Couldn't add InstanaMiddleware to Django: ", exc_info=True)
114+
logger.warning("Instana: Couldn't add InstanaMiddleware to Django: ", exc_info=True)
115115

116116

117117
try:

instana/meter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def metric_work():
177177
self.process()
178178

179179
if self.agent.is_timed_out():
180-
logger.warn("Instana host agent unreachable for >1 min. Going to sit in a corner...")
180+
logger.warning("Instana host agent unreachable for >1 min. Going to sit in a corner...")
181181
self.agent.reset()
182182
return False
183183
return True

instana/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def get_default_gateway():
255255
return "%i.%i.%i.%i" % (int(hip[6:8], 16), int(hip[4:6], 16), int(hip[2:4], 16), int(hip[0:2], 16))
256256

257257
except Exception:
258-
logger.warn("get_default_gateway: ", exc_info=True)
258+
logger.warning("get_default_gateway: ", exc_info=True)
259259

260260

261261
def get_py_source(file):

setup.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)