11import functools
22
3- from nose .tools import istest , assert_equal
4-
53from precisely import close_to , is_sequence
64from precisely .results import matched , unmatched
5+ from .testing import assert_equal
76
87
9- @istest
10- def close_to_matches_when_actual_is_close_to_value_plus_delta ():
8+ def test_close_to_matches_when_actual_is_close_to_value_plus_delta ():
119 matcher = close_to (42 , 1 )
1210 assert_equal (matched (), matcher .match (43 ))
1311 assert_equal (matched (), matcher .match (42.5 ))
@@ -17,8 +15,7 @@ def close_to_matches_when_actual_is_close_to_value_plus_delta():
1715 assert_equal (unmatched ("was 40 (2 away from 42)" ), matcher .match (40 ))
1816
1917
20- @istest
21- def close_to_matches_any_types_supporting_comparison_and_addition_and_subtraction ():
18+ def test_close_to_matches_any_types_supporting_comparison_and_addition_and_subtraction ():
2219 class Instant (object ):
2320 def __init__ (self , seconds_since_epoch ):
2421 self .seconds_since_epoch = seconds_since_epoch
@@ -64,13 +61,11 @@ def __repr__(self):
6461 assert_equal (unmatched ("was Instant(40) (Interval(2) away from Instant(42))" ), matcher .match (Instant (40 )))
6562
6663
67- @istest
68- def close_to_description_describes_value ():
64+ def test_close_to_description_describes_value ():
6965 matcher = close_to (42 , 1 )
7066 assert_equal ("close to 42 +/- 1" , matcher .describe ())
7167
7268
73- @istest
74- def close_to_can_be_used_in_composite_matcher ():
69+ def test_close_to_can_be_used_in_composite_matcher ():
7570 matcher = is_sequence ("a" , "b" , close_to (42 , 1 ))
7671 assert_equal (matched (), matcher .match (("a" , "b" , 42 )))
0 commit comments