[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module

lekma report at bugs.python.org
Sat Dec 19 10:58:47 CET 2009


lekma <lekmalek at gmail.com> added the comment:

> It would be better to use test skipping: (eg: @unittest.SkipUnless
> before the test class).

I didn't know about this feature, thanks for the tip.

Now I wonder if it would be better to do it this way:
@unittest.SkipUnless(hasattr(socket, "SOCK_CLOEXEC") and fcntl,
"SOCK_CLOEXEC not defined OR module fcntl not available")

or this way:
@unittest.SkipUnless(hasattr(socket, "SOCK_CLOEXEC"), "SOCK_CLOEXEC not
defined")
@unittest.SkipUnless(fcntl, "module fcntl not available")

the second option seems better to me (obvious reason why the test was
skipped), what do you guys think? (it doesn't really matter, I know, but
while we're here...)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7523>
_______________________________________


More information about the Python-bugs-list mailing list