X Tutup
Skip to content

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

Merged
gpshead merged 3 commits intopython:masterfrom
gpshead:shutil_disk_usage_leniency
Jul 7, 2017
Merged

Make test_shutil test_disk_usage not depend on the cwd filesystem.#2597
gpshead merged 3 commits intopython:masterfrom
gpshead:shutil_disk_usage_leniency

Conversation

@gpshead
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

X Tutup