Skip to content

Fix syntax error in tests#140

Closed
sc68cal wants to merge 1 commit into
bottlepy:masterfrom
sc68cal:master
Closed

Fix syntax error in tests#140
sc68cal wants to merge 1 commit into
bottlepy:masterfrom
sc68cal:master

Conversation

@sc68cal

@sc68cal sc68cal commented Apr 2, 2011

Copy link
Copy Markdown
Contributor

I think Python 2.5 prefers named parameters, then the _args and *_kwargs, when calling a function.

Traceback (most recent call last):
File "/Users/scollins/Programming/bottle/test/testall.py", line 38, in <module>
suite = unittest.defaultTestLoader.loadTestsFromNames(test_names)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/unittest.py", line 565, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/unittest.py", line 533, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "/Users/scollins/Programming/bottle/test/test_plugins.py", line 167
return func(*a, test='me', **ka) + '; tail'
                   ^

@defnull

defnull commented Apr 3, 2011

Copy link
Copy Markdown
Member

Are you sure?

marc@mercury:~/bottle$ git checkout master
Already on 'master'
marc@mercury:~/bottle$ PYTHONPATH='.' python2.6 test/test_plugins.py
..................
----------------------------------------------------------------------
Ran 18 tests in 0.012s

OK

All tests run fine for me. Tested python 2.5, 2.6, 2.7, 3.1 (after 2to3) and 3.2

@defnull

defnull commented Apr 3, 2011

Copy link
Copy Markdown
Member

I just noticed that I did NOT test with 2.5 and you seem to have used 2.5 (according to your unittest path). I'll compile 2.5 and test again.

Edit: Yes, Python2.5 seems to have a problem with the syntax.

@sc68cal

sc68cal commented Apr 4, 2011

Copy link
Copy Markdown
Contributor Author

Sorry, I had my VirtualEnvs mixed up!

Though, this is really a tiny issue in retrospect, since they're trying to move everyone up to 2.7

@defnull

defnull commented Apr 4, 2011

Copy link
Copy Markdown
Member

Bottle does support 2.5, so it is a valid issue :) I'll merge as soon as I have the time to repair my testing environment. I normally test with 2.5, 2.6, 2.7, 3.1 and 3.2. The build-script seems to be broken for 2.5, though.

@defnull

defnull commented Apr 7, 2011

Copy link
Copy Markdown
Member

Cherry-Picked :) b20be42

Thanks. My test framework works again.

@defnull defnull closed this Apr 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants