Skip to content

Commit

Permalink
Cleaned tests fixtures. Updated CHANGELOG.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Dec 12, 2019
1 parent 769b7b8 commit fbcfe94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
MOSP Changelog
==============

## 0.9 (not yet released)

- improvements to the structure of the backend and the models;
- introduction of tests with pytest;
- added GitHub test workflow (GitHub Actions).


## 0.8 (2019-11-28)

- Add a warning when the UUID of new a object is already taken (#14);
Expand Down
4 changes: 3 additions & 1 deletion mosp/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ def set_logging(log_path=None, log_level=logging.INFO, modules=(),
# Create Flask application
application = Flask(__name__, instance_relative_config=True)

# Load the appropriate configuration
# Loads the appropriate configuration
ON_HEROKU = int(os.environ.get('HEROKU', 0)) == 1
TESTING = os.environ.get('testing', '') == 'actions'
if TESTING:
# Testing on GitHub Actions
application.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://mosp:password@localhost:5432/mosp'
elif ON_HEROKU:
# Deployment on Heroku
application.config.from_pyfile('heroku.py', silent=False)
else:
try:
Expand Down
7 changes: 1 addition & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@

import pytest
from flask import Flask
from werkzeug.security import generate_password_hash

from mosp.bootstrap import db as _db
from mosp.bootstrap import application


@pytest.fixture(scope='session')
def app(request):
"""Session-wide test `Flask` application."""
settings_override = {
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://mosp:password@localhost:5432/mosp'
}
app = application

# Establish an application context before running the tests.
Expand Down

0 comments on commit fbcfe94

Please sign in to comment.