aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-04 12:22:53 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-04 12:22:53 -0500
commitfba8ee7abecb12726293438e8af19d7c3fa54bb8 (patch)
tree2b2c2c3e01a8385fefd7dca2d425d3a1abe3aa04 /setuptools/tests
parent3593a64ed6755876702ce362e1dfc87849c0952b (diff)
downloadexternal_python_setuptools-fba8ee7abecb12726293438e8af19d7c3fa54bb8.tar.gz
external_python_setuptools-fba8ee7abecb12726293438e8af19d7c3fa54bb8.tar.bz2
external_python_setuptools-fba8ee7abecb12726293438e8af19d7c3fa54bb8.zip
Remove try/except/fail - Exceptions are failures by default.
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_easy_install.py12
-rw-r--r--setuptools/tests/test_sandbox.py6
-rw-r--r--setuptools/tests/test_sdist.py20
3 files changed, 9 insertions, 29 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 04271178..7baa989a 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -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
diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py
index 6e5ce04a..cadc4812 100644
--- a/setuptools/tests/test_sandbox.py
+++ b/setuptools/tests/test_sandbox.py
@@ -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)
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index 68f83ca7..d3494d7a 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -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')