Detecting the path variable

First priority - Take the path provided
Fallback to extract from $PATH. Takes first occurrence in the order of $PATH
It comes from pytest. 
http://pytest.org/latest/_modules/_pytest/monkeypatch.html
http://pytest.org/latest/monkeypatch.html