Skip to content

Commit

Permalink
Set env with MonkeyPatch (#5134)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbensimon authored Aug 8, 2023
1 parent 97d804c commit 56b0227
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,14 @@ def test_raise_error_if_event_queued_but_queue_not_enabled(self):

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:
Expand Down

1 comment on commit 56b0227

@vercel
Copy link

@vercel vercel bot commented on 56b0227 Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.