Posts

Showing posts from July, 2018

pygame 1.9.4 released

Image
pygame 1.9.4 has been released into the wild!
TLDR; Some highlights.python 3.7 support.beta pypy support. See Are we pypy yet?.pygame.draw fixespygame.math is not experimental anymore. Speedups and bugfixes.Debian, Mac homebrew, mac virtualenv, manylinux and other platform fixes.documentation fixes, jedi support for type ahead in editors like VSCode and VIM.Surface.blits for blitting many surfaces at once more quickly. Thanks A very special thanks to the people who have volunteered commits to pygame since the last release. In alphabetical order...
Adam Di Carlo (@adicarlo) | Christian Bender (@christianbender) | Don Kirkby (@donkirkby) | endolith (@endolith) | hjpotter92 (@hjpotter92) | Ian Mallett (@imallett) | Lenard Lindstrom (@llindstrom) | Mathias Weber (@mweb) | Matti Picus (@mattip) | Nicholas Tollervey (@ntoll) | (@orangudan) | Raymon Skjørten Hansen (@raymonshansen) | René Dudfield (@illume) | Stefan Bethge (@kjyv) | Stuart Axon (@stuaxo) | Thomas Kluyver (@takluyver) | Tobi…

Draft of, ^Let's write a unit test!^

Image
(BeginDraft)

So, I started writing this for people who want to 'contribute' to Free Libre and Open source projects.
It's not finished yet, but still useful, and I'd like a bit of feedback, and to start linking to it from the pygame developer docs. So there. (/EndDraft)

A unit test is a piece of code which tests one thing works well in isolation from other parts of software. In this guide, I'm going to explain how to write one using the standard python unittest module, for the pygame game library. You can apply this advice to most python projects, or free/libre open source projects in general.
A minimal test. What pygame.draw.ellipse should do: http://www.pygame.org/docs/ref/draw.html#pygame.draw.ellipse
Where to put the test: https://github.com/pygame/pygame/blob/master/test/draw_test.py

def test_ellipse(self): import pygame.draw surf = pygame.Surface((320, 200)) pygame.draw.ellipse(surf, (255, 0, 0), (10, 10, 25, 20))
All the test does is call the draw f…