In lots of the tests, an exception was caught as shown below, with an assertEqual to ensure that the error message matches what the exception that is caught:
with self.assertRaises(ValueError) as cm:
_ = PCovFPS(n_to_select=1, mixing=1.0)
self.assertEqual(
str(cm.exception),
"Mixing = 1.0 corresponds to traditional FPS." "Please use the FPS class.",
)
However, when the exception is caught (at _ = PCovFPS(n_to_select=1, mixing=1.0) in the example above), the rest of the code in the with method does not execute, and so the assertEqual tests were not run.
I have fixed these indentation errors in the following manner, for the example above:
with self.assertRaises(ValueError) as cm:
_ = PCovFPS(n_to_select=1, mixing=1.0)
self.assertEqual(
str(cm.exception),
"Mixing = 1.0 corresponds to traditional FPS." "Please use the FPS class.",
)
Once the code executed properly, I additionally fixed some tests that were not functioning properly or raising warnings. Examples of errors that led to failed tests/warnings include:
Using self.assertTrue() rather than self.assertEqual()
Typos in the string passed to self.assertEqual()
Using self.assertEquals() rather than self.assertEqual()(Deprecation warning)
Forgetting to fit a GreedySelector in the test (when the test was not meant to check this error, obviously)
I also made some minor changes/typo fixes to error messages in the VoronoiFPS and SparseKernelCenterer classes.
In lots of the tests, an exception was caught as shown below, with an assertEqual to ensure that the error message matches what the exception that is caught:
However, when the exception is caught (at
_ = PCovFPS(n_to_select=1, mixing=1.0)
in the example above), the rest of the code in thewith
method does not execute, and so the assertEqual tests were not run.I have fixed these indentation errors in the following manner, for the example above:
Once the code executed properly, I additionally fixed some tests that were not functioning properly or raising warnings. Examples of errors that led to failed tests/warnings include:
self.assertTrue()
rather thanself.assertEqual()
self.assertEqual()
self.assertEquals()
rather thanself.assertEqual()
(Deprecation warning)I also made some minor changes/typo fixes to error messages in the VoronoiFPS and SparseKernelCenterer classes.