Files
@ cddff7f0dd08
Branch filter:
Location: kallithea/scripts/whitespacecleanup.sh
cddff7f0dd08
1.4 KiB
text/x-sh
tests: use temporary copy of test.ini, possibly customized for TEST_DB
It was an undocumented feature that if setting the environment variable
TEST_DB, that would be used for tests instead of the default
kallithea/tests/test.ini sqlalchemy.url . That did however not work for Git
hooks and tests would fail.
Instead, create a copy of test.ini in the temp folder and use that for testing.
If TEST_DB is set, edit the file so the specified DB URL is used. This fixes
Git hook related tests if TEST_DB is used.
Since this also changes the path of %(here)s to the temporary location, just
use the default paths.
This also has the advantage that the data folders are now in the temp folder
as well. Therefore a broken data folder, from a past run, can no longer
influence a test.
It was an undocumented feature that if setting the environment variable
TEST_DB, that would be used for tests instead of the default
kallithea/tests/test.ini sqlalchemy.url . That did however not work for Git
hooks and tests would fail.
Instead, create a copy of test.ini in the temp folder and use that for testing.
If TEST_DB is set, edit the file so the specified DB URL is used. This fixes
Git hook related tests if TEST_DB is used.
Since this also changes the path of %(here)s to the temporary location, just
use the default paths.
This also has the advantage that the data folders are now in the temp folder
as well. Therefore a broken data folder, from a past run, can no longer
influence a test.