🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
Mocks for sleep in tests (#234)
Dmitrii Khizbullin16209d2c6f6e
diff --git a/.github/workflows/pytest_apps.yml b/.github/workflows/pytest_apps.ymlindex 53955d342..e625e34f8 100644--- a/.github/workflows/pytest_apps.yml+++ b/.github/workflows/pytest_apps.yml@@ -33,7 +33,7 @@ jobs:- name: Install dependenciesrun: |python -m pip install --upgrade pip- pip install flake8 pytest+ pip install flake8 pytest mockpip install gradiopip install -e .- name: Test with pytest@@ -62,7 +62,7 @@ jobs:- name: Install dependenciesrun: |python -m pip install --upgrade pip- pip install flake8 pytest+ pip install flake8 pytest mockpip install -e .- name: Test with pytestenv:diff --git a/examples/test/test_ai_society_example.py b/examples/test/test_ai_society_example.pyindex 4787173d1..89410bcb2 100644--- a/examples/test/test_ai_society_example.py+++ b/examples/test/test_ai_society_example.py@@ -11,18 +11,18 @@# See the License for the specific language governing permissions and# limitations under the License.# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========-import pytest+from mock import patchimport examples.ai_society.role_playingimport examples.function_call.role_playing_with_functionfrom camel.typing import ModelTypedef test_ai_society_role_playing_example():- examples.ai_society.role_playing.main(ModelType.STUB)+ with patch('time.sleep', return_value=None):+ examples.ai_society.role_playing.main(ModelType.STUB)def test_role_playing_with_function_example():- examples.function_call.role_playing_with_function.main(ModelType.STUB)+ with patch('time.sleep', return_value=None):+ examples.function_call.role_playing_with_function.main(ModelType.STUB)diff --git a/examples/test/test_code_example.py b/examples/test/test_code_example.pyindex a08c08993..a6d2c2c75 100644--- a/examples/test/test_code_example.py+++ b/examples/test/test_code_example.py@@ -11,12 +11,12 @@# See the License for the specific language governing permissions and# limitations under the License.# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========-import pytest+from mock import patchimport examples.code.role_playingfrom camel.typing import ModelTypedef test_code_role_playing_example():- examples.code.role_playing.main(ModelType.STUB)+ with patch('time.sleep', return_value=None):+ examples.code.role_playing.main(ModelType.STUB)diff --git a/examples/test/test_single_agent.py b/examples/test/test_single_agent.pyindex caf8790fd..e5259d8da 100644--- a/examples/test/test_single_agent.py+++ b/examples/test/test_single_agent.py@@ -36,7 +36,9 @@ def test_misalignment_single_agent(model):examples.misalignment.single_agent.main(model=model)-@parametrize[email protected]('model', [+ ModelType.STUB,+])def test_evaluation_single_agent(model):examples.evaluation.single_agent.main(model=model)