Jason Vas Dias <[email protected]> added the comment:
OK, so those test_argparse.py and test_import.py tests succeed if run
as a non-root user , because as the super-user one is allowed to
override mode 0300 ( lack of 'w' bit for owner ) on a directory ,
so some tests that check if they are unable to create files when
directory 'w' permissions would not allow this for a non-root
user fail .
I think if users are not meant to be running the test scripts as root,
then the first thing the test suite should do is :
if os.getuid() == 0 :
print( "The test suite will fail if run as the super-user." )
sys.exit(1) # or is it os.exit ? I forget ...
But if, as I hope, you will allow the root user to run the test suite,
then please skip tests that test if a non-root user shouldn't be
allowed to do something as I did for the patch attached to issue #11956 :
@unittest.skipUnless( (os.name == 'posix') and not ( os.getuid() == 0 ),
"test meaningful only on posix systems as non-root
user")
def test_unwritable_directory(self):
...
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11954>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com