def test_glibc_version_string_confstr(self, monkeypatch): monkeypatch.setattr( os, "confstr", lambda x: "glibc 2.20", raising=False, ) assert glibc_version_string_confstr() == "2.20"
def test_glibc_version_string_confstr_missing(self, monkeypatch): monkeypatch.delattr(os, "confstr", raising=False) assert glibc_version_string_confstr() is None
def test_glibc_version_string_confstr_fail(self, monkeypatch, failure): monkeypatch.setattr(os, "confstr", failure, raising=False) assert glibc_version_string_confstr() is None
def test_glibc_version_string_confstr_fail( self, monkeypatch: pytest.MonkeyPatch, failure: Callable[[Any], Any]) -> None: monkeypatch.setattr(os, "confstr", failure, raising=False) assert glibc_version_string_confstr() is None