
Running:

tests with filenames like test_p_* depends on py.test
py.test can run tests written for unittest.
latest py.test version used : pytest-5.4.1

Note: in win7 pytest-5.1.2 does not work with python 3.7.4; use 3.7.3, 3.7.5 or 3.6.8
https://github.com/pytest-dev/pytest/issues/5724 ,
https://github.com/pytest-dev/pytest/issues/5789
Used python 3.6.6 to run unit tests for cocos release 0.6.7

You should have py.test in the executable search path

Running one test:
 cd utest
 py.test [flags] test_file.py

Running all tests:
 cd utest
 py.test [flags]

Running a subset of all tests:
Use runner1.py with a custom list (see details in runner1.py)
 cd utest
 runner1.py my_list.txt
Or look at py.test docs


Coding:

Mockups, tests and test runners must be kept very simple, both to reduce the
bug count and to encourage people to write unit tests.

In unit tests, whenever possible you will want to replace pyglet with a
lightweight mockup for fast setUp.

Test to be run by pytest / unittest that import pyglet or a cocos module
that imports pyglet must include at the begin of file the lines

# set the desired pyglet mockup
import sys
sys.path.insert(0,'pyglet_mockup1')
import pyglet
assert pyglet.mock_level == 1

Example test that don't need the lines: test_collision_model.py
Example test that don't need the lines: test_tiles.py

Ideally we will have two or three pyglet mockups, providing increasing
functionality.

You should try to code for the most simple mockup that will support your test.

The readme in each mockup directory should describe which functionality supports,
and guidelines about what to not add at this mockup.
At the time we have only one pyglet mockup, found at
utest\pyglet_mockup1
See the readme in the mockup directory for capabilities.
See any test_p_ba_* test for examples using pyglet_mockup1.

It is important to keep director.py dependencies low: almost anything in cocos
needs to instantiate a director, so increasing the dependencies will need more
complex setUp or mockups, and more running time.
