Fix problem with test=True for bin pkg install

Thought I had fixed this in 4149529 but I was mistaken.
Merge pull request #3792 from archtaku/issue3731

Fix problem with test=True for binary pkg install