run rest api tests with random ports
import os
import platform
import unittest
+from random import randrange
import pytest
import requests
@@ -14,6 +15,7 @@ from conans.client.rest.auth_manager import ConanApiAuthManager
from conans.client.rest.conan_requester import ConanRequester
from conans.client.rest.rest_client import RestApiClientFactory
from conans.client.rest.rest_client_v1 import complete_url
+from conans.client.tools import environment_append
from conans.client.userio import UserIO
from conans.model.info import ConanInfo
from conans.model.manifest import FileTreeManifest
@@ -68,6 +70,7 @@ class RestApiTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
if not cls.server:
+ with environment_append({"CONAN_SERVER_PORT": str(9300+randrange(100))}):
cls.server = TestServerLauncher(server_capabilities=['ImCool', 'TooCool'])
cls.server.start()
