Skip to content

Commit

Permalink
improve coverage, update to v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenggaoZhu committed May 17, 2016
1 parent 5a0e556 commit 2815271
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ install:

# command to run tests
script:
- coverage run tests/tests.py
- coverage run --source midict tests/tests.py

after_success:
coveralls
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ Test

``python tests/tests.py``

Tested with both Python 2.7 and Python 3.5.
Tested with both Python 2.7 and Python 3,3, 3.4, 3.5.
20 changes: 4 additions & 16 deletions midict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import sys

__version__ = '0.1.0'
__version__ = '0.1.1'


PY2 = sys.version_info[0] == 2
Expand Down Expand Up @@ -1199,10 +1199,7 @@ def __iter__(self, index=None):
yield x

else:
if index is None:
for x in ():
yield x
else:
if index is not None:
raise KeyError('Index not found (dictionary is empty): %s' % (index,))


Expand All @@ -1219,10 +1216,7 @@ def __reversed__(self, index=None):
for x in reversed(self.indices[index]):
yield x
else:
if index is None:
for x in ():
yield x
else:
if index is not None:
raise KeyError('Index not found (dictionary is empty): %s' % (index,))


Expand Down Expand Up @@ -1683,10 +1677,7 @@ def itervalues(self): # single index
for x in self._mapping.iterkeys(index):
yield x
else:
if index is None:
for x in ():
yield x
else:
if index is not None:
raise KeyError('Index not found (dictionary is empty): %s' % (index,))

def iteritems(self):
Expand All @@ -1696,9 +1687,6 @@ def iteritems(self):
-1 if self.index_value is None else self.index_value])
for x in items:
yield x
else:
for x in ():
yield x

def keys(self):
return list(self.iterkeys())
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def split(self, *args, **kw):
name=package_name,
version=find_version(package_name, '__init__.py'),
url='https://github.com/ShenggaoZhu/midict',
download_url = 'https://codeload.github.com/ShenggaoZhu/midict/zip/v0.1.0',
download_url = 'https://codeload.github.com/ShenggaoZhu/midict/zip/v0.1.1',
license='MIT',
description=
'MIDict is an ordered "dictionary" with multiple indices '
Expand Down

0 comments on commit 2815271

Please sign in to comment.