Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f2c4ba12
Commit
f2c4ba12
authored
Jul 07, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #19593: Use specific asserts in importlib tests.
parents
cde9d1ee
344f8316
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
Lib/test/test_import.py
Lib/test/test_import.py
+3
-3
Lib/test/test_importlib/builtin/test_loader.py
Lib/test/test_importlib/builtin/test_loader.py
+1
-1
Lib/test/test_importlib/import_/test_fromlist.py
Lib/test/test_importlib/import_/test_fromlist.py
+1
-1
Lib/test/test_importlib/import_/test_meta_path.py
Lib/test/test_importlib/import_/test_meta_path.py
+1
-1
Lib/test/test_importlib/test_abc.py
Lib/test/test_importlib/test_abc.py
+1
-1
No files found.
Lib/test/test_import.py
View file @
f2c4ba12
...
...
@@ -190,12 +190,12 @@ class ImportTests(unittest.TestCase):
# import x.y.z binds x in the current namespace
import
test
as
x
import
test.support
self
.
assert
True
(
x
is
test
,
x
.
__name__
)
self
.
assert
Is
(
x
,
test
,
x
.
__name__
)
self
.
assertTrue
(
hasattr
(
test
.
support
,
"__file__"
))
# import x.y.z as w binds z as w
import
test.support
as
y
self
.
assert
True
(
y
is
test
.
support
,
y
.
__name__
)
self
.
assert
Is
(
y
,
test
.
support
,
y
.
__name__
)
def
test_failing_reload
(
self
):
# A failing reload should leave the module object in sys.modules.
...
...
@@ -223,7 +223,7 @@ class ImportTests(unittest.TestCase):
self
.
assertRaises
(
ZeroDivisionError
,
importlib
.
reload
,
mod
)
# But we still expect the module to be in sys.modules.
mod
=
sys
.
modules
.
get
(
TESTFN
)
self
.
assertIsNot
(
mod
,
None
,
"expected module to be in sys.modules"
)
self
.
assertIsNot
None
(
mod
,
"expected module to be in sys.modules"
)
# We should have replaced a w/ 10, but the old b value should
# stick.
...
...
Lib/test/test_importlib/builtin/test_loader.py
View file @
f2c4ba12
...
...
@@ -88,7 +88,7 @@ class InspectLoaderTests:
def
test_is_package
(
self
):
# Cannot be a package.
result
=
self
.
machinery
.
BuiltinImporter
.
is_package
(
util
.
BUILTINS
.
good_name
)
self
.
assert
True
(
not
result
)
self
.
assert
False
(
result
)
@
unittest
.
skipIf
(
util
.
BUILTINS
.
bad_name
is
None
,
'all modules are built in'
)
def
test_not_builtin
(
self
):
...
...
Lib/test/test_importlib/import_/test_fromlist.py
View file @
f2c4ba12
...
...
@@ -62,7 +62,7 @@ class HandlingFromlist:
with
util
.
import_state
(
meta_path
=
[
importer
]):
module
=
self
.
__import__
(
'module'
,
fromlist
=
[
'non_existent'
])
self
.
assertEqual
(
module
.
__name__
,
'module'
)
self
.
assert
True
(
not
hasattr
(
module
,
'non_existent'
))
self
.
assert
False
(
hasattr
(
module
,
'non_existent'
))
def
test_module_from_package
(
self
):
# [module]
...
...
Lib/test/test_importlib/import_/test_meta_path.py
View file @
f2c4ba12
...
...
@@ -97,7 +97,7 @@ class CallSignature:
args
=
log
[
1
][
0
]
kwargs
=
log
[
1
][
1
]
# Assuming all arguments are positional.
self
.
assert
True
(
not
kwargs
)
self
.
assert
False
(
kwargs
)
self
.
assertEqual
(
args
[
0
],
mod_name
)
self
.
assertIs
(
args
[
1
],
path
)
...
...
Lib/test/test_importlib/test_abc.py
View file @
f2c4ba12
...
...
@@ -784,7 +784,7 @@ class SourceOnlyLoaderTests(SourceLoaderTestHarness):
warnings
.
simplefilter
(
'ignore'
,
DeprecationWarning
)
module
=
self
.
loader
.
load_module
(
self
.
name
)
self
.
verify_module
(
module
)
self
.
assert
True
(
not
hasattr
(
module
,
'__path__'
))
self
.
assert
False
(
hasattr
(
module
,
'__path__'
))
def
test_get_source_encoding
(
self
):
# Source is considered encoded in UTF-8 by default unless otherwise
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment