def test_pex_get_int():
  assert Variables()._get_int('HELLO') is None
  assert Variables()._get_int('HELLO', default=42) == 42
  assert Variables(environ={'HELLO': 23})._get_int('HELLO') == 23
  assert Variables(environ={'HELLO': 23})._get_int('HELLO', default=42) == 23

  with pytest.raises(SystemExit):
    assert Variables(environ={'HELLO': 'welp'})._get_int('HELLO')
dataset/ETHPy150Open pantsbuild/pex/tests/test_variables.py/test_pex_get_int/original