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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/custom_xmlrpc_client/server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import time
import random
from SimpleXMLRPCServer import SimpleXMLRPCServer
import xmlrpclib

def get_time():
time.sleep(random.random())
Expand Down
1 change: 0 additions & 1 deletion locust/clients.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import re
import time
from datetime import timedelta
from six.moves.urllib.parse import urlparse, urlunparse
import six

Expand Down
1 change: 0 additions & 1 deletion locust/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from time import time
import sys
import random
import warnings
import traceback
import logging

Expand Down
7 changes: 3 additions & 4 deletions locust/rpc/socketrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import gevent
from gevent import socket
from gevent import queue

from locust.exception import LocustError
from .protocol import Message
Expand All @@ -25,7 +24,7 @@ def _send_obj(sock, msg):
packed = struct.pack('!i', len(data)) + data
try:
sock.sendall(packed)
except Exception as e:
except Exception:
try:
sock.close()
except:
Expand All @@ -52,7 +51,7 @@ def handle():
try:
while True:
self.command_queue.put_nowait(_recv_obj(sock))
except Exception as e:
except Exception:
try:
sock.close()
except:
Expand Down Expand Up @@ -99,7 +98,7 @@ def handle_slave(sock):
try:
while True:
self.event_queue.put_nowait(_recv_obj(sock))
except Exception as e:
except Exception:
logger.info("Slave disconnected")
slaves.remove(sock)
if self.slave_index == len(slaves) and len(slaves) > 0:
Expand Down
1 change: 0 additions & 1 deletion locust/test/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from requests.exceptions import (RequestException, MissingSchema,
InvalidSchema, InvalidURL)

import gevent
from locust.clients import HttpSession
from locust.stats import global_stats
from .testcases import WebserverTestCase
Expand Down
3 changes: 1 addition & 2 deletions locust/test/test_locust_class.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import unittest
import six

from locust.core import HttpLocust, Locust, TaskSet, task, events
Expand Down Expand Up @@ -403,7 +402,7 @@ class MyUnauthorizedLocust(HttpLocust):
self.assertEqual(401, unauthorized.client.get("/basic_auth").status_code)

def test_log_request_name_argument(self):
from locust.stats import RequestStats, global_stats
from locust.stats import global_stats
self.response = ""

class MyLocust(HttpLocust):
Expand Down
4 changes: 1 addition & 3 deletions locust/test/test_main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import unittest

from locust.core import HttpLocust, Locust, TaskSet
from locust import main
from .testcases import LocustTestCase, WebserverTestCase
from .testcases import LocustTestCase

class TestTaskSet(LocustTestCase):
def test_is_locust(self):
Expand Down
4 changes: 2 additions & 2 deletions locust/test/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from gevent.queue import Queue
from gevent import sleep

from locust.runners import LocalLocustRunner, MasterLocustRunner, SlaveLocustRunner
from locust.runners import LocalLocustRunner, MasterLocustRunner
from locust.core import Locust, task, TaskSet
from locust.exception import LocustError
from locust.rpc import Message
from locust.stats import RequestStats, global_stats
from locust.stats import global_stats
from locust.main import parse_options
from locust.test.testcases import LocustTestCase
from locust import events
Expand Down
3 changes: 1 addition & 2 deletions locust/test/test_stats.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import unittest
import time

from requests.exceptions import RequestException
from six.moves import xrange

from .testcases import WebserverTestCase
from locust.stats import RequestStats, StatsEntry, global_stats
from locust.core import HttpLocust, Locust, TaskSet, task
from locust.core import HttpLocust, TaskSet, task
from locust.inspectlocust import get_task_ratio_dict
from locust.rpc.protocol import Message

Expand Down
1 change: 0 additions & 1 deletion locust/test/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from six.moves import StringIO

import requests
import mock
import gevent
from gevent import wsgi

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# encoding: utf-8

from setuptools import setup, find_packages, Command
import sys, os, re, ast
from setuptools import setup, find_packages
import os, re, ast


# parse version from locust/__init__.py
Expand Down