timApp.tests package#

Subpackages#

Submodules#

timApp.tests.ci_browser_test_runner module#

Special browser test runner for GitLab CI.

Right now, CI tests are run in a Docker container on GitLab CI. This appears to cause problems with Selenium + Flask in Python’s own unittest. See https://gitlab.com/tim-jyu/tim/-/issues/2559

The solution is to run each test in a separate, unforked process and force each process to properly shut down and close all collections. Moreover, we

  • run each test max. 5 times before failing, and

  • add max. 3 minute timeout for each test.

timApp.tests.timliveserver module#

class timApp.tests.timliveserver.TimLiveServer(methodName='runTest')[source]#

Bases: flask_testing.utils.LiveServerTestCase

create_app()[source]#

Create your Flask app here, with any configuration you need.

setUp()[source]#

Hook method for setting up the test fixture before exercising it.

tearDown()[source]#

Hook method for deconstructing the test fixture after testing it.

Module contents#