Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ============================= test session starts ==============================
- platform linux -- Python 3.7.12, pytest-7.1.1, pluggy-1.0.0
- rootdir: /home/ilyatregubov/moodle-mlbackend-python
- plugins: flask-1.2.0
- collected 34 items
- test/test_local.py ...F...F [ 23%]
- test/test_webapp.py .......s.ss.......F.F..F.x [100%]
- =================================== FAILURES ===================================
- ______________________________ test_import_export ______________________________
- def test_import_export():
- with temp_id_and_dir() as (import_id, import_dir):
- p = run('import', import_id, import_dir, TEST_MODEL)
- > assert p.returncode == 0
- E assert 1 == 0
- E + where 1 = CompletedProcess(args=['python3', '-m', 'moodlemlbackend.import', 'temp_id_and_dir-1648102517-a1ja4JFl', '/home/ilyatr..."Expecting value", s, err.value) from None\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n').returncode
- test/test_local.py:146: AssertionError
- ____________________________ test_import_prediction ____________________________
- def test_import_prediction():
- with temp_id_and_dir() as (import_id, import_dir):
- p = run('import', import_id, import_dir, TEST_MODEL)
- > assert p.returncode == 0
- E assert 1 == 0
- E + where 1 = CompletedProcess(args=['python3', '-m', 'moodlemlbackend.import', 'temp_id_and_dir-1648102552-2v-exq1Q', '/home/ilyatr..."Expecting value", s, err.value) from None\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n').returncode
- test/test_local.py:189: AssertionError
- _______________________________ test_evaluation ________________________________
- client = <FlaskClient <Flask 'webapp'>>
- def test_evaluation(client):
- with temporary_model(client) as (uid, auth):
- resp = _evaluation_post(client, uid, headers=auth)
- assert resp.status_code == 200
- results = json.loads(resp.data)
- # We just want to know it learnt *something*
- for indicator, low, high in (#('auc', 0, 1), # AUC is broken
- ('accuracy', 0.7, 1),
- ('precision', 0.7, 1),
- ('recall', 0.7, 1),
- ('f1_score', 0.7, 1),
- ('score', 0.7, 1)):
- score = results[indicator]
- assert score >= low
- assert score <= high
- log_resp = _evaluationlog_get(client.get,
- uniqueid=uid,
- > headers=auth)
- test/test_webapp.py:668:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/test_webapp.py:211: in _evaluationlog_get
- return get(url_for('evaluationlog'), data=data, **kwargs)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1129: in get
- return self.open(*args, **kw)
- ../.local/lib/python3.7/site-packages/flask/testing.py:200: in open
- follow_redirects=follow_redirects
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1074: in open
- response = self.run_wsgi_app(request.environ, buffered=buffered)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:945: in run_wsgi_app
- rv = run_wsgi_app(self.application, environ, buffered=buffered)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1231: in run_wsgi_app
- app_rv = app(environ, start_response)
- ../.local/lib/python3.7/site-packages/flask/app.py:2309: in __call__
- return self.wsgi_app(environ, start_response)
- ../.local/lib/python3.7/site-packages/flask/app.py:2295: in wsgi_app
- response = self.handle_exception(e)
- ../.local/lib/python3.7/site-packages/flask/app.py:1741: in handle_exception
- reraise(exc_type, exc_value, tb)
- ../.local/lib/python3.7/site-packages/flask/_compat.py:35: in reraise
- raise value
- ../.local/lib/python3.7/site-packages/flask/app.py:2292: in wsgi_app
- response = self.full_dispatch_request()
- ../.local/lib/python3.7/site-packages/flask/app.py:1815: in full_dispatch_request
- rv = self.handle_user_exception(e)
- ../.local/lib/python3.7/site-packages/flask/app.py:1718: in handle_user_exception
- reraise(exc_type, exc_value, tb)
- ../.local/lib/python3.7/site-packages/flask/_compat.py:35: in reraise
- raise value
- ../.local/lib/python3.7/site-packages/flask/app.py:1813: in full_dispatch_request
- rv = self.dispatch_request()
- ../.local/lib/python3.7/site-packages/flask/app.py:1799: in dispatch_request
- return self.view_functions[rule.endpoint](**req.view_args)
- moodlemlbackend/webapp/access.py:118: in access_wrapper
- return f(*args, **kwargs)
- moodlemlbackend/webapp/localfs.py:83: in wrapper
- return f(*args, **kwargs)
- webapp.py:111: in evaluationlog
- modeldir = storage.get_model_dir('dirhash')
- moodlemlbackend/webapp/localfs.py:29: in get_model_dir
- uniquemodelid = get_request_value('uniqueid')
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- key = 'uniqueid', pattern = '[^A-Za-z0-9_\\-$]', exception = True
- def get_request_value(key, pattern=False, exception=True):
- if pattern is False:
- pattern = r'[^A-Za-z0-9_\-$]'
- value = request.values.get(key)
- if value is None:
- if exception is True:
- > raise Exception('The requested key ' + key + ' is not available.')
- E Exception: The requested key uniqueid is not available.
- moodlemlbackend/webapp/util.py:20: Exception
- _________________________ test_evaluationlog_no_model __________________________
- client = <FlaskClient <Flask 'webapp'>>
- def test_evaluationlog_no_model(client):
- auth = _auth('kaka')
- resp = _evaluationlog_get(client.get,
- > headers=auth,
- )
- test/test_webapp.py:682:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/test_webapp.py:211: in _evaluationlog_get
- return get(url_for('evaluationlog'), data=data, **kwargs)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1129: in get
- return self.open(*args, **kw)
- ../.local/lib/python3.7/site-packages/flask/testing.py:200: in open
- follow_redirects=follow_redirects
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1074: in open
- response = self.run_wsgi_app(request.environ, buffered=buffered)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:945: in run_wsgi_app
- rv = run_wsgi_app(self.application, environ, buffered=buffered)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1231: in run_wsgi_app
- app_rv = app(environ, start_response)
- ../.local/lib/python3.7/site-packages/flask/app.py:2309: in __call__
- return self.wsgi_app(environ, start_response)
- ../.local/lib/python3.7/site-packages/flask/app.py:2295: in wsgi_app
- response = self.handle_exception(e)
- ../.local/lib/python3.7/site-packages/flask/app.py:1741: in handle_exception
- reraise(exc_type, exc_value, tb)
- ../.local/lib/python3.7/site-packages/flask/_compat.py:35: in reraise
- raise value
- ../.local/lib/python3.7/site-packages/flask/app.py:2292: in wsgi_app
- response = self.full_dispatch_request()
- ../.local/lib/python3.7/site-packages/flask/app.py:1815: in full_dispatch_request
- rv = self.handle_user_exception(e)
- ../.local/lib/python3.7/site-packages/flask/app.py:1718: in handle_user_exception
- reraise(exc_type, exc_value, tb)
- ../.local/lib/python3.7/site-packages/flask/_compat.py:35: in reraise
- raise value
- ../.local/lib/python3.7/site-packages/flask/app.py:1813: in full_dispatch_request
- rv = self.dispatch_request()
- ../.local/lib/python3.7/site-packages/flask/app.py:1799: in dispatch_request
- return self.view_functions[rule.endpoint](**req.view_args)
- moodlemlbackend/webapp/access.py:118: in access_wrapper
- return f(*args, **kwargs)
- moodlemlbackend/webapp/localfs.py:83: in wrapper
- return f(*args, **kwargs)
- webapp.py:111: in evaluationlog
- modeldir = storage.get_model_dir('dirhash')
- moodlemlbackend/webapp/localfs.py:29: in get_model_dir
- uniquemodelid = get_request_value('uniqueid')
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- key = 'uniqueid', pattern = '[^A-Za-z0-9_\\-$]', exception = True
- def get_request_value(key, pattern=False, exception=True):
- if pattern is False:
- pattern = r'[^A-Za-z0-9_\-$]'
- value = request.values.get(key)
- if value is None:
- if exception is True:
- > raise Exception('The requested key ' + key + ' is not available.')
- E Exception: The requested key uniqueid is not available.
- moodlemlbackend/webapp/util.py:20: Exception
- _____________________________ test_export_bad_uid ______________________________
- client = <FlaskClient <Flask 'webapp'>>
- def test_export_bad_uid(client):
- auth = _auth('kaka')
- resp = _export_get(client.get,
- uniqueid=BAD_UID,
- > headers=auth)
- test/test_webapp.py:703:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/test_webapp.py:314: in _export_get
- return get(url_for('export'), data=data, **kwargs)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1129: in get
- return self.open(*args, **kw)
- ../.local/lib/python3.7/site-packages/flask/testing.py:200: in open
- follow_redirects=follow_redirects
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1074: in open
- response = self.run_wsgi_app(request.environ, buffered=buffered)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:945: in run_wsgi_app
- rv = run_wsgi_app(self.application, environ, buffered=buffered)
- ../.local/lib/python3.7/site-packages/werkzeug/test.py:1231: in run_wsgi_app
- app_rv = app(environ, start_response)
- ../.local/lib/python3.7/site-packages/flask/app.py:2309: in __call__
- return self.wsgi_app(environ, start_response)
- ../.local/lib/python3.7/site-packages/flask/app.py:2295: in wsgi_app
- response = self.handle_exception(e)
- ../.local/lib/python3.7/site-packages/flask/app.py:1741: in handle_exception
- reraise(exc_type, exc_value, tb)
- ../.local/lib/python3.7/site-packages/flask/_compat.py:35: in reraise
- raise value
- ../.local/lib/python3.7/site-packages/flask/app.py:2292: in wsgi_app
- response = self.full_dispatch_request()
- ../.local/lib/python3.7/site-packages/flask/app.py:1815: in full_dispatch_request
- rv = self.handle_user_exception(e)
- ../.local/lib/python3.7/site-packages/flask/app.py:1718: in handle_user_exception
- reraise(exc_type, exc_value, tb)
- ../.local/lib/python3.7/site-packages/flask/_compat.py:35: in reraise
- raise value
- ../.local/lib/python3.7/site-packages/flask/app.py:1813: in full_dispatch_request
- rv = self.dispatch_request()
- ../.local/lib/python3.7/site-packages/flask/app.py:1799: in dispatch_request
- return self.view_functions[rule.endpoint](**req.view_args)
- moodlemlbackend/webapp/access.py:118: in access_wrapper
- return f(*args, **kwargs)
- moodlemlbackend/webapp/localfs.py:83: in wrapper
- return f(*args, **kwargs)
- webapp.py:125: in export
- uniquemodelid = get_request_value('uniqueid')
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- key = 'uniqueid', pattern = '[^A-Za-z0-9_\\-$]', exception = True
- def get_request_value(key, pattern=False, exception=True):
- if pattern is False:
- pattern = r'[^A-Za-z0-9_\-$]'
- value = request.values.get(key)
- if value is None:
- if exception is True:
- > raise Exception('The requested key ' + key + ' is not available.')
- E Exception: The requested key uniqueid is not available.
- moodlemlbackend/webapp/util.py:20: Exception
- =============================== warnings summary ===============================
- test/test_local.py:168
- /home/ilyatregubov/moodle-mlbackend-python/test/test_local.py:168: DeprecationWarning: invalid escape sequence \d
- assert re.match('^\d+$', result['runid'])
- ../.local/lib/python3.7/site-packages/tensorflow/python/autograph/impl/api.py:22
- /home/ilyatregubov/.local/lib/python3.7/site-packages/tensorflow/python/autograph/impl/api.py:22: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
- import imp
- ../.local/lib/python3.7/site-packages/botocore/vendored/requests/packages/urllib3/_collections.py:1
- /home/ilyatregubov/.local/lib/python3.7/site-packages/botocore/vendored/requests/packages/urllib3/_collections.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
- from collections import Mapping, MutableMapping
- ../.local/lib/python3.7/site-packages/matplotlib/backend_bases.py:55
- ../.local/lib/python3.7/site-packages/matplotlib/backend_bases.py:55
- /home/ilyatregubov/.local/lib/python3.7/site-packages/matplotlib/backend_bases.py:55: DeprecationWarning: PILLOW_VERSION is deprecated and will be removed in Pillow 9 (2022-01-02). Use __version__ instead.
- from PIL import PILLOW_VERSION
- -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- =========================== short test summary info ============================
- FAILED test/test_local.py::test_import_export - assert 1 == 0
- FAILED test/test_local.py::test_import_prediction - assert 1 == 0
- FAILED test/test_webapp.py::test_evaluation - Exception: The requested key un...
- FAILED test/test_webapp.py::test_evaluationlog_no_model - Exception: The requ...
- FAILED test/test_webapp.py::test_export_bad_uid - Exception: The requested ke...
- == 5 failed, 25 passed, 3 skipped, 1 xfailed, 5 warnings in 162.52s (0:02:42) ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement