Skip to content

Commit 56a8039

Browse files
committed
Mark erroring/failing tests
1 parent ce84ee0 commit 56a8039

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Lib/test/test_import/__init__.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def test_from_import_missing_attr_raises_ImportError(self):
8585
with self.assertRaises(ImportError):
8686
from importlib import something_that_should_not_exist_anywhere
8787

88+
# TODO: RUSTPYTHON
89+
@unittest.expectedFailure
8890
def test_from_import_missing_attr_has_name_and_path(self):
8991
with self.assertRaises(ImportError) as cm:
9092
from os import i_dont_exist
@@ -108,12 +110,16 @@ def test_from_import_missing_attr_has_name(self):
108110
self.assertEqual(cm.exception.name, '_warning')
109111
self.assertIsNone(cm.exception.path)
110112

113+
# TODO: RUSTPYTHON
114+
@unittest.expectedFailure
111115
def test_from_import_missing_attr_path_is_canonical(self):
112116
with self.assertRaises(ImportError) as cm:
113117
from os.path import i_dont_exist
114118
self.assertIn(cm.exception.name, {'posixpath', 'ntpath'})
115119
self.assertIsNotNone(cm.exception)
116120

121+
# TODO: RUSTPYTHON
122+
@unittest.expectedFailure
117123
def test_from_import_star_invalid_type(self):
118124
import re
119125
with _ready_to_import() as (name, path):
@@ -408,6 +414,8 @@ def test_from_import_message_for_existing_module(self):
408414
with self.assertRaisesRegex(ImportError, "^cannot import name 'bogus'"):
409415
from re import bogus
410416

417+
# TODO: RUSTPYTHON
418+
@unittest.expectedFailure
411419
def test_from_import_AttributeError(self):
412420
# Issue #24492: trying to import an attribute that raises an
413421
# AttributeError should lead to an ImportError.
@@ -646,6 +654,8 @@ def test_basics(self):
646654
self.assertEqual(mod.code_filename, self.file_name)
647655
self.assertEqual(mod.func_filename, self.file_name)
648656

657+
# TODO: RUSTPYTHON
658+
@unittest.expectedFailure
649659
def test_incorrect_code_name(self):
650660
py_compile.compile(self.file_name, dfile="another_module.py")
651661
mod = self.import_module()
@@ -664,6 +674,8 @@ def test_module_without_source(self):
664674
self.assertEqual(mod.code_filename, target)
665675
self.assertEqual(mod.func_filename, target)
666676

677+
# TODO: RUSTPYTHON
678+
@unittest.expectedFailure
667679
def test_foreign_code(self):
668680
py_compile.compile(self.file_name)
669681
with open(self.compiled_name, "rb") as f:
@@ -804,6 +816,8 @@ def test_import_from_unloaded_package(self):
804816

805817

806818
class OverridingImportBuiltinTests(unittest.TestCase):
819+
# TODO: RUSTPYTHON
820+
@unittest.expectedFailure
807821
def test_override_builtin(self):
808822
# Test that overriding builtins.__import__ can bypass sys.modules.
809823
import os
@@ -882,6 +896,8 @@ def test_missing_source(self):
882896
importlib.invalidate_caches()
883897
self.assertRaises(ImportError, __import__, TESTFN)
884898

899+
# TODO: RUSTPYTHON
900+
@unittest.expectedFailure
885901
@skip_if_dont_write_bytecode
886902
def test_missing_source_legacy(self):
887903
# Like test_missing_source() except that for backward compatibility,
@@ -901,13 +917,17 @@ def test_missing_source_legacy(self):
901917
finally:
902918
os.remove(pyc_file)
903919

920+
# TODO: RUSTPYTHON
921+
@unittest.expectedFailure
904922
def test___cached__(self):
905923
# Modules now also have an __cached__ that points to the pyc file.
906924
m = __import__(TESTFN)
907925
pyc_file = importlib.util.cache_from_source(TESTFN + '.py')
908926
self.assertEqual(m.__cached__, os.path.join(os.getcwd(), os.curdir, pyc_file))
909927

910928
@skip_if_dont_write_bytecode
929+
# TODO: RUSTPYTHON
930+
@unittest.expectedFailure
911931
def test___cached___legacy_pyc(self):
912932
# Like test___cached__() except that for backward compatibility,
913933
# when the pyc file lives where the py file would have been (and named
@@ -923,6 +943,8 @@ def test___cached___legacy_pyc(self):
923943
self.assertEqual(m.__cached__,
924944
os.path.join(os.getcwd(), os.curdir, os.path.relpath(pyc_file)))
925945

946+
# TODO: RUSTPYTHON
947+
@unittest.expectedFailure
926948
@skip_if_dont_write_bytecode
927949
def test_package___cached__(self):
928950
# Like test___cached__ but for packages.
@@ -946,6 +968,8 @@ def cleanup():
946968
self.assertEqual(sys.modules['pep3147.foo'].__cached__,
947969
os.path.join(os.getcwd(), os.curdir, foo_pyc))
948970

971+
# TODO: RUSTPYTHON
972+
@unittest.expectedFailure
949973
def test_package___cached___from_pyc(self):
950974
# Like test___cached__ but ensuring __cached__ when imported from a
951975
# PEP 3147 pyc file.
@@ -1312,6 +1336,8 @@ def test_rebinding(self):
13121336
from test.test_import.data.circular_imports.subpkg import util
13131337
self.assertIs(util.util, rebinding.util)
13141338

1339+
# TODO: RUSTPYTHON
1340+
@unittest.expectedFailure
13151341
def test_binding(self):
13161342
try:
13171343
import test.test_import.data.circular_imports.binding
@@ -1322,6 +1348,8 @@ def test_crossreference1(self):
13221348
import test.test_import.data.circular_imports.use
13231349
import test.test_import.data.circular_imports.source
13241350

1351+
# TODO: RUSTPYTHON
1352+
@unittest.expectedFailure
13251353
def test_crossreference2(self):
13261354
with self.assertRaises(AttributeError) as cm:
13271355
import test.test_import.data.circular_imports.source
@@ -1331,6 +1359,8 @@ def test_crossreference2(self):
13311359
self.assertIn('partially initialized module', errmsg)
13321360
self.assertIn('circular import', errmsg)
13331361

1362+
# TODO: RUSTPYTHON
1363+
@unittest.expectedFailure
13341364
def test_circular_from_import(self):
13351365
with self.assertRaises(ImportError) as cm:
13361366
import test.test_import.data.circular_imports.from_cycle1

0 commit comments

Comments
 (0)