summaryrefslogtreecommitdiff
path: root/tests/test_task.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_task.py')
-rw-r--r--tests/test_task.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/test_task.py b/tests/test_task.py
index 6466823..0965bf5 100644
--- a/tests/test_task.py
+++ b/tests/test_task.py
@@ -1,5 +1,5 @@
-import unittest
import io
+import unittest
class TestThreadedTaskDispatcher(unittest.TestCase):
@@ -15,7 +15,7 @@ class TestThreadedTaskDispatcher(unittest.TestCase):
class BadDummyTask(DummyTask):
def service(self):
- super(BadDummyTask, self).service()
+ super().service()
inst.stop_count += 1
raise Exception
@@ -400,7 +400,7 @@ class TestWSGITask(unittest.TestCase):
inst = self._makeOne()
def execute():
- raise socket.error
+ raise OSError
inst.execute = execute
self.assertRaises(socket.error, inst.service)
@@ -922,7 +922,7 @@ class TestErrorTask(unittest.TestCase):
self.assertEqual(lines[8], b"(generated by waitress)")
-class DummyTask(object):
+class DummyTask:
serviced = False
cancelled = False
@@ -933,7 +933,7 @@ class DummyTask(object):
self.cancelled = True
-class DummyAdj(object):
+class DummyAdj:
log_socket_errors = True
ident = "waitress"
host = "127.0.0.1"
@@ -941,7 +941,7 @@ class DummyAdj(object):
url_prefix = ""
-class DummyServer(object):
+class DummyServer:
server_name = "localhost"
effective_port = 80
@@ -949,7 +949,7 @@ class DummyServer(object):
self.adj = DummyAdj()
-class DummyChannel(object):
+class DummyChannel:
closed_when_done = False
adj = DummyAdj()
creation_time = 0
@@ -970,7 +970,7 @@ class DummyChannel(object):
return len(data)
-class DummyParser(object):
+class DummyParser:
version = "1.0"
command = "GET"
path = "/"
@@ -990,7 +990,7 @@ def filter_lines(s):
return list(filter(None, s.split(b"\r\n")))
-class DummyLogger(object):
+class DummyLogger:
def __init__(self):
self.logged = []