107
107
""" % (sourcePath.path,))
110
def test_nonDefaultFollowsDefaultSyntaxError(self):
112
Source which has a non-default argument following a default argument
113
should include the line number of the syntax error. However these
114
exceptions do not include an offset.
118
def foo(bar=baz, bax):
121
sourcePath = FilePath(self.mktemp())
122
sourcePath.setContent(source)
124
count = withStderrTo(err, lambda: checkPath(sourcePath.path))
125
self.assertEqual(count, 1)
129
%s:1: non-default argument follows default argument
130
def foo(bar=baz, bax):
131
""" % (sourcePath.path,))
134
def test_nonKeywordAfterKeywordSyntaxError(self):
136
Source which has a non-keyword argument after a keyword argument should
137
include the line number of the syntax error. However these exceptions
138
do not include an offset.
144
sourcePath = FilePath(self.mktemp())
145
sourcePath.setContent(source)
147
count = withStderrTo(err, lambda: checkPath(sourcePath.path))
148
self.assertEqual(count, 1)
152
%s:1: non-keyword arg after keyword arg
154
""" % (sourcePath.path,))