Function with *args type param causes invalid test code

Bug #440773 reported by Michal Kwiatkowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pythoscope
Fix Released
High
Michal Kwiatkowski

Bug Description

Reported by ssteinerX on pythoscope google group: http://groups.google.com/group/pythoscope/browse_thread/thread/47f97387baf089f4

One of my functions has the signature:

def build_url(*params):
 pass

 When I called the function with a list, like so, in a points-of-
entry file, the following test code was generated:

   def test_build_url_returns_thisisa_for_tuple(self):
       self.assertEqual('this/is/a', build_url(params=('', 'this',
'is', 'a')))

 Unfortunately, using a keyword parameter like that causes this:

ERROR: test_build_url_returns_thisisatest_for_tuple
(wssw_urlutils.tests.test_url_util.TestBuildUrl)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/Users/ssteiner/.../test_url_util.py", line 29, in
test_build_url_returns_thisisatest_for_tuple
   self.assertEqual('this/is/a/test', build_url(params=((' this ',
' \r\nis \r\n', '\t\r\n a\r\n\t', ' test '),)))
TypeError: build_url() got an unexpected keyword argument 'params'

Changed in pythoscope:
assignee: nobody → Michal Kwiatkowski (ruby)
Revision history for this message
Michal Kwiatkowski (ruby) wrote :

Fixed in trunk r286.

Changed in pythoscope:
status: Confirmed → Fix Committed
Revision history for this message
Michal Kwiatkowski (ruby) wrote :

Fix released in Pythoscope 0.4.2.

Changed in pythoscope:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.