[pypy-commit] pypy use-file-star-for-file: improve these tests
bdkearns
noreply at buildbot.pypy.org
Fri Aug 29 16:42:53 CEST 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch: use-file-star-for-file
Changeset: r73167:00a18e4129fd
Date: 2014-08-29 10:41 -0400
http://bitbucket.org/pypy/pypy/changeset/00a18e4129fd/
Log: improve these tests
diff --git a/pypy/module/_file/test/test_file.py b/pypy/module/_file/test/test_file.py
--- a/pypy/module/_file/test/test_file.py
+++ b/pypy/module/_file/test/test_file.py
@@ -87,10 +87,12 @@
f.close()
def test_badmode(self):
- raises(ValueError, self.file, "foo", "bar")
+ exc = raises(ValueError, self.file, "foo", "bar")
+ assert str(exc.value) == "mode string must begin with one of 'r', 'w', 'a' or 'U', not 'bar'"
def test_wraposerror(self):
- raises(IOError, self.file, "hopefully/not/existant.bar")
+ exc = raises(IOError, self.file, "hopefully/not/existant.bar")
+ assert str(exc.value) == "[Errno 2] No such file or directory: 'hopefully/not/existant.bar'"
def test_correct_file_mode(self):
import os
More information about the pypy-commit
mailing list