Hi,

Is it possible to emulate a range of concurrent connections to a http server with the requests module?

import os
import requests

from test_support import unittest

class HTTPBenchmarkTestCase(unittest.TestCase):

    url = 'http://localhost/benchmark/'

    def setUp(self):
        pass

    def test_benchmark_concurrency(self):
        # XXX it would be really nice to execute 10 concurrent requests
        # with 10 separated threads/connections.
        r = requests.get(self.url)
        self.assertEqual(r.status_code, 200)

    def tearDown(self):
        pass
    def runTest(self):
        pass


What do you think?

Etienne
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to