Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,41 +236,41 @@ def test_one_dimensional(self):
self.ord_res.proportion_explained = \
self.ord_res.proportion_explained[:1].copy()

with self.assertRaisesRegexp(ValueError, "Ordinations with less than "
"two dimensions are not supported"):
with self.assertRaisesRegex(ValueError, "Ordinations with less than "
"two dimensions are not supported"):
Emperor(self.ord_res, self.mf, remote=False)

def test_initial_unbalanced_more_than_five(self):
mf = self.mf.copy()
mf.drop(['PC.354', 'PC.355', 'PC.356', 'PC.481', 'PC.607', 'PC.636'],
inplace=True)
with self.assertRaisesRegexp(KeyError, "There are samples not "
"included in the sample mapping file. "
"Override this error by using the "
"`ignore_missing_samples` argument. "
"Showing only the first 5 samples out of "
"6: PC.354, PC.355, PC.356, PC.481, "
"PC.607 ..."):
with self.assertRaisesRegex(KeyError, "There are samples not "
"included in the sample mapping file. "
"Override this error by using the "
"`ignore_missing_samples` argument. "
"Showing only the first 5 samples out of "
"6: PC.354, PC.355, PC.356, PC.481, "
"PC.607 ..."):
Emperor(self.ord_res, mf, remote=self.url)

def test_initial_unbalanced(self):
mf = self.mf.copy()
mf.drop(['PC.354'], inplace=True)
with self.assertRaisesRegexp(KeyError, "There are samples not "
"included in the sample mapping file. "
"Override this error by using the "
"`ignore_missing_samples` argument. "
"Offending samples: PC.354"):
with self.assertRaisesRegex(KeyError, "There are samples not "
"included in the sample mapping file. "
"Override this error by using the "
"`ignore_missing_samples` argument. "
"Offending samples: PC.354"):
Emperor(self.ord_res, mf, remote=self.url)

# test feature metadata
fmf = self.feature_mf.copy()
fmf.drop(['f.PC.636'], inplace=True)
with self.assertRaisesRegexp(KeyError, "There are features not "
"included in the feature mapping file. "
"Override this error by using the "
"`ignore_missing_samples` argument. "
"Offending features: f.PC.636"):
with self.assertRaisesRegex(KeyError, "There are features not "
"included in the feature mapping file. "
"Override this error by using the "
"`ignore_missing_samples` argument. "
"Offending features: f.PC.636"):
Emperor(self.biplot, self.mf, fmf, remote=self.url)

def test_initial_unbalanced_ignore(self):
Expand Down Expand Up @@ -322,21 +322,21 @@ def test_no_overlap(self):
mf = self.mf.copy()
mf.index = mf.index + '.not'

with self.assertRaisesRegexp(ValueError, 'None of the sample '
'identifiers match between the metadata '
'and the coordinates. Verify that you are'
' using metadata and coordinates '
'corresponding to the same dataset.'):
with self.assertRaisesRegex(ValueError, 'None of the sample '
'identifiers match between the metadata '
'and the coordinates. Verify that you are'
' using metadata and coordinates '
'corresponding to the same dataset.'):
Emperor(self.ord_res, mf, remote=self.url)

fmf = self.feature_mf.copy()
fmf.index = fmf.index + '.not'

with self.assertRaisesRegexp(ValueError, 'None of the feature '
'identifiers match between the metadata '
'and the coordinates. Verify that you are'
' using metadata and coordinates '
'corresponding to the same dataset.'):
with self.assertRaisesRegex(ValueError, 'None of the feature '
'identifiers match between the metadata '
'and the coordinates. Verify that you are'
' using metadata and coordinates '
'corresponding to the same dataset.'):
Emperor(self.biplot, self.mf, fmf, remote=self.url)

def test_get_template(self):
Expand Down
Loading