Add Python version to run-tests

This commit is contained in:
BJ Dierkes 2013-08-12 17:35:21 -05:00
parent fbe52efa34
commit 47242c1652
5 changed files with 7 additions and 48 deletions

View File

@ -29,6 +29,10 @@ Features:
* :issue:`194` - Added pre_argument_parsing/post_argument_parsing hooks
* :issue:`196` - Added utils.misc.wrap
Incompatible:
* :issue:`173` - Deprecated 'has_key()' from configparser extension
2.1.2 - Thu Nov 1st, 2012 (DEVELOPMENT)
------------------------------------------------------------------------------

View File

@ -8,7 +8,6 @@ def config_validator(klass, obj):
members = [
'_setup',
'keys',
'has_key',
'get_sections',
'get_section_dict',
'get',

View File

@ -98,38 +98,6 @@ class ConfigParserConfigHandler(config.CementConfigHandler, RawConfigParser):
"""
return self.options(section)
def has_key(self, section, key):
"""
Return whether or not a 'section' has the given 'key'.
:param section: The section of the configuration.
I.e. [block_section].
:param key: The key within 'section'.
:returns: True if the config `section` has `key`.
:rtype: boolean
*This function is deprecated as of Cement 2.1.1, and will be removed
in future versions. Use `if 'key' in config.keys('section')`
instead.*
"""
if self.app._meta.ignore_deprecation_warnings:
LOG.debug("ConfigParserConfigHandler.has_key() is " +
"deprecated as of Cement 2.1.1. Please use " +
"`if key in app.config.keys(section)` " +
"instead.")
else:
LOG.warn("ConfigParserConfigHandler.has_key() is " +
"deprecated as of Cement 2.1.1. Please use " +
"`if key in app.config.keys(section)` " +
"instead. You can disable this warning by setting " +
"`ignore_deprecation_warnings = true` under the " +
"applications primary config section.")
if key in self.keys(section):
return True
else:
return False
def get_sections(self):
"""
Return a list of configuration sections or [blocks].

View File

@ -88,6 +88,8 @@ class CementDevtoolsController(CementBaseController):
@expose(help='run all unit tests')
def run_tests(self):
print('')
print('Python Version: %s' % sys.version)
print('')
print("Running Tests for Cement Version %s" % VERSION)
print('-' * 77)

View File

@ -3,18 +3,4 @@ from cement.utils import test
from cement.utils.misc import init_defaults
class ConfigParserConfigHandlerTestCase(test.CementTestCase):
def test_has_key(self):
defaults = init_defaults('test')
defaults['test']['foo'] = 'bar'
app = self.make_app(config_defaults=defaults)
app.setup()
self.eq(app.config.has_key('test', 'bogus'), False)
self.eq(app.config.has_key('test', 'foo'), True)
# same thing but ignore deprecation warning
app = self.make_app(
config_defaults=defaults,
ignore_deprecation_warnings=True
)
app.setup()
self.eq(app.config.has_key('test', 'bogus'), False)
pass