44
55In particular, Rationalize and RealValuNumberQ
66"""
7- from test .helper import check_evaluation
7+ from test .helper import check_evaluation , check_wrong_number_of_arguments
88
99import pytest
1010
@@ -121,7 +121,7 @@ def test_realvalued():
121121 ('Sign["20"]' , None , "Sign[20]" , None ),
122122 ],
123123)
124- def test_private_doctests_numeric (str_expr , msgs , str_expected , fail_msg ):
124+ def test_numeric (str_expr , msgs , str_expected , fail_msg ):
125125 """ """
126126 check_evaluation (
127127 str_expr ,
@@ -135,36 +135,23 @@ def test_private_doctests_numeric(str_expr, msgs, str_expected, fail_msg):
135135
136136
137137@pytest .mark .parametrize (
138- ("str_expr" , "msgs" , " assert_fail_msg" ),
138+ ("str_expr" , "assert_fail_msg" ),
139139 [
140140 (
141141 "Round[a, b]" ,
142- None ,
143142 "Round with one symbolic argument should not give an error message" ,
144143 ),
145144 (
146145 "Round[a, b]" ,
147- None ,
148146 "Round with two symbolic arguments should not give an error message" ,
149147 ),
150- (
151- "Round[a, b, c]" ,
152- ("Round called with 3 arguments; 1 or 2 arguments are expected." ,),
153- "Round wrong number of arguments" ,
154- ),
155148 (
156149 "Sign[x]" ,
157- None ,
158150 "Sign with one symbolic argument should not give an error message" ,
159151 ),
160- (
161- "Sign[4, 5, 6]" ,
162- ("Sign called with 3 arguments; 1 argument is expected." ,),
163- "Sign wrong number of arguments" ,
164- ),
165152 ],
166153)
167- def test_wrong_number_of_arguments (str_expr , msgs , assert_fail_msg ):
154+ def test_right_number_of_arguments (str_expr , assert_fail_msg ):
168155 """ """
169156 check_evaluation (
170157 str_expr ,
@@ -173,5 +160,21 @@ def test_wrong_number_of_arguments(str_expr, msgs, assert_fail_msg):
173160 to_string_expected = True ,
174161 hold_expected = True ,
175162 failure_message = assert_fail_msg ,
176- expected_messages = msgs ,
163+ expected_messages = None ,
177164 )
165+
166+
167+ def test_wrong_number_of_arguments ():
168+ tests = [
169+ (
170+ "Round[a, b, c]" ,
171+ ["Round called with 3 arguments; 1 or 2 arguments are expected." ],
172+ "Round wrong number of arguments" ,
173+ ),
174+ (
175+ "Sign[4, 5, 6]" ,
176+ ["Sign called with 3 arguments; 1 argument is expected." ],
177+ "Sign wrong number of arguments" ,
178+ ),
179+ ]
180+ check_wrong_number_of_arguments (tests )
0 commit comments