Skip to content

Commit da75af3

Browse files
authored
Fix more test failures (#2061)
1 parent 3ca27bb commit da75af3

4 files changed

Lines changed: 44 additions & 7 deletions

File tree

tests/IronPython.Tests/Cases/CPythonCasesManifest.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,8 @@ Ignore=true
603603
[CPython.test_lib2to3]
604604
Ignore=true
605605

606-
# TODO: 3.6
607-
#[CPython.test_linecache]
608-
#Ignore=true # blocked by https://github.com/IronLanguages/ironpython3/issues/1245 - using the test_linecache_stdlib approach makes the issue disappear...
606+
[CPython.test_linecache] # IronPython.test_linecache_stdlib
607+
Ignore=true
609608

610609
[CPython.test_list]
611610
IsolationLevel=ENGINE

tests/suite/test_datetime_stdlib.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ def load_tests(loader, standard_tests, pattern):
6363
test.datetimetester.TestDateTime('test_compat_unpickle'), # TypeError: function takes at least 3 arguments (1 given)
6464
test.datetimetester.TestDateTime('test_isoformat'), # TypeError: isoformat() got an unexpected keyword argument 'timespec'
6565
test.datetimetester.TestDateTime('test_subclass_replace'), # TypeError: replace() got an unexpected keyword argument 'year'
66-
test.datetimetester.TestDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime.
6766
test.datetimetester.TestDateTimeTZ('test_bad_constructor_arguments'), # https://github.com/IronLanguages/ironpython3/issues/1459
6867
test.datetimetester.TestDateTimeTZ('test_compat_unpickle'), # TypeError: function takes at least 3 arguments (2 given)
6968
test.datetimetester.TestDateTimeTZ('test_isoformat'), # TypeError: isoformat() got an unexpected keyword argument 'timespec'
7069
test.datetimetester.TestDateTimeTZ('test_subclass_replace'), # TypeError: replace() got an unexpected keyword argument 'year'
71-
test.datetimetester.TestDateTimeTZ('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime.
7270
test.datetimetester.TestLocalTimeDisambiguation('test_comparison'), # https://github.com/IronLanguages/ironpython3/issues/1459
7371
test.datetimetester.TestLocalTimeDisambiguation('test_constructors'), # https://github.com/IronLanguages/ironpython3/issues/1459
7472
test.datetimetester.TestLocalTimeDisambiguation('test_dst'), # https://github.com/IronLanguages/ironpython3/issues/1459
@@ -91,7 +89,6 @@ def load_tests(loader, standard_tests, pattern):
9189
test.datetimetester.TestSubclassDateTime('test_compat_unpickle'), # TypeError: function takes at least 3 arguments (1 given)
9290
test.datetimetester.TestSubclassDateTime('test_isoformat'), # TypeError: isoformat() got an unexpected keyword argument 'timespec'
9391
test.datetimetester.TestSubclassDateTime('test_subclass_replace'), # TypeError: replace() got an unexpected keyword argument 'year'
94-
test.datetimetester.TestSubclassDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime.
9592
test.datetimetester.TestTime('test_backdoor_resistance'), # AssertionError: "^bad tzinfo state arg$" does not match "expected Int32, got bytes"
9693
test.datetimetester.TestTime('test_compat_unpickle'), # TypeError: expected Int32, got str
9794
test.datetimetester.TestTime('test_isoformat'), # TypeError: isoformat() takes no arguments (1 given)
@@ -112,6 +109,12 @@ def load_tests(loader, standard_tests, pattern):
112109
test.datetimetester.TestTimeDelta('test_overflow'), # rounding differences
113110
]
114111
if sys.version_info >= (3, 6):
112+
skip_tests += [
113+
# these can fail with a ValueError if the current time zone is not UTC
114+
test.datetimetester.TestDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime.
115+
test.datetimetester.TestDateTimeTZ('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime.
116+
test.datetimetester.TestSubclassDateTime('test_timestamp_limits'), # ValueError: The added or subtracted value results in an un-representable DateTime.
117+
]
115118
for test_or_suite in tests:
116119
if isinstance(test_or_suite, test.datetimetester.ZoneInfoCompleteTest):
117120
for t in test_or_suite:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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_linecache from StdLib
7+
##
8+
9+
import sys
10+
11+
from iptest import is_ironpython, generate_suite, run_test
12+
13+
import test.test_linecache
14+
15+
def load_tests(loader, standard_tests, pattern):
16+
tests = loader.loadTestsFromModule(test.test_linecache, pattern=pattern)
17+
18+
if is_ironpython:
19+
# There are no failing tests when running via test_linecache_stdlib, but when running test_linecache directly there are some failures.
20+
# See https://github.com/IronLanguages/ironpython3/issues/1245 for details.
21+
22+
failing_tests = []
23+
24+
skip_tests = []
25+
26+
return generate_suite(tests, failing_tests, skip_tests)
27+
28+
else:
29+
return tests
30+
31+
run_test(__name__)

tests/suite/test_typing_stdlib.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import sys
1010

11-
from iptest import is_ironpython, generate_suite, run_test
11+
from iptest import is_ironpython, generate_suite, run_test, is_netcoreapp
1212

1313
import test.test_typing
1414

@@ -49,6 +49,10 @@ def load_tests(loader, standard_tests, pattern):
4949
test.test_typing.NamedTupleTests('test_annotation_usage_with_default'), # TypeError: __new__() takes exactly 1 argument (2 given)
5050
test.test_typing.NamedTupleTests('test_annotation_usage_with_methods'), # TypeError: __new__() takes exactly 1 argument (2 given)
5151
]
52+
if is_netcoreapp:
53+
failing_tests += [
54+
test.test_typing.CollectionsAbcTests('test_awaitable'), # https://github.com/IronLanguages/ironpython3/issues/2054
55+
]
5256

5357
skip_tests = []
5458
if sys.version_info >= (3, 6):

0 commit comments

Comments
 (0)