diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-08-04 02:36:18 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-08-04 02:36:18 (GMT) |
commit | 6db15d7307b831766617f6a9700ecc4c75a16081 (patch) | |
tree | cbc747970fd7d68844de8abaca57c8102dc859b2 /Lib/test | |
parent | cea2cc4a21e7e2ba84f6dc11682821e502bd1f5f (diff) | |
download | cpython-6db15d7307b831766617f6a9700ecc4c75a16081.zip cpython-6db15d7307b831766617f6a9700ecc4c75a16081.tar.gz cpython-6db15d7307b831766617f6a9700ecc4c75a16081.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/pyclbr_input.py | 8 | ||||
-rw-r--r-- | Lib/test/test_decorators.py | 16 | ||||
-rw-r--r-- | Lib/test/test_pyclbr.py | 2 | ||||
-rw-r--r-- | Lib/test/test_threadsignals.py | 16 |
4 files changed, 21 insertions, 21 deletions
diff --git a/Lib/test/pyclbr_input.py b/Lib/test/pyclbr_input.py index b410fcc..8efc9de 100644 --- a/Lib/test/pyclbr_input.py +++ b/Lib/test/pyclbr_input.py @@ -10,11 +10,11 @@ class Other(object): class B (object): def bm(self): pass - + class C (B): foo = Other().foo om = Other.om - + d = 10 # XXX: This causes test_pyclbr.py to fail, but only because the @@ -23,9 +23,9 @@ class C (B): # The pyclbr.py module gets this right as it parses the text. # #f = f - + def m(self): pass - + @staticmethod def sm(self): pass diff --git a/Lib/test/test_decorators.py b/Lib/test/test_decorators.py index ef40e17..dbe45cf 100644 --- a/Lib/test/test_decorators.py +++ b/Lib/test/test_decorators.py @@ -22,8 +22,8 @@ class DbcheckError (Exception): # A real version of this would set attributes here Exception.__init__(self, "dbcheck %r failed (func=%s args=%s kwds=%s)" % (exprstr, func, args, kwds)) - - + + def dbcheck(exprstr, globals=None, locals=None): "Decorator to implement debugging assertions" def decorate(func): @@ -66,7 +66,7 @@ def memoize(func): # Unhashable argument return func(*args) return call - + # ----------------------------------------------- class TestDecorators(unittest.TestCase): @@ -80,7 +80,7 @@ class TestDecorators(unittest.TestCase): def test_staticmethod_function(self): @staticmethod - def notamethod(x): + def notamethod(x): return x self.assertRaises(TypeError, notamethod, 1) @@ -94,7 +94,7 @@ class TestDecorators(unittest.TestCase): def test_argforms(self): # A few tests of argument passing, as we use restricted form # of expressions for decorators. - + def noteargs(*args, **kwds): def decorate(func): setattr(func, 'dbval', (args, kwds)) @@ -129,7 +129,7 @@ class TestDecorators(unittest.TestCase): # XXX: This doesn't work unless memoize is the last decorator - # see the comment in countcalls. counts = {} - @countcalls(counts) @memoize + @countcalls(counts) @memoize def double(x): return x * 2 @@ -157,7 +157,7 @@ class TestDecorators(unittest.TestCase): for expr in [ "1+2", "x[3]", "(1, 2)" ]: # Sanity check: is expr is a valid expression by itself? compile(expr, "testexpr", "exec") - + codestr = "@%s\ndef f(): pass" % expr self.assertRaises(SyntaxError, compile, codestr, "test", "exec") @@ -166,7 +166,7 @@ class TestDecorators(unittest.TestCase): def unimp(func): raise NotImplementedError context = dict(nullval=None, unimp=unimp) - + for expr, exc in [ ("undef", NameError), ("nullval", TypeError), ("nullval.attr", AttributeError), diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index eddd593..ae8a396 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -151,7 +151,7 @@ class PyclbrTest(TestCase): # if it were not commented out. # self.checkModule('test.pyclbr_input') - + def test_others(self): cm = self.checkModule diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py index 84cf2fa..778879d 100644 --- a/Lib/test/test_threadsignals.py +++ b/Lib/test/test_threadsignals.py @@ -10,7 +10,7 @@ from test import test_support, TestSkipped if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos': raise TestSkipped, "Can't test signal on %s" % sys.platform -signal_blackboard = { signal.SIGUSR1 : {'tripped': 0, 'tripped_by': 0 }, +signal_blackboard = { signal.SIGUSR1 : {'tripped': 0, 'tripped_by': 0 }, signal.SIGUSR2 : {'tripped': 0, 'tripped_by': 0 }, signal.SIGALRM : {'tripped': 0, 'tripped_by': 0 } } @@ -28,7 +28,7 @@ def registerSignals((for_usr1, for_usr2, for_alrm)): # The signal handler. Just note that the signal occured and # from who. def handle_signals(sig,frame): - signal_blackboard[sig]['tripped'] += 1 + signal_blackboard[sig]['tripped'] += 1 signal_blackboard[sig]['tripped_by'] = thread.get_ident() # a function that will be spawned as a separate thread. @@ -55,20 +55,20 @@ class ThreadSignals(unittest.TestCase): # wait for it return. if signal_blackboard[signal.SIGUSR2]['tripped'] == 0 \ or signal_blackboard[signal.SIGUSR2]['tripped'] == 0: - signal.alarm(1) - signal.pause() - signal.alarm(0) + signal.alarm(1) + signal.pause() + signal.alarm(0) self.assertEqual( signal_blackboard[signal.SIGUSR1]['tripped'], 1) - self.assertEqual( signal_blackboard[signal.SIGUSR1]['tripped_by'], + self.assertEqual( signal_blackboard[signal.SIGUSR1]['tripped_by'], thread.get_ident()) self.assertEqual( signal_blackboard[signal.SIGUSR2]['tripped'], 1) - self.assertEqual( signal_blackboard[signal.SIGUSR2]['tripped_by'], + self.assertEqual( signal_blackboard[signal.SIGUSR2]['tripped_by'], thread.get_ident()) def spawnSignallingThread(self): thread.start_new_thread(send_signals, ()) - + def test_main(): oldsigs = registerSignals((handle_signals, handle_signals, handle_signals)) |