Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2818] remove legacy test import hack
- Loading branch information
Showing
1 changed file
with
0 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||