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

Cleanup mixer test #504

Merged
merged 8 commits into from Aug 28, 2018

Conversation

Projects
None yet
2 participants
@e1000
Copy link

e1000 commented Aug 24, 2018

Some cleanup of the mixer_test.py . Merge this only if/after dropping support for Python < 2.7 !

  • cleanup deprecated test method aliases
  • some PEP8 cleanup
  • use Contectmanager 'with self.assertRaises as ...' ( /!\ this implies Python >= 2.7 /!\ )

We can then check the point in #496 ; later on , we might write some setUp and tearDown methods to clean the code further, but it would need some better understanding of what is tested and what can be removed...

@illume

This comment has been minimized.

Copy link
Member

illume commented Aug 24, 2018

💥 Thanks! 💥

I asked in the discord contributing channel if anyone else wants to do a code review for practice at that.

@e1000

This comment has been minimized.

Copy link
Author

e1000 commented Aug 24, 2018

Hello,

what do you mean by "code review for practice at that" ? About dropping Python2.7 ? Or adding setUp and tearDown methods ?

@illume

This comment has been minimized.

Copy link
Member

illume commented Aug 24, 2018

Sorry for being unclear.

I meant that I asked someone to do a code review of this pull request so that they could get practice at doing pull requests :)

else:
self.fail("no exception")
try:
self.assertEqual(cm.exception, arg_emsg)

This comment has been minimized.

Copy link
@e1000

e1000 Aug 25, 2018

Author

oups, I just realized, there is a mistake here (we never enter the assertEqual). It should be one indentation lower, and then it needs to be spelled like :

self.assertEqual(cm.exception.message, arg_emsg)

(or str(cm.exception) ...)

@illume

This comment has been minimized.

Copy link
Member

illume commented Aug 27, 2018

Hello,

it looks like there's an issue on python 3s.

======================================================================
ERROR: test_sound_args (pygame.tests.mixer_test.MixerModuleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pygame-1.9.5.dev0-py3.5-linux-x86_64.egg/pygame/tests/mixer_test.py", line 175, in test_sound_args
    self.assertEqual(cm.exception.message, arg_emsg)
AttributeError: 'TypeError' object has no attribute 'message'
@e1000

This comment has been minimized.

Copy link
Author

e1000 commented Aug 27, 2018

should be fixed by now...

@illume illume merged commit 1607b38 into pygame:master Aug 28, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@illume illume referenced this pull request Oct 16, 2018

Closed

1.9.5 release notes. #561

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.