Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused imports #552

Merged
merged 2 commits into from
Feb 23, 2017
Merged

Remove unused imports #552

merged 2 commits into from
Feb 23, 2017

Conversation

mbeacom
Copy link
Member

@mbeacom mbeacom commented Feb 23, 2017

This PR removes unused imports and exception assignments throughout the project.

Removed whitespace trimming per @cgoldberg's request.

@cgoldberg
Copy link
Member

@mbeacom please remove those whitespace changes (sorry, same thing happened with my editor) so the PR only contains your code changes. We will deal with the whitespace removal in separate PR's. I can re-review once you update. thanks!

mbeacom added a commit to mbeacom/locust that referenced this pull request Feb 23, 2017
@mbeacom mbeacom closed this Feb 23, 2017
@mbeacom mbeacom deleted the unused-imports branch February 23, 2017 16:13
@mbeacom mbeacom restored the unused-imports branch February 23, 2017 16:14
@mbeacom mbeacom reopened this Feb 23, 2017
@cgoldberg
Copy link
Member

cgoldberg commented Feb 23, 2017

@mbeacom thanks!

I just scanned your branch and it looks like there are still a few unused imports left. Can you remove those also in this PR? They occur in these 4 files:

  • /locust/__init__.py
  • /locust/test/test_locust_class.py
  • /examples/custom_xmlrpc_client/server.py
  • /locust/rpc/__init__.py

flake8 scan results:

(unused-imports)$ flake8 | grep "imported but unused"
./locust/__init__.py:1:1: F401 '.core.HttpLocust' imported but unused
./locust/__init__.py:1:1: F401 '.core.task' imported but unused
./locust/__init__.py:1:1: F401 '.core.TaskSet' imported but unused
./locust/__init__.py:1:1: F401 '.core.Locust' imported but unused
./locust/__init__.py:2:1: F401 '.exception.ResponseError' imported but unused
./locust/__init__.py:2:1: F401 '.exception.RescheduleTaskImmediately' imported but unused
./locust/__init__.py:2:1: F401 '.exception.InterruptTaskSet' imported but unused
./locust/test/test_locust_class.py:405:9: F401 'locust.stats.RequestStats' imported but unused
./locust/rpc/__init__.py:7:5: F401 '.socketrpc as rpc' imported but unused
./locust/rpc/__init__.py:9:1: F401 '.protocol.Message' imported but unused
./examples/custom_xmlrpc_client/server.py:4:1: F401 'xmlrpclib' imported but unused

@mbeacom
Copy link
Member Author

mbeacom commented Feb 23, 2017

@cgoldberg Thanks for your time! I have made the requested changes to the test and example files I missed in my update. I didn't remove the imports from the __init__.py files because it seems we are using them in some cases. i.e.: locust/runners.py#L19

Would you like me to refactor to remove the need for these init imports?

@cgoldberg
Copy link
Member

Would you like me to refactor to remove the need for these init imports?

I'm going to merge this as-is... any refactoring can be done in another PR.

@cgoldberg
Copy link
Member

Thanks for the contribution!
👍

@cgoldberg cgoldberg merged commit 5e2594b into locustio:master Feb 23, 2017
@mbeacom mbeacom deleted the unused-imports branch February 23, 2017 18:40
@cgoldberg cgoldberg mentioned this pull request Nov 10, 2017
AngelosTheodosiadis pushed a commit to datarobot/locust that referenced this pull request Jan 15, 2020
* Remove unused imports and assigned exceptions

* Remove additional unused imports locustio#552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants