def test_broken_sysconfig(self): """ Test that pep425tags still works when sysconfig is broken. Can be a problem on Python 2.7 Issue #1074. """ def raises_ioerror(var): raise IOError("I have the wrong path!") with patch('setuptools.pep425tags.sysconfig.get_config_var', raises_ioerror): assert len(pep425tags.get_supported())
def test_broken_sysconfig(self): """ Test that pep425tags still works when sysconfig is broken. Can be a problem on Python 2.7 Issue #1074. """ def raises_ioerror(var): raise IOError("I have the wrong path!") with patch('setuptools.pep425tags.sysconfig.get_config_var', raises_ioerror): with pytest.warns(RuntimeWarning): assert len(pep425tags.get_supported())
def test_no_hyphen_tag(self): """ Test that no tag contains a hyphen. """ mock_gcf = self.mock_get_config_var(SOABI='cpython-35m-darwin') with patch('setuptools.pep425tags.sysconfig.get_config_var', mock_gcf): supported = pep425tags.get_supported() for (py, abi, plat) in supported: assert '-' not in py assert '-' not in abi assert '-' not in plat
def test_manylinux1_tag_is_first(self): """ Test that the more specific tag manylinux1 comes first. """ groups = {} for pyimpl, abi, arch in pep425tags.get_supported(): groups.setdefault((pyimpl, abi), []).append(arch) for arches in groups.values(): if arches == ['any']: continue # Expect the most specific arch first: if len(arches) == 3: assert arches == ['manylinux1_x86_64', 'linux_x86_64', 'any'] else: assert arches == ['manylinux1_x86_64', 'linux_x86_64']
def is_compatible(self): '''Is the wheel is compatible with the current platform?''' supported_tags = pep425tags.get_supported() return next((True for t in self.tags() if t in supported_tags), False)