Skip to content

Commit 33055e7

Browse files
committed
Help linter a bit with tests, avoid warnings about "Analysis of function ... is skipped because it is unannotated"
1 parent a36b157 commit 33055e7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: locust/test/test_main.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def test_autostart_wo_run_time(self):
616616
try:
617617
response = requests.get(f"http://localhost:{port}/")
618618
except Exception:
619-
pass
619+
response = None
620620
proc.send_signal(signal.SIGTERM)
621621
stdout, stderr = proc.communicate()
622622
self.assertIn("Starting Locust", stderr)
@@ -655,7 +655,7 @@ def test_autostart_w_run_time(self):
655655
try:
656656
response = requests.get(f"http://localhost:{port}/")
657657
except Exception:
658-
pass
658+
response = None
659659
_, stderr = proc.communicate(timeout=4)
660660
self.assertIn("Starting Locust", stderr)
661661
self.assertIn("Run time limit set to 3 seconds", stderr)
@@ -813,6 +813,7 @@ def my_task(self):
813813
response = requests.get(f"http://localhost:{port}/")
814814
except ConnectionError:
815815
success = False
816+
response = None
816817
try:
817818
_, stderr = proc.communicate(timeout=5)
818819
except subprocess.TimeoutExpired:

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ python_version = "3.9"
160160
[tool.pyright]
161161
exclude = ["locust/test"]
162162
reportOptionalMemberAccess = "none"
163-
analyzeUnannotatedFunctions = false
163+
# analyzeUnannotatedFunctions = false
164164

165165

166166
# Hatch environments

0 commit comments

Comments
 (0)