Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
fba8ee7a
Commit
fba8ee7a
authored
Jan 04, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove try/except/fail - Exceptions are failures by default.
parent
3593a64e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
33 deletions
+11
-33
pkg_resources/tests/test_resources.py
pkg_resources/tests/test_resources.py
+2
-4
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+3
-9
setuptools/tests/test_sandbox.py
setuptools/tests/test_sandbox.py
+2
-4
setuptools/tests/test_sdist.py
setuptools/tests/test_sdist.py
+4
-16
No files found.
pkg_resources/tests/test_resources.py
View file @
fba8ee7a
...
...
@@ -593,10 +593,8 @@ class TestNamespaces:
pkg2_init
.
close
()
import
pkg1
assert
"pkg1"
in
pkg_resources
.
_namespace_packages
try
:
import
pkg1.pkg2
except
ImportError
:
self
.
fail
(
"Setuptools tried to import the parent namespace package"
)
# attempt to import pkg2 from site-pkgs2
import
pkg1.pkg2
# check the _namespace_packages dict
assert
"pkg1.pkg2"
in
pkg_resources
.
_namespace_packages
assert
pkg_resources
.
_namespace_packages
[
"pkg1"
]
==
[
"pkg1.pkg2"
]
...
...
setuptools/tests/test_easy_install.py
View file @
fba8ee7a
...
...
@@ -250,8 +250,6 @@ class TestUserInstallTest:
with
contexts
.
quiet
():
with
self
.
patched_setup_context
():
run_setup
(
test_setup_py
,
[
'install'
])
except
SandboxViolation
:
self
.
fail
(
'Installation caused SandboxViolation'
)
except
IndexError
:
# Test fails in some cases due to bugs in Python
# See https://bitbucket.org/pypa/setuptools/issue/201
...
...
@@ -353,13 +351,9 @@ class TestSetupRequires:
test_pkg
=
create_setup_requires_package
(
temp_dir
)
test_setup_py
=
os
.
path
.
join
(
test_pkg
,
'setup.py'
)
with
contexts
.
quiet
()
as
(
stdout
,
stderr
):
try
:
# Don't even need to install the package, just
# running the setup.py at all is sufficient
run_setup
(
test_setup_py
,
[
'--name'
])
except
VersionConflict
:
self
.
fail
(
'Installing setup.py requirements '
'caused a VersionConflict'
)
# Don't even need to install the package, just
# running the setup.py at all is sufficient
run_setup
(
test_setup_py
,
[
'--name'
])
lines
=
stdout
.
readlines
()
assert
len
(
lines
)
>
0
...
...
setuptools/tests/test_sandbox.py
View file @
fba8ee7a
...
...
@@ -33,10 +33,8 @@ class TestSandbox:
target
=
os
.
path
.
join
(
gen_py
,
'test_write'
)
sandbox
=
DirectorySandbox
(
str
(
tmpdir
))
try
:
try
:
sandbox
.
run
(
self
.
_file_writer
(
target
))
except
SandboxViolation
:
self
.
fail
(
"Could not create gen_py file due to SandboxViolation"
)
# attempt to create gen_py file
sandbox
.
run
(
self
.
_file_writer
(
target
))
finally
:
if
os
.
path
.
exists
(
target
):
os
.
remove
(
target
)
...
...
setuptools/tests/test_sdist.py
View file @
fba8ee7a
...
...
@@ -172,10 +172,7 @@ class TestSdistTest:
manifest
.
close
()
# The manifest should be UTF-8 encoded
try
:
u_contents
=
contents
.
decode
(
'UTF-8'
)
except
UnicodeDecodeError
as
e
:
self
.
fail
(
e
)
u_contents
=
contents
.
decode
(
'UTF-8'
)
# The manifest should contain the UTF-8 filename
if
PY2
:
...
...
@@ -214,10 +211,7 @@ class TestSdistTest:
manifest
.
close
()
# The manifest should be UTF-8 encoded
try
:
contents
.
decode
(
'UTF-8'
)
except
UnicodeDecodeError
as
e
:
self
.
fail
(
e
)
contents
.
decode
(
'UTF-8'
)
# The manifest should contain the UTF-8 filename
assert
posix
(
filename
)
in
contents
...
...
@@ -254,10 +248,7 @@ class TestSdistTest:
manifest
.
close
()
# The manifest should be UTF-8 encoded
try
:
contents
.
decode
(
'UTF-8'
)
except
UnicodeDecodeError
as
e
:
self
.
fail
(
e
)
contents
.
decode
(
'UTF-8'
)
# The Latin-1 filename should have been skipped
assert
posix
(
filename
)
not
in
contents
...
...
@@ -323,10 +314,7 @@ class TestSdistTest:
# Re-read manifest
cmd
.
filelist
.
files
=
[]
with
quiet
():
try
:
cmd
.
read_manifest
()
except
UnicodeDecodeError
as
e
:
self
.
fail
(
e
)
cmd
.
read_manifest
()
# The Latin-1 filename should have been skipped
filename
=
filename
.
decode
(
'latin-1'
)
...
...
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