diff --git a/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini b/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini index d355219b6..480ee70b6 100644 --- a/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini +++ b/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini @@ -603,9 +603,8 @@ Ignore=true [CPython.test_lib2to3] Ignore=true -# TODO: 3.6 -#[CPython.test_linecache] -#Ignore=true # blocked by https://github.com/IronLanguages/ironpython3/issues/1245 - using the test_linecache_stdlib approach makes the issue disappear... +[CPython.test_linecache] # IronPython.test_linecache_stdlib +Ignore=true [CPython.test_list] IsolationLevel=ENGINE diff --git a/tests/suite/test_datetime_stdlib.py b/tests/suite/test_datetime_stdlib.py index 831a69d69..54742c183 100644 --- a/tests/suite/test_datetime_stdlib.py +++ b/tests/suite/test_datetime_stdlib.py @@ -63,12 +63,10 @@ def load_tests(loader, standard_tests, pattern): test.datetimetester.TestDateTime('test_compat_unpickle'), # TypeError: function takes at least 3 arguments (1 given) test.datetimetester.TestDateTime('test_isoformat'), # TypeError: isoformat() got an unexpected keyword argument 'timespec' test.datetimetester.TestDateTime('test_subclass_replace'), # TypeError: replace() got an unexpected keyword argument 'year' - test.datetimetester.TestDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime. test.datetimetester.TestDateTimeTZ('test_bad_constructor_arguments'), # https://github.com/IronLanguages/ironpython3/issues/1459 test.datetimetester.TestDateTimeTZ('test_compat_unpickle'), # TypeError: function takes at least 3 arguments (2 given) test.datetimetester.TestDateTimeTZ('test_isoformat'), # TypeError: isoformat() got an unexpected keyword argument 'timespec' test.datetimetester.TestDateTimeTZ('test_subclass_replace'), # TypeError: replace() got an unexpected keyword argument 'year' - test.datetimetester.TestDateTimeTZ('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime. test.datetimetester.TestLocalTimeDisambiguation('test_comparison'), # https://github.com/IronLanguages/ironpython3/issues/1459 test.datetimetester.TestLocalTimeDisambiguation('test_constructors'), # https://github.com/IronLanguages/ironpython3/issues/1459 test.datetimetester.TestLocalTimeDisambiguation('test_dst'), # https://github.com/IronLanguages/ironpython3/issues/1459 @@ -91,7 +89,6 @@ def load_tests(loader, standard_tests, pattern): test.datetimetester.TestSubclassDateTime('test_compat_unpickle'), # TypeError: function takes at least 3 arguments (1 given) test.datetimetester.TestSubclassDateTime('test_isoformat'), # TypeError: isoformat() got an unexpected keyword argument 'timespec' test.datetimetester.TestSubclassDateTime('test_subclass_replace'), # TypeError: replace() got an unexpected keyword argument 'year' - test.datetimetester.TestSubclassDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime. test.datetimetester.TestTime('test_backdoor_resistance'), # AssertionError: "^bad tzinfo state arg$" does not match "expected Int32, got bytes" test.datetimetester.TestTime('test_compat_unpickle'), # TypeError: expected Int32, got str test.datetimetester.TestTime('test_isoformat'), # TypeError: isoformat() takes no arguments (1 given) @@ -112,6 +109,12 @@ def load_tests(loader, standard_tests, pattern): test.datetimetester.TestTimeDelta('test_overflow'), # rounding differences ] if sys.version_info >= (3, 6): + skip_tests += [ + # these can fail with a ValueError if the current time zone is not UTC + test.datetimetester.TestDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime. + test.datetimetester.TestDateTimeTZ('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime. + test.datetimetester.TestSubclassDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime. + ] for test_or_suite in tests: if isinstance(test_or_suite, test.datetimetester.ZoneInfoCompleteTest): for t in test_or_suite: diff --git a/tests/suite/test_linecache_stdlib.py b/tests/suite/test_linecache_stdlib.py new file mode 100644 index 000000000..162deb834 --- /dev/null +++ b/tests/suite/test_linecache_stdlib.py @@ -0,0 +1,31 @@ +# 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_linecache from StdLib +## + +import sys + +from iptest import is_ironpython, generate_suite, run_test + +import test.test_linecache + +def load_tests(loader, standard_tests, pattern): + tests = loader.loadTestsFromModule(test.test_linecache, pattern=pattern) + + if is_ironpython: + # There are no failing tests when running via test_linecache_stdlib, but when running test_linecache directly there are some failures. + # See https://github.com/IronLanguages/ironpython3/issues/1245 for details. + + failing_tests = [] + + skip_tests = [] + + return generate_suite(tests, failing_tests, skip_tests) + + else: + return tests + +run_test(__name__) diff --git a/tests/suite/test_typing_stdlib.py b/tests/suite/test_typing_stdlib.py index 890d6a63f..b072f256c 100644 --- a/tests/suite/test_typing_stdlib.py +++ b/tests/suite/test_typing_stdlib.py @@ -8,7 +8,7 @@ import sys -from iptest import is_ironpython, generate_suite, run_test +from iptest import is_ironpython, generate_suite, run_test, is_netcoreapp import test.test_typing @@ -49,6 +49,10 @@ def load_tests(loader, standard_tests, pattern): test.test_typing.NamedTupleTests('test_annotation_usage_with_default'), # TypeError: __new__() takes exactly 1 argument (2 given) test.test_typing.NamedTupleTests('test_annotation_usage_with_methods'), # TypeError: __new__() takes exactly 1 argument (2 given) ] + if is_netcoreapp: + failing_tests += [ + test.test_typing.CollectionsAbcTests('test_awaitable'), # https://github.com/IronLanguages/ironpython3/issues/2054 + ] skip_tests = [] if sys.version_info >= (3, 6):