@@ -757,6 +757,12 @@ def test_makedev(self):
757757 self .assertRaises ((ValueError , OverflowError ), posix .makedev , x , minor )
758758 self .assertRaises ((ValueError , OverflowError ), posix .makedev , major , x )
759759
760+ # The following tests are needed to test functions accepting or
761+ # returning the special value NODEV (if it is defined). major(), minor()
762+ # and makefile() are the only easily reproducible examples, but that
763+ # behavior is platform specific -- on some platforms their code has
764+ # a special case for NODEV, on others this is just an implementation
765+ # artifact.
760766 if (hasattr (posix , 'NODEV' ) and
761767 sys .platform .startswith (('linux' , 'macos' , 'freebsd' , 'dragonfly' ,
762768 'sunos' ))):
@@ -766,6 +772,7 @@ def test_makedev(self):
766772 self .assertEqual (posix .makedev (NODEV , NODEV ), NODEV )
767773
768774 def test_nodev (self ):
775+ # NODEV is not a part of Posix, but is defined on many systems.
769776 if (not hasattr (posix , 'NODEV' )
770777 and (not sys .platform .startswith (('linux' , 'macos' , 'freebsd' ,
771778 'dragonfly' , 'netbsd' , 'openbsd' ,
0 commit comments