death to "misc" directories. moved most files out of py/misc, either to a

private attic or to other places in the lib.

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-08-25 16:14:15 +02:00
parent 739edc26b4
commit d43d69e3db
33 changed files with 230 additions and 989 deletions

26
py/_testing/test_error.py Normal file
View File

@@ -0,0 +1,26 @@
import py
import errno
def test_error_classes():
for name in errno.errorcode.values():
x = getattr(py.error, name)
assert issubclass(x, py.error.Error)
assert issubclass(x, EnvironmentError)
def test_unknown_error():
num = 3999
cls = py.error._geterrnoclass(num)
assert cls.__name__ == 'UnknownErrno%d' % (num,)
assert issubclass(cls, py.error.Error)
assert issubclass(cls, EnvironmentError)
cls2 = py.error._geterrnoclass(num)
assert cls is cls2
def test_error_conversion_ENOTDIR(testdir):
p = testdir.makepyfile("")
excinfo = py.test.raises(py.error.Error, py.error.checked_call, p.listdir)
assert isinstance(excinfo.value, EnvironmentError)
assert isinstance(excinfo.value, py.error.Error)
assert "ENOTDIR" in repr(excinfo.value)