Skip to content

Commit

Permalink
[#1692] suppress DeprecationWarning on test of invalid data to int_va…
Browse files Browse the repository at this point in the history
…lidator
  • Loading branch information
wardi committed Apr 29, 2014
1 parent 0d00ac2 commit f1ebce1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckan/new_tests/logic/test_validators.py
Expand Up @@ -479,6 +479,7 @@ def test_int_validator_invalid(self):
import ckan.logic.validators as validators
from fractions import Fraction
from decimal import Decimal
import warnings

invalid_values = [
42.5,
Expand All @@ -490,8 +491,10 @@ def test_int_validator_invalid(self):
1 + 1j,
1 + 0j, # int(complex) fails, so expect the same
]
for v in invalid_values:
raises_Invalid(validators.int_validator)(v, None)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
for v in invalid_values:
raises_Invalid(validators.int_validator)(v, None)


#TODO: Need to test when you are not providing owner_org and the validator
Expand Down

0 comments on commit f1ebce1

Please sign in to comment.