-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test cleanup #116
Closed
Closed
Test cleanup #116
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0ffdf88
remove unused imports; PEP8 cleanup
timdiller 6f0b311
PEP8
timdiller 50590af
Merge remote-tracking branch 'refs/remotes/upstream/master'
timdiller 745d7cd
Merge remote-tracking branch 'refs/remotes/upstream/master'
timdiller bb025d4
Merge remote-tracking branch 'refs/remotes/upstream/master'
timdiller 14edd0e
remove unused import
timdiller 14ca9ca
PEP8 formats
timdiller de3b1ad
explicit imports and PEP8 whitespace
timdiller 271158a
remove test file with no tests
timdiller 31a69cc
PEP8 fixes in traits/tests/
timdiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# Copyright (c) 2007, Enthought, Inc. | ||
# License: BSD Style. | ||
|
||
from traits.api import * | ||
from traitsui.api import * | ||
from traits.api import HasTraits, List, Str | ||
from traitsui.api import Item, SetEditor, View | ||
|
||
class Team ( HasTraits ): | ||
|
||
batting_order = List( Str ) | ||
roster = List( [ 'Tom', 'Dick', 'Harry', 'Sally' ], Str ) | ||
class Team (HasTraits): | ||
|
||
view = View( Item( 'batting_order', editor = SetEditor( name = 'roster', | ||
ordered = True ) ), | ||
'_', 'roster@', | ||
height=500, | ||
resizable=True) | ||
batting_order = List(Str) | ||
roster = List(['Tom', 'Dick', 'Harry', 'Sally'], Str) | ||
|
||
view = View(Item('batting_order', | ||
editor=SetEditor(name='roster', ordered=True),), | ||
'_', | ||
'roster@', | ||
height=500, | ||
resizable=True, | ||
) | ||
|
||
if __name__ == '__main__': | ||
Team().configure_traits() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tricky: there's an obviously deliberate style choice on Dave Morrill's part to include spaces around function arguments and base classes, and much of the traits code follows that style. I think we should aim for local consistency over PEP8 consistency.
There's always the option of just fixing the whole codebase, but see my other comment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see traits move to PEP8 compliance (if just to shut my editor up...), but you make a good point. This branch should probably be based off the Python 3 effort as that is the most likely to have many conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, the use of spaces around function arguments is not strictly consistent applied, or at least it wasn't in the tests I looked at. Use of spaces seems to have varied from time to time.
Obviously, I feel we should move toward PEP8 compliance everywhere (otherwise I wouldn't have spent the time to do it). I have PEP8 and PyFlakes hilighting in my editor by default, and it makes looking at code like Traits painful, and cleaning it up is relatively easy. I also find I navigate PEP8 code more easily.
That said, I'm willing to be overruled if there is strong opinion to favor local consistency over an Enthought standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the technical concern of merge conflict is dispositive here. The Python 3 branch is almost ready to go in. We can do PEP8 cleanup afterwards.