##// END OF EJS Templates
add IPython.utils.tz...
add IPython.utils.tz Basic support for tz-aware UTC methods on date time objects. The raw `utcfoo` methods still produce naïve objects, so they are wrapped in a simple zero-offset tz-aware object. This allows jsonutil to publish the timezone info, eliminating the ambiguity of naïve timestamps (Firefox assumes local time, WebKit UTC).

File last commit:

r8096:cc2ccfb5
r11144:e8549ce5
Show More
nose_assert_methods.py
29 lines | 834 B | text/x-python | PythonLexer
"""Add some assert methods to nose.tools. These were added in Python 2.7/3.1, so
once we stop testing on Python 2.6, this file can be removed.
"""
import nose.tools as nt
def assert_in(item, collection):
assert item in collection, '%r not in %r' % (item, collection)
if not hasattr(nt, 'assert_in'):
nt.assert_in = assert_in
def assert_not_in(item, collection):
assert item not in collection, '%r in %r' % (item, collection)
if not hasattr(nt, 'assert_not_in'):
nt.assert_not_in = assert_not_in
def assert_is_none(obj):
assert obj is None, '%r is not None' % obj
if not hasattr(nt, 'assert_is_none'):
nt.assert_is_none = assert_is_none
def assert_is_not_none(obj):
assert obj is not None, '%r is None' % obj
if not hasattr(nt, 'assert_is_not_none'):
nt.assert_is_not_none = assert_is_not_none