2
0
mirror of https://github.com/gradio-app/gradio.git synced 2025-03-19 12:00:39 +08:00

Set env with MonkeyPatch ()

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

@ -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: