Skip to content

Commit

Permalink
[#2818] remove legacy test import hack
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Dec 31, 2015
1 parent 61f59d8 commit 65a40b6
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions ckan/tests/__init__.py
@@ -1,27 +0,0 @@
# FIXME: remove everything in this file for ckan 2.5
import sys


class _LegacyTestsBackwardsCompat(object):
"""
Import provides (temporarily) backward compatibility for extensions that
pre-date the move of tests from ckan.tests to ckan.test.legacy.
"""

# things our object-pretending-to-be-a-module need:
__path__ = __path__
__name__ = __name__

def __getattr__(self, name):
import ckan.tests.legacy
import logging
value = getattr(ckan.tests.legacy, name)
log = logging.getLogger('ckan.tests')
log.warn(
"ckan.tests has been renamed to ckan.tests.legacy."
"In the next release legacy tests will only be available "
"from ckan.tests.legacy.")
return value

# https://mail.python.org/pipermail/python-ideas/2012-May/014969.html
sys.modules[__name__] = _LegacyTestsBackwardsCompat()

0 comments on commit 65a40b6

Please sign in to comment.