Set env with MonkeyPatch (#5134)

This commit is contained in:
Charles Bensimon 2023-08-08 18:33:02 +02:00 committed by GitHub
parent 97d804c748
commit 56b02279ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -434,15 +434,14 @@ class TestBlocksMethods:
demo.close()
def test_concurrency_count_zero_gpu(self):
os.environ["SPACES_ZERO_GPU"] = "true"
def test_concurrency_count_zero_gpu(self, monkeypatch):
monkeypatch.setenv("SPACES_ZERO_GPU", "true")
demo = gr.Blocks()
with pytest.warns():
demo.queue(concurrency_count=42)
with pytest.warns():
demo.queue(42)
assert demo._queue.max_thread_count == demo.max_threads
del os.environ["SPACES_ZERO_GPU"]
class TestTempFile: