Skip to content
Snippets Groups Projects
Commit 6ee5c1df authored by Reimar H Leike's avatar Reimar H Leike
Browse files

catches expected exceptions

parent c65e1b06
No related branches found
No related tags found
3 merge requests!107Master,!102Test power space,!101Test power space
Pipeline #
......@@ -114,11 +114,18 @@ class PowerSpaceConsistencyCheck(unittest.TestCase):
def test_pipundexInversion(self, harmonic_partner, distribution_strategy,
logarithmic, nbin, binbounds, expected):
#expected will not be used TODO: write expandproduct to use for this
p = PowerSpace(harmonic_partner=harmonic_partner,
if 'error' in expected:
with assert_raises(expected['error']):
PowerSpace(harmonic_partner=harmonic_partner,
distribution_strategy=distribution_strategy,
logarithmic=logarithmic, nbin=nbin,
binbounds=binbounds)
else:
p = PowerSpace(harmonic_partner=harmonic_partner,
distribution_strategy=distribution_strategy,
logarithmic=logarithmic, nbin=nbin,
binbounds=binbounds)
assert_equal(p.pindex[p.pundex],np.arange(p.dim),err_msg='pundex is not right-inverse of pindex!')
assert_equal(p.pindex[p.pundex],np.arange(p.dim),err_msg='pundex is not right-inverse of pindex!')
class PowerSpaceFunctionalityTest(unittest.TestCase):
@expand(CONSTRUCTOR_CONFIGS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment