Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping a unit test when run as root #88

Closed
wants to merge 1 commit into from

Conversation

stewbond
Copy link
Contributor

@stewbond stewbond commented Feb 3, 2019

When building and testing the package in a chroot enviornment, we have a root user. However, test_properties fails when run as a root user.

os.chmod(f.path, stat.S_IRUSR)
self.assertEqual(f.is_readonly, True)

This fails because root will always have permission to write to the file. That makes sense. And it also therefore makes sense to skip this test when run as root.

@mdickinson
Copy link
Member

I'm not convinced that this is the right solution. For one thing, os.getuid doesn't exist on Windows.

@mdickinson
Copy link
Member

Closing and re-opening to retrigger CI.

@kitchoi
Copy link
Contributor

kitchoi commented Nov 5, 2020

Thank you @stewbond. The issue looks like a legitimate one. I opened #191 to track it.

@rahulporuri
Copy link
Contributor

closing as we now have an issue to track the underlying problem and this solution doesn't work on all platforms so it's not the right one for us.

@rahulporuri rahulporuri closed this Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants