catch 500 errors and remove unnecessary acceptance test fixture

This commit is contained in:
dandds 2018-10-15 10:03:13 -04:00
parent ef041d7e1c
commit f16b227ece
2 changed files with 5 additions and 10 deletions

View File

@ -17,4 +17,9 @@ def make_error_pages(app):
app.logger.error(e.message) app.logger.error(e.message)
return render_template("error.html", message="Log in Failed"), 401 return render_template("error.html", message="Log in Failed"), 401
@app.errorhandler(Exception)
def exception(e):
app.logger.error(e.message)
return render_template("error.html", message="An Unexpected Error Occurred"), 500
return app return app

View File

@ -1,7 +1,6 @@
import os import os
import pytest import pytest
import logging import logging
from logging.handlers import RotatingFileHandler
from collections import Mapping from collections import Mapping
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.keys import Keys
@ -18,15 +17,6 @@ def session(db, request):
pass pass
@pytest.fixture(scope="session")
def app(app):
handler = RotatingFileHandler("log/acceptance.log", maxBytes=10000, backupCount=1)
handler.setLevel(logging.INFO)
app.logger.addHandler(handler)
return app
class DriverCollection(Mapping): class DriverCollection(Mapping):
""" """
Allows access to drivers with dictionary syntax. Keeps track of which ones Allows access to drivers with dictionary syntax. Keeps track of which ones