Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
redefine assertIsNone if using python<2.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Frasca committed Jan 3, 2015
1 parent e2b4318 commit d19545b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 7 additions & 0 deletions bauble/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ def tearDown(self):
db.metadata.drop_all(bind=db.engine)
bauble.pluginmgr.commands.clear()
pluginmgr.plugins.clear()

# assertIsNone is not available before 2.7
import sys
if sys.version_info[:2] < (2, 7):
def assertIsNone(self, item):
self.assertTrue(item is None)

7 changes: 1 addition & 6 deletions bauble/test/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,7 @@ def test_look_for_wrong_strategy(self):

mapper_search = search.get_strategy('NotExisting')

# assertIsNone is not available before 2.7
import sys
if sys.version_info[:2] <= (2, 6):
self.assertTrue(mapper_search is None)
elif sys.version_info[:2] >= (2, 7):
self.assertIsNone(mapper_search)
self.assertIsNone(mapper_search)

def test_search_by_values(self):
"""
Expand Down

0 comments on commit d19545b

Please sign in to comment.