Repository navigation
Expand file tree
/
Copy pathtest_functools_stdlib.py
More file actions
42 lines (33 loc) · 2.16 KB
/
Copy pathtest_functools_stdlib.py
File metadata and controls
42 lines (33 loc) · 2.16 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
##
## Run selected tests from test_functools from StdLib
##
from iptest import is_ironpython, generate_suite, run_test, is_mono
import test.test_functools
def load_tests(loader, standard_tests, pattern):
tests = loader.loadTestsFromModule(test.test_functools)
if is_ironpython:
failing_tests = [
test.test_functools.TestCmpToKeyC('test_bad_cmp'), # TypeError: cmp_to_key() takes exactly 1 argument (2 given)
test.test_functools.TestCmpToKeyC('test_cmp_to_key'), # TypeError: cmp_to_key() takes exactly 1 argument (2 given)
test.test_functools.TestCmpToKeyC('test_cmp_to_key_arguments'), # TypeError: cmp_to_key() takes exactly 1 argument (2 given)
test.test_functools.TestCmpToKeyC('test_hash'), # TypeError: cmp_to_key() takes exactly 1 argument (2 given)
test.test_functools.TestCmpToKeyC('test_obj_field'), # TypeError: cmp_to_key() takes exactly 1 argument (2 given)
test.test_functools.TestCmpToKeyC('test_sort_int'), # TypeError: cmp_to_key() takes exactly 1 argument (2 given)
test.test_functools.TestCmpToKeyC('test_sort_int_str'), # TypeError: cmp_to_key() takes exactly 1 argument (2 given)
test.test_functools.TestPartialC('test_setstate_refcount'), # AttributeError: 'partial' object has no attribute '__setstate__'
test.test_functools.TestPartialCSubclass('test_attributes_unwritable'), # AssertionError: AttributeError not raised by setattr
test.test_functools.TestPartialCSubclass('test_repr'), # AssertionError
test.test_functools.TestPartialCSubclass('test_setstate_refcount'), # AttributeError: 'PartialSubclass' object has no attribute '__setstate__'
]
skip_tests = []
if is_mono:
skip_tests += [
test.test_functools.TestPartialPy('test_weakref'),
]
return generate_suite(tests, failing_tests, skip_tests)
else:
return tests
run_test(__name__)