|
| 1 | +# Licensed to the .NET Foundation under one or more agreements. |
| 2 | +# The .NET Foundation licenses this file to you under the Apache 2.0 License. |
| 3 | +# See the LICENSE file in the project root for more information. |
| 4 | + |
| 5 | +## |
| 6 | +## Run selected tests from test_hash from StdLib |
| 7 | +## |
| 8 | + |
| 9 | +from iptest import is_ironpython, is_netcoreapp, is_cli32, generate_suite, run_test |
| 10 | + |
| 11 | +import test.test_hash |
| 12 | + |
| 13 | +def load_tests(loader, standard_tests, pattern): |
| 14 | + tests = loader.loadTestsFromModule(test.test_hash) |
| 15 | + |
| 16 | + if is_ironpython: |
| 17 | + test.test_hash.BytesHashRandomizationTests('test_empty_string') |
| 18 | + test.test_hash.BytesHashRandomizationTests('test_fixed_hash') |
| 19 | + test.test_hash.BytesHashRandomizationTests('test_long_fixed_hash') |
| 20 | + test.test_hash.HashBuiltinsTestCase('test_hashes') |
| 21 | + test.test_hash.HashEqualityTestCase('test_coerced_floats') |
| 22 | + test.test_hash.HashEqualityTestCase('test_coerced_integers') |
| 23 | + test.test_hash.HashEqualityTestCase('test_numeric_literals') |
| 24 | + test.test_hash.HashEqualityTestCase('test_unaligned_buffers') |
| 25 | + test.test_hash.HashInheritanceTestCase('test_default_hash') |
| 26 | + test.test_hash.HashInheritanceTestCase('test_error_hash') |
| 27 | + test.test_hash.HashInheritanceTestCase('test_fixed_hash') |
| 28 | + test.test_hash.HashInheritanceTestCase('test_hashable') |
| 29 | + test.test_hash.HashInheritanceTestCase('test_not_hashable') |
| 30 | + test.test_hash.MemoryviewHashRandomizationTests('test_empty_string') |
| 31 | + test.test_hash.MemoryviewHashRandomizationTests('test_fixed_hash') |
| 32 | + test.test_hash.MemoryviewHashRandomizationTests('test_long_fixed_hash') |
| 33 | + test.test_hash.StrHashRandomizationTests('test_empty_string') |
| 34 | + test.test_hash.StrHashRandomizationTests('test_fixed_hash') |
| 35 | + test.test_hash.StrHashRandomizationTests('test_long_fixed_hash') |
| 36 | + test.test_hash.StrHashRandomizationTests('test_ucs2_string') |
| 37 | + |
| 38 | + failing_tests = [ |
| 39 | + test.test_hash.BytesHashRandomizationTests('test_null_hash'), # KeyError: dotnet |
| 40 | + test.test_hash.MemoryviewHashRandomizationTests('test_null_hash'), # KeyError: dotnet |
| 41 | + test.test_hash.StrHashRandomizationTests('test_null_hash'), # KeyError: dotnet |
| 42 | + test.test_hash.DatetimeDateTests('test_randomized_hash'), |
| 43 | + test.test_hash.DatetimeDatetimeTests('test_randomized_hash'), |
| 44 | + test.test_hash.DatetimeTimeTests('test_randomized_hash'), |
| 45 | + ] |
| 46 | + |
| 47 | + if not is_netcoreapp: |
| 48 | + failing_tests += [ |
| 49 | + test.test_hash.BytesHashRandomizationTests('test_randomized_hash'), |
| 50 | + test.test_hash.MemoryviewHashRandomizationTests('test_randomized_hash'), |
| 51 | + test.test_hash.StrHashRandomizationTests('test_randomized_hash'), |
| 52 | + ] |
| 53 | + |
| 54 | + if is_cli32: |
| 55 | + failing_tests += [ |
| 56 | + test.test_hash.HashDistributionTestCase('test_hash_distribution'), |
| 57 | + ] |
| 58 | + |
| 59 | + skip_tests = [] |
| 60 | + |
| 61 | + return generate_suite(tests, failing_tests, skip_tests) |
| 62 | + |
| 63 | + else: |
| 64 | + return tests |
| 65 | + |
| 66 | +run_test(__name__) |
0 commit comments