# HG changeset patch # User Marc Abramowitz # Date 2015-04-08 22:48:30 # Node ID 177ccc998b040a5c3aedb793b73873a9ea156270 # Parent 9885bbacf99cde27572447ae22cf9733523eea9e tests: Remove imported_from_test function AFAICT, this function is not used: $ ag imported_from_test kallithea/tests/nose_parametrized.py 144:def imported_from_test(): diff --git a/kallithea/tests/nose_parametrized.py b/kallithea/tests/nose_parametrized.py --- a/kallithea/tests/nose_parametrized.py +++ b/kallithea/tests/nose_parametrized.py @@ -141,20 +141,6 @@ def assert_not_contains(haystack, needle raise AssertionError("%r in %r" % (needle, haystack)) -def imported_from_test(): - """ Returns true if it looks like this module is being imported by unittest - or nose. """ - import re - import inspect - nose_re = re.compile(r"\bnose\b") - unittest_re = re.compile(r"\bunittest2?\b") - for frame in inspect.stack(): - file = frame[1] - if nose_re.search(file) or unittest_re.search(file): - return True - return False - - def assert_raises(func, exc_type, str_contains=None, repr_contains=None): try: func()