From 749ad0f641ac14cc6e8485ed0b4fdf6aacb6f015 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Thu, 25 Apr 2024 14:44:16 +0200
Subject: [PATCH] test: Fix running `build` in offline test environment

Fix the `build` calls to use `--no-isolation`, in order to fix
regression in running tests in an offline environment.

Unlike the previous `setup.py` calls, `build` defaults to creating a new
virtual environment to perform the build.  This, in turn, requires
fetching the build dependencies from the Internet, effectively making
the tests error out in an offline environment.  Passing `--no-isolation`
makes `build` use the already-installed host dependencies instead.
---
 tests/test_server.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/test_server.py b/tests/test_server.py
index 92ecdda3..99da611c 100644
--- a/tests/test_server.py
+++ b/tests/test_server.py
@@ -148,7 +148,10 @@ def wheel_file(project, tmp_path_factory):
     if re.match("^3\.7", sys.version):
         assert run_setup_py(project, f"bdist_wheel -d {distdir}") == 0
     else:
-        assert run_py_build(project, f"--wheel --outdir {distdir}") == 0
+        assert (
+            run_py_build(project, f"--wheel --no-isolation --outdir {distdir}")
+            == 0
+        )
     wheels = list(distdir.glob("centodeps*.whl"))
     assert len(wheels) > 0
     return wheels[0]
