Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b05129

Browse files
committed
Adjust test
1 parent5db80c3 commit0b05129

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

‎tests/test_method.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ def test_method_with_pointer_array_argument():
12591259

12601260
deftest_method_call_implicit_conversion():
12611261

1262-
classAnswer:
1262+
classIntAnswerMixin:
12631263
# For Python >= 3.8
12641264
def__index__(self):
12651265
return42
@@ -1268,7 +1268,10 @@ def __index__(self):
12681268
def__int__(self):
12691269
return42
12701270

1271-
classFloatAnswer(Answer):
1271+
classAnswer(int,IntAnswerMixin):
1272+
pass
1273+
1274+
classFloatAnswer(float,IntAnswerMixin):
12721275
def__float__(self):
12731276
return42.0
12741277

@@ -1281,3 +1284,13 @@ def __float__(self):
12811284
compare_to=min_value.CompareTo.__overloads__[t]
12821285

12831286
assertcompare_to(v)==-1
1287+
1288+
classSomeNonFloat:
1289+
def__float__(self):
1290+
return42.0
1291+
1292+
fortin [System.Double,System.Single]:
1293+
withpytest.raises(TypeError):
1294+
min_value=t(t.MinValue)
1295+
compare_to=min_value.CompareTo.__overloads__[t]
1296+
assertcompare_to(SomeNonFloat())==-1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp