Skip to content

Commit

Permalink
Updates to tests etc
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisKrone committed Apr 29, 2024
1 parent 6074220 commit eece81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 0 additions & 7 deletions locust/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ def parse(self, stream):
return result


def _is_package(path):
"""
Is the given path a Python package?
"""
return os.path.isdir(path) and os.path.exists(os.path.join(path, "__init__.py"))


def parse_locustfile_paths(paths: list[str]) -> list[str]:
"""
Returns a list of relative file paths.
Expand Down
7 changes: 4 additions & 3 deletions locust/test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,6 @@ def test_with_package_as_locustfile(self):
stdout, stderr = proc.communicate()
self.assertIn("Starting Locust", stderr)
self.assertIn("All users spawned:", stderr)
self.assertIn('"TestUser": 1', stderr)
self.assertIn('"UserSubclass": 1', stderr)
self.assertIn("Shutting down (exit code 0)", stderr)
self.assertEqual(0, proc.returncode)
Expand Down Expand Up @@ -1159,7 +1158,7 @@ def test_run_with_userclass_picker(self):
stderr=PIPE,
text=True,
)
gevent.sleep(1)
gevent.sleep(2)
proc.send_signal(signal.SIGTERM)
stdout, stderr = proc.communicate()

Expand Down Expand Up @@ -1832,7 +1831,7 @@ def t(self):
[
"locust",
"-f",
mocked.file_path[:-3], # remove ".py"
mocked.file_path[-3], # remove ".py"
"--headless",
"--master",
],
Expand All @@ -1851,6 +1850,8 @@ def t(self):
stdout=PIPE,
text=True,
)
gevent.sleep(1)

stdout = proc_worker.communicate()[0]
self.assertIn("Got error from master: locustfile parameter on master must be a plain filename", stdout)
proc.kill()
Expand Down

0 comments on commit eece81b

Please sign in to comment.