Skip to content

Commit 662b3bd

Browse files
authored
Add shebang functionality to tests (microsoft#1784)
Tests that contain `if __name__ == "__main__":` now have a shebang line and execute permission.
1 parent 67ebecd commit 662b3bd

39 files changed

+78
-0
lines changed

test/agentchat/contrib/capabilities/test_context_handling.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import os
35
import sys

test/agentchat/contrib/chat_with_teachable_agent.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
from autogen import UserProxyAgent, config_list_from_json
24
from autogen.agentchat.contrib.capabilities.teachability import Teachability
35
from autogen import ConversableAgent

test/agentchat/contrib/test_agent_builder.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import os
35
import json

test/agentchat/contrib/test_compressible_agent.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import sys
35
import autogen

test/agentchat/contrib/test_gpt_assistant.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
from unittest.mock import MagicMock
24
import uuid
35
import pytest

test/agentchat/contrib/test_img_utils.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import base64
24
import os
35
import unittest

test/agentchat/contrib/test_llava.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import unittest
24
from unittest.mock import MagicMock, patch
35

test/agentchat/contrib/test_lmm.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import unittest
24
from unittest.mock import MagicMock
35

test/agentchat/contrib/test_qdrant_retrievechat.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import os
24
import sys
35
import pytest

test/agentchat/contrib/test_retrievechat.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import os
35
import sys

test/agentchat/contrib/test_society_of_mind_agent.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import sys
35
import autogen

test/agentchat/contrib/test_teachable_agent.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import os
35
import sys

test/agentchat/contrib/test_web_surfer.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import os
24
import sys
35
import re

test/agentchat/test_agent_usage.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
from autogen import gather_usage_summary
24
from autogen import AssistantAgent, UserProxyAgent
35
from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST

test/agentchat/test_assistant_agent.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import os
24
import sys
35
import pytest

test/agentchat/test_async.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import asyncio
35
import autogen

test/agentchat/test_async_chats.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
from autogen import AssistantAgent, UserProxyAgent
24
from autogen import GroupChat, GroupChatManager
35
import asyncio

test/agentchat/test_async_get_human_input.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import asyncio
24
import os
35
import sys

test/agentchat/test_chats.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
from autogen import AssistantAgent, UserProxyAgent
24
from autogen import GroupChat, GroupChatManager
35
from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST

test/agentchat/test_conversable_agent.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import asyncio
24
import copy
35
import sys

test/agentchat/test_function_call.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import asyncio
35
import json

test/agentchat/test_function_call_groupchat.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import autogen
24
import pytest
35
import asyncio

test/agentchat/test_groupchat.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
from typing import Any, Dict, List, Optional, Type
24
from autogen import AgentNameConflict
35
import pytest

test/agentchat/test_human_input.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import autogen
24
import pytest
35
from unittest.mock import MagicMock

test/agentchat/test_math_user_proxy_agent.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import sys
35
import os

test/agentchat/test_nested.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import sys
35
import os

test/agentchat/test_tool_calls.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import inspect
24
import pytest
35
import json

test/cache/test_cache.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import unittest
24
from unittest.mock import patch, MagicMock
35
from autogen.cache.cache import Cache

test/cache/test_disk_cache.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import unittest
24
from unittest.mock import patch, MagicMock
35
from autogen.cache.disk_cache import DiskCache

test/cache/test_redis_cache.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import unittest
24
import pickle
35
from unittest.mock import patch, MagicMock

test/oai/_test_completion.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import datasets
24
import sys
35
import numpy as np

test/oai/test_client.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import shutil
24
import time
35
import pytest

test/oai/test_client_stream.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import json
24
from typing import Any, Dict, List, Literal, Optional, Union
35
from unittest.mock import MagicMock

test/oai/test_utils.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import json
24
import logging
35
import os

test/test_browser_utils.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import pytest
24
import os
35
import sys

test/test_code_utils.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import os
24
import tempfile
35
import unittest

test/test_notebook.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
import sys
24
import os
35
import pytest

test/test_retrieve_utils.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
"""
24
Unit test for retrieve_utils.py
35
"""

test/test_token_count.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3 -m pytest
2+
13
from autogen.token_count_utils import (
24
count_token,
35
num_tokens_from_functions,

0 commit comments

Comments
 (0)