Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
parametrize the thread test with daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Roulbac committed Aug 2, 2023
1 parent d419d62 commit 76af006
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/flojoy_node_venv_test_.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def empty_function_with_error():
empty_function_with_error()


def test_run_in_venv_runs_within_thread(mock_venv_cache_dir):
@pytest.mark.parametrize("daemon", [True, False])
def test_run_in_venv_runs_within_thread(mock_venv_cache_dir, daemon):

from threading import Thread
from queue import Queue
Expand All @@ -148,7 +149,7 @@ def func_with_venv():

# Run the function in a thread
queue = Queue()
thread = Thread(target=function_to_run_within_thread, args=(queue,))
thread = Thread(target=function_to_run_within_thread, args=(queue,), daemon=daemon)
thread.start()
thread.join()
# Check that the thread has finished
Expand Down

0 comments on commit 76af006

Please sign in to comment.