mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-19 12:00:39 +08:00
Set env with MonkeyPatch (#5134)
This commit is contained in:
parent
97d804c748
commit
56b02279ce
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user