Unit Testing - famish99/MuchoCorazon GitHub Wiki

General Issues

The framework has a few issues regarding operation listed below.

Garbage Collecting

If you see the following error below, it's due to an issue PyPy has with weak referencing, see ticket, and has been worked around for when tests pass properly. However, the gc lines don't seem to be called properly when the testcases fail out, so for now, this is an expected fail.

Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "/usr/local/lib/pypy-1.9/lib-python/2.7/gzip.py", line 371, in flush
    self._check_closed()
  File "/usr/local/lib/pypy-1.9/lib-python/2.7/gzip.py", line 145, in _check_closed
    if self.closed:
  File "/usr/local/lib/pypy-1.9/lib-python/2.7/gzip.py", line 353, in closed
    return self.fileobj is None
AttributeError: 'GzipFile' object has no attribute 'fileobj'

Test Issues

This section outlines the issues with testing the code itself

Deck

Within game.tests.DeckTestCase.test_shuffle we have issues with false negatives since the sample list is so small, that probabilistically the shuffle algorithm may not actually shuffle the cards around. If you see a fail, run it again to make sure it doesn't happen again, and you'll probably be alright. If not, you probably broke something.