Fix tests that are "hard coded" to expect x86_64 output by mocking the platform interface. Submitted upstream: https://github.com/pypa/packaging/pull/176 diff --git a/tests/test_tags.py b/tests/test_tags.py index 1eacf68..0a3f1b4 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -435,37 +435,43 @@ class TestManylinuxPlatform: linux_platform = list(tags._linux_platforms(is_32bit=False)) assert linux_platform == ["linux_x86_64"] - def test_linux_platforms_manylinux1(self, monkeypatch): + def test_linux_platforms_manylinux1(self, is_x86, monkeypatch): monkeypatch.setattr( tags, "_is_manylinux_compatible", lambda name, _: name == "manylinux1" ) - if platform.system() != "Linux": + if platform.system() != "Linux" or not is_x86: monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(platform, "machine", lambda: "x86_64") platforms = list(tags._linux_platforms(is_32bit=False)) - assert platforms == ["manylinux1_x86_64", "linux_x86_64"] + arch = platform.machine() + assert platforms == ["manylinux1_" + arch, "linux_" + arch] - def test_linux_platforms_manylinux2010(self, monkeypatch): + def test_linux_platforms_manylinux2010(self, is_x86, monkeypatch): monkeypatch.setattr( tags, "_is_manylinux_compatible", lambda name, _: name == "manylinux2010" ) - if platform.system() != "Linux": + if platform.system() != "Linux" or not is_x86: monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(platform, "machine", lambda: "x86_64") platforms = list(tags._linux_platforms(is_32bit=False)) - expected = ["manylinux2010_x86_64", "manylinux1_x86_64", "linux_x86_64"] + arch = platform.machine() + expected = ["manylinux2010_" + arch, "manylinux1_" + arch, "linux_" + arch] assert platforms == expected - def test_linux_platforms_manylinux2014(self, monkeypatch): + def test_linux_platforms_manylinux2014(self, is_x86, monkeypatch): monkeypatch.setattr( tags, "_is_manylinux_compatible", lambda name, _: name == "manylinux2014" ) - if platform.system() != "Linux": + if platform.system() != "Linux" or not is_x86: monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(platform, "machine", lambda: "x86_64") platforms = list(tags._linux_platforms(is_32bit=False)) + arch = platform.machine() expected = [ - "manylinux2014_x86_64", - "manylinux2010_x86_64", - "manylinux1_x86_64", - "linux_x86_64", + "manylinux2014_" + arch, + "manylinux2010_" + arch, + "manylinux1_" + arch, + "linux_" + arch, ] assert platforms == expected 98dfed1de935dfc60510a5514e5c289c3fc7'>Update NEWS.Ludovic Courtès 2019-04-28Update NEWS.Ludovic Courtès 2018-12-05Update NEWS.Ludovic Courtès 2018-12-05Update NEWS.Ludovic Courtès 2018-11-23Update NEWS.Ludovic Courtès 2018-08-30Update NEWS.Ricardo Wurmus 2018-07-05Update NEWS.Ludovic Courtès 2018-07-05Update NEWS.Ludovic Courtès 2018-06-20Update NEWS.Ludovic Courtès 2018-05-29Update NEWS.Ricardo Wurmus 2018-05-20services: Add Enlightenment desktop service....* gnu/services/desktop.scm (<enlightenment-desktop-configuration>, enlightenment-desktop-service-type): New variables. * doc/guix.texi (Desktop Services): Document the service. * NEWS: Mention it. Efraim Flashner 2018-05-08guix: Separate the package name and version with "@", not "-"....* guix/packages.scm (package-full-name): By default, use "@" to separate the package name and package version. Add an optional delimiter argument so that there is still a way to explicitly use a different delimiter. * gnu/packages/commencement.scm (gcc-boot0) <unpack-gmp&co>: Adjust accordingly. * tests/graph.scm: Adjust accordingly. * tests/profiles.scm: Adjust accordingly. * NEWS: Mention the change. Fixes: <https://bugs.gnu.org/31088>. Reported by Pierre Neidhardt <ambrevar@gmail.com>. Chris Marusich