New issue
Advanced search Search tips

Issue 627887 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Don't directly access os.environ or change os.environ in webkitpy unit tests.

Project Member Reported by qyears...@chromium.org, Jul 13 2016

Issue description

Currently:
 - os.environ is being directly accessed in ~15 places, including in Port. This makes it so that in unit tests, os.environ has to be saved, changed, and reset, which may be error-prone.
 - Also, there is an Environment class which is not really used anywhere.

At first, it looks like we may want to use a copy of Environment in SystemHost, but I think that the Environment class isn't really worth it, since it's basically just a dict, and it's simpler to interact with os.environ directly in SystemHost without having a separate Environment class.

Proposal:
 1. Change references to os.environ with calls to methods of Host, so that MockHost objects in unit tests won't touch the real os.environ.
 2. Also, remove the Environment class.

This will make it easier to test a fix for  bug 612730 .
 
Status: Fixed (was: Assigned)
Fixed: http://crrev.com/2143123004

Sign in to add a comment