Author Jason.Vas.Dias
Recipients Jason.Vas.Dias, r.david.murray
Date 2011-04-29.17:54:59
SpamBayes Score 7.88488e-05
Marked as misclassified No
Message-id <1304099699.79.0.647334956227.issue11954@psf.upfronthosting.co.za>
In-reply-to
Content
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):
...
History
Date User Action Args
2011-04-29 17:54:59Jason.Vas.Diassetrecipients: + Jason.Vas.Dias, r.david.murray
2011-04-29 17:54:59Jason.Vas.Diassetmessageid: <1304099699.79.0.647334956227.issue11954@psf.upfronthosting.co.za>
2011-04-29 17:54:59Jason.Vas.Diaslinkissue11954 messages
2011-04-29 17:54:59Jason.Vas.Diascreate