def test_find_pooling_constant_bad_divisor(): """Test error when trying to downsample to a non-divisor of the features""" with pytest.raises(ValueError): _find_pooling_constant(POOLING_FEATURES, 40) with pytest.raises(ValueError): _find_pooling_constant(POOLING_FEATURES, 0)
def test_find_pooling_constant(): """Test that pooling constant given correct answer with good inputs""" assert _find_pooling_constant(POOLING_FEATURES, 6) == 10
def test_find_pooling_constant_upsample(): """Test error when trying to upsample""" with pytest.raises(ValueError): _find_pooling_constant(POOLING_FEATURES, 120)