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
c844b00d
Commit
c844b00d
authored
Apr 16, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the called property of the run_pip mock rather than an assertion method that doesn't exist
parent
cad2bf20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Lib/test/test_ensurepip.py
Lib/test/test_ensurepip.py
+8
-8
No files found.
Lib/test/test_ensurepip.py
View file @
c844b00d
...
...
@@ -153,7 +153,7 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase):
def
test_altinstall_default_pip_conflict
(
self
):
with
self
.
assertRaises
(
ValueError
):
ensurepip
.
bootstrap
(
altinstall
=
True
,
default_pip
=
True
)
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
@
requires_usable_pip
def
test_pip_environment_variables_removed
(
self
):
...
...
@@ -194,7 +194,7 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
def
test_uninstall_skipped_when_not_installed
(
self
):
with
fake_pip
(
None
):
ensurepip
.
_uninstall_helper
()
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
def
test_uninstall_skipped_with_warning_for_wrong_version
(
self
):
with
fake_pip
(
"not a valid version"
):
...
...
@@ -202,7 +202,7 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
ensurepip
.
_uninstall_helper
()
warning
=
stderr
.
getvalue
().
strip
()
self
.
assertIn
(
"only uninstall a matching version"
,
warning
)
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
@
requires_usable_pip
...
...
@@ -272,7 +272,7 @@ class TestMissingSSL(EnsurepipMixin, unittest.TestCase):
self
.
os_environ
[
"PIP_THIS_SHOULD_STAY"
]
=
"test fodder"
with
self
.
assertRaisesRegex
(
RuntimeError
,
"requires SSL/TLS"
):
ensurepip_no_ssl
.
bootstrap
()
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
self
.
assertIn
(
"PIP_THIS_SHOULD_STAY"
,
self
.
os_environ
)
def
test_uninstall_requires_ssl
(
self
):
...
...
@@ -280,7 +280,7 @@ class TestMissingSSL(EnsurepipMixin, unittest.TestCase):
with
self
.
assertRaisesRegex
(
RuntimeError
,
"requires SSL/TLS"
):
with
fake_pip
():
ensurepip_no_ssl
.
_uninstall_helper
()
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
self
.
assertIn
(
"PIP_THIS_SHOULD_STAY"
,
self
.
os_environ
)
def
test_main_exits_early_with_warning
(
self
):
...
...
@@ -288,7 +288,7 @@ class TestMissingSSL(EnsurepipMixin, unittest.TestCase):
ensurepip_no_ssl
.
_main
([
"--version"
])
warning
=
stderr
.
getvalue
().
strip
()
self
.
assertTrue
(
warning
.
endswith
(
"requires SSL/TLS"
),
warning
)
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
# Basic testing of the main functions and their argument parsing
...
...
@@ -303,7 +303,7 @@ class TestBootstrappingMainFunction(EnsurepipMixin, unittest.TestCase):
ensurepip
.
_main
([
"--version"
])
result
=
stdout
.
getvalue
().
strip
()
self
.
assertEqual
(
result
,
EXPECTED_VERSION_OUTPUT
)
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
@
requires_usable_pip
def
test_basic_bootstrapping
(
self
):
...
...
@@ -328,7 +328,7 @@ class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase):
ensurepip
.
_uninstall
.
_main
([
"--version"
])
result
=
stdout
.
getvalue
().
strip
()
self
.
assertEqual
(
result
,
EXPECTED_VERSION_OUTPUT
)
self
.
run_pip
.
assert_not_called
(
)
self
.
assertFalse
(
self
.
run_pip
.
called
)
@
requires_usable_pip
def
test_basic_uninstall
(
self
):
...
...
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