summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lange <jml@mumak.net>2015-11-02 18:25:00 +0000
committerJonathan Lange <jml@mumak.net>2015-11-02 20:55:19 +0000
commit5e91d1d2c6ad2bb52e302d82d98f289b5ec57aae (patch)
treebe6ab3fa05eb20bd5e7b6c1353e104e46f5c011c
parenta854c02aa7564d9ff9ce5ea1d795d6f61072b13e (diff)
downloadtesttools-5e91d1d2c6ad2bb52e302d82d98f289b5ec57aae.tar.gz
Lint clear-up
-rw-r--r--testtools/testresult/doubles.py13
-rw-r--r--testtools/tests/test_testresult.py20
2 files changed, 22 insertions, 11 deletions
diff --git a/testtools/testresult/doubles.py b/testtools/testresult/doubles.py
index d86f7fa..493ae80 100644
--- a/testtools/testresult/doubles.py
+++ b/testtools/testresult/doubles.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2009-2010 testtools developers. See LICENSE for details.
+# Copyright (c) 2009-2015 testtools developers. See LICENSE for details.
"""Doubles of test result objects, useful for testing unittest code."""
@@ -167,8 +167,9 @@ class StreamResult(object):
self._events.append(('stopTestRun',))
def status(self, test_id=None, test_status=None, test_tags=None,
- runnable=True, file_name=None, file_bytes=None, eof=False,
- mime_type=None, route_code=None, timestamp=None):
- self._events.append(('status', test_id, test_status, test_tags,
- runnable, file_name, file_bytes, eof, mime_type, route_code,
- timestamp))
+ runnable=True, file_name=None, file_bytes=None, eof=False,
+ mime_type=None, route_code=None, timestamp=None):
+ self._events.append(
+ ('status', test_id, test_status, test_tags,
+ runnable, file_name, file_bytes, eof, mime_type, route_code,
+ timestamp))
diff --git a/testtools/tests/test_testresult.py b/testtools/tests/test_testresult.py
index 924313c..e81c139 100644
--- a/testtools/tests/test_testresult.py
+++ b/testtools/tests/test_testresult.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2008-2012 testtools developers. See LICENSE for details.
+# Copyright (c) 2008-2015 testtools developers. See LICENSE for details.
"""Test TestResults and related things."""
@@ -15,7 +15,6 @@ import sys
import tempfile
import threading
from unittest import TestSuite
-import warnings
from extras import safe_hasattr, try_imports
@@ -225,11 +224,14 @@ class Python27Contract(Python26Contract):
def test_failfast(self):
result = self.makeResult()
result.failfast = True
+
class Failing(TestCase):
def test_a(self):
self.fail('a')
+
def test_b(self):
self.fail('b')
+
TestSuite([Failing('test_a'), Failing('test_b')]).run(result)
self.assertEqual(1, result.testsRun)
@@ -520,8 +522,15 @@ class TestStreamResultContract(object):
result.startTestRun()
self.addCleanup(result.stopTestRun)
now = datetime.datetime.now(utc)
- args = [[_u("foo"), s] for s in ['exists', 'inprogress', 'xfail',
- 'uxsuccess', 'success', 'fail', 'skip']]
+ args = [[_u("foo"), s] for s in [
+ 'exists',
+ 'inprogress',
+ 'xfail',
+ 'uxsuccess',
+ 'success',
+ 'fail',
+ 'skip',
+ ]]
inputs = list(dict(
runnable=False,
test_tags=set(['quux']),
@@ -537,7 +546,8 @@ class TestStreamResultContract(object):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
s = list(iterable)
param_dicts = []
- for ss in chain.from_iterable(combinations(s, r) for r in range(len(s)+1)):
+ combos = (combinations(s, r) for r in range(len(s) + 1))
+ for ss in chain.from_iterable(combos):
param_dicts.append(dict(ss))
return param_dicts