Skip to content
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

Added math.Vector2 subclass test for issue #552 #560

Merged
merged 2 commits into from Oct 16, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+7 −0
Diff settings

Always

Just for now

@@ -1577,6 +1577,13 @@ def test_pickle(self):
self.assertEqual(pickle.loads(pickle.dumps(v2)), v2)
self.assertEqual(pickle.loads(pickle.dumps(v3)), v3)

def testVector2Subclass(self):

This comment has been minimized.

Copy link
@illume

illume Oct 16, 2018

Member

Can you please add a decorator to show that this is an expected failure?
Please see the documentation here on how to do that: https://docs.python.org/3/library/unittest.html#unittest.expectedFailure

This way the tests will pass on TravisCI and Appveyor.

This comment has been minimized.

Copy link
@cmtrapp02

cmtrapp02 Oct 16, 2018

Author Contributor

Yup, I'll do that as soon as I can. Thanks for the help

class Vector(pygame.math.Vector2):
pass
v = Vector(2.0,2.0)

This comment has been minimized.

Copy link
@illume

illume Oct 16, 2018

Member

It's usual to put a space after arguments. For example: v = Vector(2.0, 2.0)

This comment has been minimized.

Copy link
@cmtrapp02

cmtrapp02 Oct 16, 2018

Author Contributor

Okay thanks, I'll be sure to do that next time.

This comment has been minimized.

Copy link
@illume

illume Oct 16, 2018

Member

The pygame code isn't the cleanest yet, or using modern conventions everywhere. But eventually we will move to using pylint to help catch these types of issues.

v *= 2
self.assertEqual(v, (4.0,4.0))


if __name__ == '__main__':
unittest.main()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.