locust 2.39.2.dev16__py3-none-any.whl → 2.40.1.dev2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
locust/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '2.39.2.dev16'
32
- __version_tuple__ = version_tuple = (2, 39, 2, 'dev16')
31
+ __version__ = version = '2.40.1.dev2'
32
+ __version_tuple__ = version_tuple = (2, 40, 1, 'dev2')
33
33
 
34
34
  __commit_id__ = commit_id = None
locust/pytestplugin.py CHANGED
@@ -1,13 +1,15 @@
1
- from locust.clients import HttpSession
2
- from locust.contrib.fasthttp import FastHttpSession
3
- from locust.event import EventHook
4
- from locust.user.users import User
1
+ # This is used in pytest-based, see examples/test_pytest.py
2
+ from typing import TYPE_CHECKING
5
3
 
6
4
  import pytest
7
5
 
6
+ if TYPE_CHECKING:
7
+ from locust.user.users import User
8
8
 
9
- class NoOpEvent(EventHook):
10
- pass
9
+
10
+ class NoOpEvent: # Fake locust.event.EventHook
11
+ def fire(self, *, reverse=False, **kwargs):
12
+ pass
11
13
 
12
14
 
13
15
  _config: pytest.Config
@@ -20,7 +22,10 @@ def pytest_configure(config):
20
22
 
21
23
 
22
24
  @pytest.fixture
23
- def session(user: User | None = None):
25
+ def session(user: "User | None" = None):
26
+ # lazy import to avoid gevent monkey patching unless you actually use this fixture
27
+ from locust.clients import HttpSession
28
+
24
29
  s = HttpSession(
25
30
  base_url=user.host if user else _config.getoption("--host"),
26
31
  request_event=user.environment.events.request if user else NoOpEvent(),
@@ -31,7 +36,10 @@ def session(user: User | None = None):
31
36
 
32
37
 
33
38
  @pytest.fixture
34
- def fastsession(user: User | None = None):
39
+ def fastsession(user: "User | None" = None):
40
+ # lazy import to avoid gevent monkey patching unless you actually use this fixture
41
+ from locust.contrib.fasthttp import FastHttpSession
42
+
35
43
  s = FastHttpSession(
36
44
  base_url=user.host if user else _config.getoption("--host"),
37
45
  request_event=user.environment.events.request if user else NoOpEvent(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: locust
3
- Version: 2.39.2.dev16
3
+ Version: 2.40.1.dev2
4
4
  Summary: Developer-friendly load testing framework
5
5
  Project-URL: homepage, https://locust.io/
6
6
  Project-URL: repository, https://github.com/locustio/locust
@@ -1,6 +1,6 @@
1
1
  locust/__init__.py,sha256=HadpgGidiyCDPSKwkxrk1Qw6eB7dTmftNJVftuJzAiw,1876
2
2
  locust/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
3
- locust/_version.py,sha256=3H0E7h2_cGhD3ePVz44fj8aqqXkh02rK_tOndJPGPA8,721
3
+ locust/_version.py,sha256=MpW1opF4aC7WUUENSIz9Taw97ltDvAdLZo7V-7Z6VUw,719
4
4
  locust/argument_parser.py,sha256=t6mAoK9u13DxC9UH-alVqS6fFABFTyNWSJG89yQ4QQQ,33056
5
5
  locust/clients.py,sha256=CeyTYgKuASZS6QKc71T4V3bqYPGlJr3Ef_i6qP07gTQ,19498
6
6
  locust/debug.py,sha256=7CCm8bIg44uGH2wqBlo1rXBzV2VzwPicLxLewz8r5CQ,5099
@@ -13,7 +13,7 @@ locust/input_events.py,sha256=lqLDB2Ax-OQ7-vtYNkGjySjfaWVobBzqf0GxRwjcLcQ,3323
13
13
  locust/log.py,sha256=5E2ZUOa3V4sfCqa-470Gle1Ik9L5nxYitsjEB9tRwE0,3455
14
14
  locust/main.py,sha256=rcUD3MnBnFqeXC41fjGkh4p9POLGWglgPvRAfHKtEnc,28896
15
15
  locust/py.typed,sha256=gkWLl8yD4mIZnNYYAIRM8g9VarLvWmTAFeUfEbxJLBw,65
16
- locust/pytestplugin.py,sha256=fc616tXWQ0FvZ6aa_sBzvaCwjqsBo-tg8uP3-0jxcdU,1116
16
+ locust/pytestplugin.py,sha256=yV_TQtxVI8gHe0J4sjZNMCOp43EO-XyMVjn0cyfkquw,1457
17
17
  locust/runners.py,sha256=niYmGsfOpxMfVmTXGod4MYTefpaZ2wirFlhqxRw5mq4,70617
18
18
  locust/shape.py,sha256=t-lwBS8LOjWcKXNL7j2U3zroIXJ1b0fazUwpRYQOKXw,1973
19
19
  locust/stats.py,sha256=qyoSKT0i7RunLDj5pMGqizK1Sp8bcqUsXwh2m4_DpR8,47203
@@ -56,8 +56,8 @@ locust/webui/dist/assets/index-BjqxSg7R.js,sha256=3JyrKWfAg8LlTy2bxAJh73c6njNPhN
56
56
  locust/webui/dist/assets/terminal.gif,sha256=iw80LO2u0dnf4wpGfFJZauBeKTcSpw9iUfISXT2nEF4,75302
57
57
  locust/webui/dist/assets/testruns-dark.png,sha256=G4p2VZSBuuqF4neqUaPSshIp5OKQJ_Bvb69Luj6XuVs,125231
58
58
  locust/webui/dist/assets/testruns-light.png,sha256=JinGDiiBPOkhpfF-XCbmQqhRInqItrjrBTLKt5MlqVI,130301
59
- locust-2.39.2.dev16.dist-info/METADATA,sha256=ZCoN80_d3U547JOSSk_hj3cmmB7H9eKAOeas21xz2iM,9599
60
- locust-2.39.2.dev16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
61
- locust-2.39.2.dev16.dist-info/entry_points.txt,sha256=k0386Xi0vBR3OVIqeGNYz7cz8QUGJ3iLmQ0WQU91ogw,85
62
- locust-2.39.2.dev16.dist-info/licenses/LICENSE,sha256=5hnz-Vpj0Z3kSCQl0LzV2hT1TLc4LHcbpBp3Cy-EuyM,1110
63
- locust-2.39.2.dev16.dist-info/RECORD,,
59
+ locust-2.40.1.dev2.dist-info/METADATA,sha256=uVs8S06YOO-2R2Inm6zRYG3XmhijXqGv_VG1tG02X60,9598
60
+ locust-2.40.1.dev2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
61
+ locust-2.40.1.dev2.dist-info/entry_points.txt,sha256=k0386Xi0vBR3OVIqeGNYz7cz8QUGJ3iLmQ0WQU91ogw,85
62
+ locust-2.40.1.dev2.dist-info/licenses/LICENSE,sha256=5hnz-Vpj0Z3kSCQl0LzV2hT1TLc4LHcbpBp3Cy-EuyM,1110
63
+ locust-2.40.1.dev2.dist-info/RECORD,,