Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(unittests) Improve performance of unit tests #52

Merged
merged 2 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ cache:
- apt
- pip

services:
- mongodb

env:
- REQUIREMENTS=lowest
- REQUIREMENTS=release
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@

tests_require = [
'Flask-CLI>=0.4.0',
'Flask-Mongoengine>=0.7.0',
'Flask-Mongoengine>=0.9.5',
'Flask-Peewee>=0.6.5',
'Flask-SQLAlchemy>=2.3',
'bcrypt>=3.1.0',
'check-manifest>=0.25',
'coverage>=4.0',
'isort>=4.2.2',
'mock>=1.3.0',
'mongoengine>=0.10.0',
'mongoengine>=0.12.0',
'mongomock>=3.14.0',
'msgcheck>=2.9',
'pony>=0.7.4',
'pydocstyle>=1.0.0',
'pytest-cache>=1.0',
'pytest-cov>=2.4.0',
'pytest-flakes>=1.0.1',
'pytest-mongo>=1.2.1',
'pytest-pep8>=1.0.6',
'pytest>=3.3.0',
'sqlalchemy>=1.1.0',
Expand Down
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def app(request):
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

app.config['SECURITY_PASSWORD_SALT'] = 'salty'
# Make this plaintext for most tests - reduces unit test time by 50%
app.config['SECURITY_PASSWORD_HASH'] = 'plaintext'

for opt in ['changeable', 'recoverable', 'registerable',
'trackable', 'passwordless', 'confirmable']:
Expand Down Expand Up @@ -154,7 +156,7 @@ def mongoengine_datastore(app):
db_name = 'flask_security_test_%s' % str(time.time()).replace('.', '_')
app.config['MONGODB_SETTINGS'] = {
'db': db_name,
'host': 'localhost',
'host': 'mongomock://localhost',
'port': 27017,
'alias': db_name
}
Expand Down