Skip to content

Make test_shutil test_disk_usage not depend on the cwd filesystem. #2597

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

Merged
merged 3 commits into from
Jul 7, 2017

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Jul 6, 2017

Don't assume so much about the test execution environment's getcwd()
filesystem space usage reports.

Don't assume so much about the test execution environment's getcwd()
filesystem space usage reports.
@mention-bot
Copy link

@gpshead, thanks for your PR! By analyzing the history of the files in this pull request, we identified @serhiy-storchaka, @pitrou and @hynek to be potential reviewers.

@gpshead gpshead added the trivial label Jul 6, 2017
@serhiy-storchaka
Copy link
Member

Maybe use __file__ or sys.executable instead of os.getcwd()?

@gpshead gpshead changed the title Make test_shutil test_disk_usage's more lenient. Make test_shutil test_disk_usage more lenient. Jul 6, 2017
@gpshead
Copy link
Member Author

gpshead commented Jul 6, 2017

sys.executable = None in the environment where I ran into the problem (an embedded CPython interpreter running the test suite. __file__ is a potential alternative and appears to work. I'll just use that.

Leaving the assertions as they were originally.
@serhiy-storchaka
Copy link
Member

This doesn't work on Windows. Maybe use os.path.dirname(__file__)?

@gpshead gpshead self-assigned this Jul 7, 2017
@gpshead gpshead changed the title Make test_shutil test_disk_usage more lenient. Make test_shutil test_disk_usage not depend on the cwd filesystem. Jul 7, 2017
@gpshead gpshead merged commit 529746c into python:master Jul 7, 2017
gpshead added a commit to gpshead/cpython that referenced this pull request Jul 23, 2017
…onGH-2597)

Make test_shutil test_disk_usage not depend on the current working directory's filesystem.
(cherry picked from commit 529746c)
gpshead added a commit that referenced this pull request Jul 23, 2017
) (#2820)

Make test_shutil test_disk_usage not depend on the current working directory's filesystem.
(cherry picked from commit 529746c)
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