Permalink
Browse files

Use isinstance() for type comparisons.

  • Loading branch information...
1 parent 3bfb4bb commit 332494cb9a840b354f6c9317c15b2911ca77b4e8 @cbrueffer cbrueffer committed with peterjc Dec 4, 2012
Showing with 8 additions and 8 deletions.
  1. +4 −4 Tests/test_PopGen_FDist_nodepend.py
  2. +4 −4 Tests/test_PopGen_GenePop_nodepend.py
@@ -20,10 +20,10 @@ def test_record_basic(self):
"""
r = FDist.Record()
- assert type(r.data_org) == int
- assert type(r.num_pops) == int
- assert type(r.num_loci) == int
- assert type(r.loci_data) == list
+ assert isinstance(r.data_org, int)
+ assert isinstance(r.num_pops, int)
+ assert isinstance(r.num_loci, int)
+ assert isinstance(r.loci_data, list)
class ParserTest(unittest.TestCase):
def setUp(self):
@@ -16,10 +16,10 @@ def test_record_basic(self):
"""
r = GenePop.Record()
- assert type(r.marker_len) == int
- assert type(r.comment_line) == str
- assert type(r.loci_list) == list
- assert type(r.populations) == list
+ assert isinstance(r.marker_len, int)
+ assert isinstance(r.comment_line, str)
+ assert isinstance(r.loci_list, list)
+ assert isinstance(r.populations, list)
class ParserTest(unittest.TestCase):

0 comments on commit 332494c

Please sign in to comment.