1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
# -*- coding: utf-8 -*-
# preggy assertions
# https://github.com/heynemann/preggy
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2013 Bernardo Heynemann heynemann@gmail.com
from preggy import expect
#-----------------------------------------------------------------------------
TEST_DATA = frozenset([
10,
20,
30.5,
10 / 3
])
#-----------------------------------------------------------------------------
def is_expected(item):
expect(item).to_be_numeric()
#-----------------------------------------------------------------------------
def test_to_be_numeric():
for item in TEST_DATA:
is_expected(item)
|