'Test with sys.frozen=True and OSError when reading git-commit-id.'

def test_frozen_oserror(self, caplog, commit_file_mock, monkeypatch):

    monkeypatch.setattr(version.sys, 'frozen', True, raising=False)
    commit_file_mock.side_effect = OSError
    with caplog.at_level(logging.ERROR, 'misc'):
        assert (version._git_str() is None)
