2018-05-01 11:52:38 +02:00
|
|
|
import os
|
2018-04-09 22:09:58 +02:00
|
|
|
|
2022-03-13 08:36:49 +01:00
|
|
|
import pytest
|
|
|
|
from werkzeug.test import TestResponse
|
|
|
|
|
2020-07-14 22:03:56 +02:00
|
|
|
os.environ['FLASK_ENV'] = 'testing'
|
2020-09-16 15:41:02 +02:00
|
|
|
os.environ['APP_SETTINGS'] = 'fittrackee.config.TestingConfig'
|
2020-05-02 10:39:43 +02:00
|
|
|
# to avoid resetting dev database during tests
|
2021-01-02 19:28:03 +01:00
|
|
|
os.environ['DATABASE_URL'] = os.environ['DATABASE_TEST_URL']
|
2022-05-29 09:27:41 +02:00
|
|
|
TEMP_FOLDER = '/tmp/FitTrackee'
|
2022-11-19 20:17:58 +01:00
|
|
|
os.makedirs(TEMP_FOLDER, exist_ok=True)
|
2022-05-29 09:27:41 +02:00
|
|
|
os.environ['UPLOAD_FOLDER'] = TEMP_FOLDER
|
|
|
|
os.environ['APP_LOG'] = TEMP_FOLDER + '/fittrackee.log'
|
2022-05-27 13:28:26 +02:00
|
|
|
os.environ['AUTHLIB_INSECURE_TRANSPORT'] = '1'
|
2018-05-01 11:52:38 +02:00
|
|
|
|
2021-01-30 11:20:15 +01:00
|
|
|
pytest_plugins = [
|
|
|
|
'fittrackee.tests.fixtures.fixtures_app',
|
2022-03-13 08:56:23 +01:00
|
|
|
'fittrackee.tests.fixtures.fixtures_emails',
|
2021-01-30 11:20:15 +01:00
|
|
|
'fittrackee.tests.fixtures.fixtures_workouts',
|
|
|
|
'fittrackee.tests.fixtures.fixtures_users',
|
|
|
|
]
|
2022-03-13 08:36:49 +01:00
|
|
|
|
|
|
|
pytest.register_assert_rewrite('fittrackee.tests.custom_asserts')
|
|
|
|
|
|
|
|
# Prevent pytest from collecting TestResponse as test
|
|
|
|
TestResponse.__test__ = False # type: ignore
|