Whitespace normalisation inside funcs in test_pytest_nose.py

--HG--
branch : trunk
This commit is contained in:
Ed Singleton 2010-09-03 10:09:41 +01:00
parent c542806396
commit b690290c3f
1 changed files with 6 additions and 2 deletions

View File

@ -8,8 +8,10 @@ def test_nose_setup(testdir):
def test_hello(): def test_hello():
assert l == [1] assert l == [1]
def test_world(): def test_world():
assert l == [1,2] assert l == [1,2]
test_hello.setup = lambda: l.append(1) test_hello.setup = lambda: l.append(1)
test_hello.teardown = lambda: l.append(2) test_hello.teardown = lambda: l.append(2)
""") """)
@ -34,9 +36,11 @@ def test_nose_setup_func(testdir):
def test_hello(): def test_hello():
print l print l
assert l == [1] assert l == [1]
def test_world(): def test_world():
print l print l
assert l == [1,2] assert l == [1,2]
test_hello.setup = my_setup test_hello.setup = my_setup
test_hello.teardown = my_teardown test_hello.teardown = my_teardown
""") """)
@ -106,7 +110,6 @@ def test_nose_test_generator_fixtures(testdir):
# expect.append('teardown') # expect.append('teardown')
#expect.append('setup') #expect.append('setup')
eq_(self.called, expect) eq_(self.called, expect)
""") """)
result = testdir.runpytest(p, '-p', 'nose') result = testdir.runpytest(p, '-p', 'nose')
result.stdout.fnmatch_lines([ result.stdout.fnmatch_lines([
@ -118,6 +121,7 @@ def test_module_level_setup(testdir):
testdir.makepyfile(""" testdir.makepyfile("""
from nose.tools import with_setup from nose.tools import with_setup
items = {} items = {}
def setup(): def setup():
items[1]=1 items[1]=1
@ -137,7 +141,6 @@ def test_module_level_setup(testdir):
def test_local_setup(): def test_local_setup():
assert items[2] == 2 assert items[2] == 2
assert 1 not in items assert 1 not in items
""") """)
result = testdir.runpytest('-p', 'nose') result = testdir.runpytest('-p', 'nose')
result.stdout.fnmatch_lines([ result.stdout.fnmatch_lines([
@ -148,6 +151,7 @@ def test_module_level_setup(testdir):
def test_nose_style_setup_teardown(testdir): def test_nose_style_setup_teardown(testdir):
testdir.makepyfile(""" testdir.makepyfile("""
l = [] l = []
def setup_module(): def setup_module():
l.append(1) l.append(1)