Skip to content

Commit

Permalink
Switching to pandas.isna, because of variability in pandas version.
Browse files Browse the repository at this point in the history
  • Loading branch information
emarinier committed Aug 16, 2023
1 parent d7ff070 commit 96a6edb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions staramr/tests/unit/results/test_ARGDrugTablePointfinder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import unittest
import math
import pandas

from staramr.databases.resistance.pointfinder.ARGDrugTablePointfinder import ARGDrugTablePointfinder

Expand All @@ -16,6 +16,7 @@ def testNoneEntry(self):
# Tests when the entry for the drug is "None"
drug = self.arg_drug_table.get_drug("escherichia_coli", "parC", 57)

# Specifically, we're interested in it not crashing, and the current behaviour is to return NaN.
print("The drug is: " + str(drug))
self.assertTrue(math.isnan(drug))
# Specifically, we're interested in it not crashing.
# Depending on the version of pandas, this may return NaN or None.
# Checking for NA using the pandas function helps capture this variability.
self.assertTrue(pandas.isna(drug))

0 comments on commit 96a6edb

Please sign in to comment.