test_py
Failed Started
by
@RABijl
RABijl
1Running with gitlab-runner 11.6.0 (f100a208)2 on universal-tn4 d3cf99853Using Docker executor with image zesje/base ...4Pulling docker image zesje/base ...5Using docker image sha256:7bfae5ead574ab7a73f802dfb0b47fdbc5632492b8de9d4e5bdd6983e6d8f6cc for zesje/base ...8Removing .coverage9Removing .pytest_cache/10Removing cov.html/11Removing cov.xml12Removing data/scans/13Removing tests/__pycache__/14Removing tests/data/submissions/15Removing zesje/__pycache__/16Removing zesje/api/__pycache__/17Removing zesje/static/18HEAD is now at 728157b Merge branch 'QRCodes-odd-pages' into 'develop'20 00b03ed..94c3229 approve_shortcut -> origin/approve_shortcut21 582761a..d5e6712 feature/pre-grading -> origin/feature/pre-grading22 d2188e7..3f5198d fix/corner-tests -> origin/fix/corner-tests23Checking out d5e67127 as feature/pre-grading...24Skipping Git submodules setup26Downloading artifacts from coordinator... ok id=61522 responseStatus=200 OK token=Kszu6uvC28Collecting git+https://github.com/mstamy2/PyPDF2 (from -r requirements.txt (line 29))29 Cloning https://github.com/mstamy2/PyPDF2 to /tmp/pip-req-build-jspososv30Requirement already satisfied (use --upgrade to upgrade): PyPDF2==1.26.0 from git+https://github.com/mstamy2/PyPDF2 in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 29))31Requirement already satisfied: flask in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (1.0.2)32Requirement already satisfied: flask_restful in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (0.3.6)33Collecting flask_sqlalchemy (from -r requirements.txt (line 4))34 Downloading https://files.pythonhosted.org/packages/08/ca/582442cad71504a1514a2f053006c8bb128844133d6076a4df17117545fa/Flask_SQLAlchemy-2.4.0-py2.py3-none-any.whl35Collecting sqlalchemy (from -r requirements.txt (line 5))36 Downloading https://files.pythonhosted.org/packages/2b/b2/e6f5c5efc68942edefaa924e8fbea0b32375baa434a511cbf6bb17769cf6/SQLAlchemy-1.3.3.tar.gz (5.9MB)37Collecting Flask-Migrate (from -r requirements.txt (line 6))38 Downloading https://files.pythonhosted.org/packages/4b/22/d20a105f13c58fe590ef38ac59d5cabc1a917549ea8f90b0ca7b4e84f6be/Flask_Migrate-2.5.2-py2.py3-none-any.whl39Collecting alembic (from -r requirements.txt (line 7))40 Downloading https://files.pythonhosted.org/packages/6e/8b/fa3bd058cccd5e9177fea4efa26bfb769228fdd3178436ad5e05830ef6ef/alembic-1.0.10.tar.gz (1.0MB)41Requirement already satisfied: pyyaml in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 8)) (3.12)42Collecting celery (from -r requirements.txt (line 9))43 Downloading https://files.pythonhosted.org/packages/5c/a1/a3dd9d8bfa09156ec2cba37f90accf35c0f4ecc3980d96cb4fb99e56504b/celery-4.3.0-py2.py3-none-any.whl (413kB)44Collecting redis (from -r requirements.txt (line 10))45 Downloading https://files.pythonhosted.org/packages/ac/a7/cff10cc5f1180834a3ed564d148fb4329c989cbb1f2e196fc9a10fa07072/redis-3.2.1-py2.py3-none-any.whl (65kB)46Requirement already satisfied: numpy in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 13)) (1.14.5)47Requirement already satisfied: scipy in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 14)) (1.1.0)48Requirement already satisfied: matplotlib in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 17)) (2.2.2)49Requirement already satisfied: seaborn in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 18)) (0.8.1)50Requirement already satisfied: pdfrw in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 21)) (0.4)51Requirement already satisfied: reportlab in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 22)) (3.4.0)52Requirement already satisfied: Wand in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 23)) (0.4.4)53Requirement already satisfied: Pillow in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 24)) (5.2.0)54Requirement already satisfied: pyStrich in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 25)) (0.8)55Requirement already satisfied: opencv-python in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 28)) (3.4.1.15)56Requirement already satisfied: pylibdmtx in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 30)) (0.1.7)57Requirement already satisfied: pandas in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 33)) (0.23.1)58Requirement already satisfied: openpyxl in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 34)) (2.5.4)59Requirement already satisfied: pytest in /usr/lib/python3.6/site-packages (from -r requirements-dev.txt (line 2)) (3.6.3)60Requirement already satisfied: pyssim in /usr/lib/python3.6/site-packages (from -r requirements-dev.txt (line 3)) (0.4)61Collecting pytest-cov (from -r requirements-dev.txt (line 4))62 Downloading https://files.pythonhosted.org/packages/84/7b/73f8522619d1cbb22b9a36f9c54bc5ce5e24648e53cc1bf566477d2d1f2b/pytest_cov-2.7.1-py2.py3-none-any.whl63Requirement already satisfied: flake8 in /usr/lib/python3.6/site-packages (from -r requirements-dev.txt (line 7)) (3.5.0)64Requirement already satisfied: itsdangerous>=0.24 in /usr/lib/python3.6/site-packages (from flask->-r requirements.txt (line 2)) (0.24)65Requirement already satisfied: Werkzeug>=0.14 in /usr/lib/python3.6/site-packages (from flask->-r requirements.txt (line 2)) (0.14.1)66Requirement already satisfied: Jinja2>=2.10 in /usr/lib/python3.6/site-packages (from flask->-r requirements.txt (line 2)) (2.10)67Requirement already satisfied: click>=5.1 in /usr/lib/python3.6/site-packages (from flask->-r requirements.txt (line 2)) (6.7)68Requirement already satisfied: pytz in /usr/lib/python3.6/site-packages (from flask_restful->-r requirements.txt (line 3)) (2018.5)69Requirement already satisfied: aniso8601>=0.82 in /usr/lib/python3.6/site-packages (from flask_restful->-r requirements.txt (line 3)) (3.0.2)70Requirement already satisfied: six>=1.3.0 in /usr/lib/python3.6/site-packages (from flask_restful->-r requirements.txt (line 3)) (1.11.0)71Collecting Mako (from alembic->-r requirements.txt (line 7))72 Downloading https://files.pythonhosted.org/packages/f9/93/63f78c552e4397549499169198698de23b559b52e57f27d967690811d16d/Mako-1.0.10.tar.gz (460kB)73Collecting python-editor>=0.3 (from alembic->-r requirements.txt (line 7))74 Downloading https://files.pythonhosted.org/packages/c6/d3/201fc3abe391bbae6606e6f1d598c15d367033332bd54352b12f35513717/python_editor-1.0.4-py3-none-any.whl75Requirement already satisfied: python-dateutil in /usr/lib/python3.6/site-packages (from alembic->-r requirements.txt (line 7)) (2.7.3)76Collecting billiard<4.0,>=3.6.0 (from celery->-r requirements.txt (line 9))77 Downloading https://files.pythonhosted.org/packages/3c/a0/5a01bed569cf1af8fcdd4294590acb980a2788d1594f4ccd678b6fea8644/billiard-3.6.0.0.tar.gz (151kB)78Collecting kombu<5.0,>=4.4.0 (from celery->-r requirements.txt (line 9))79 Downloading https://files.pythonhosted.org/packages/b7/af/1914e93314f1b98756d5c5e366193124a0ffaab0e6d0e51e0f6f65fa851d/kombu-4.5.0-py2.py3-none-any.whl (185kB)80Collecting vine>=1.3.0 (from celery->-r requirements.txt (line 9))81 Downloading https://files.pythonhosted.org/packages/7f/60/82c03047396126c8331ceb64da1dc52d4f1317209f32e8fe286d0c07365a/vine-1.3.0-py2.py3-none-any.whl82Requirement already satisfied: cycler>=0.10 in /usr/lib/python3.6/site-packages (from matplotlib->-r requirements.txt (line 17)) (0.10.0)83Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python3.6/site-packages (from matplotlib->-r requirements.txt (line 17)) (2.2.0)84Requirement already satisfied: kiwisolver>=1.0.1 in /usr/lib/python3.6/site-packages (from matplotlib->-r requirements.txt (line 17)) (1.0.1)85Requirement already satisfied: setuptools>=2.2 in /usr/lib/python3.6/site-packages (from reportlab->-r requirements.txt (line 22)) (39.2.0)86Requirement already satisfied: pip>=1.4.1 in /usr/lib/python3.6/site-packages (from reportlab->-r requirements.txt (line 22)) (10.0.1)87Requirement already satisfied: jdcal in /usr/lib/python3.6/site-packages (from openpyxl->-r requirements.txt (line 34)) (1.4)88Requirement already satisfied: et_xmlfile in /usr/lib/python3.6/site-packages (from openpyxl->-r requirements.txt (line 34)) (1.0.1)89Requirement already satisfied: attrs>=17.4.0 in /usr/lib/python3.6/site-packages (from pytest->-r requirements-dev.txt (line 2)) (18.1.0)90Requirement already satisfied: atomicwrites>=1.0 in /usr/lib/python3.6/site-packages (from pytest->-r requirements-dev.txt (line 2)) (1.1.5)91Requirement already satisfied: more-itertools>=4.0.0 in /usr/lib/python3.6/site-packages (from pytest->-r requirements-dev.txt (line 2)) (4.2.0)92Requirement already satisfied: pluggy<0.7,>=0.5 in /usr/lib/python3.6/site-packages (from pytest->-r requirements-dev.txt (line 2)) (0.6.0)93Requirement already satisfied: py>=1.5.0 in /usr/lib/python3.6/site-packages (from pytest->-r requirements-dev.txt (line 2)) (1.5.4)94Collecting coverage>=4.4 (from pytest-cov->-r requirements-dev.txt (line 4))95 Downloading https://files.pythonhosted.org/packages/f8/4e/f28fc04019bac97d301512d904992791569234a06826cd420f78fba9a361/coverage-4.5.3-cp36-cp36m-manylinux1_x86_64.whl (205kB)96Requirement already satisfied: pyflakes<1.7.0,>=1.5.0 in /usr/lib/python3.6/site-packages (from flake8->-r requirements-dev.txt (line 7)) (1.6.0)97Requirement already satisfied: pycodestyle<2.4.0,>=2.0.0 in /usr/lib/python3.6/site-packages (from flake8->-r requirements-dev.txt (line 7)) (2.3.1)98Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in /usr/lib/python3.6/site-packages (from flake8->-r requirements-dev.txt (line 7)) (0.6.1)99Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python3.6/site-packages (from Jinja2>=2.10->flask->-r requirements.txt (line 2)) (1.0)100Collecting amqp<3.0,>=2.4.0 (from kombu<5.0,>=4.4.0->celery->-r requirements.txt (line 9))101 Downloading https://files.pythonhosted.org/packages/42/ec/cbbaa8f75be8cbd019afb9d63258e2bdc95242f8c46a54bb90db5fef03bd/amqp-2.4.2-py2.py3-none-any.whl (49kB)102Installing collected packages: sqlalchemy, flask-sqlalchemy, Mako, python-editor, alembic, Flask-Migrate, billiard, vine, amqp, kombu, celery, redis, coverage, pytest-cov103 Running setup.py install for sqlalchemy: started104 Running setup.py install for sqlalchemy: finished with status 'done'105 Running setup.py install for Mako: started106 Running setup.py install for Mako: finished with status 'done'107 Running setup.py install for alembic: started108 Running setup.py install for alembic: finished with status 'done'109 Running setup.py install for billiard: started110 Running setup.py install for billiard: finished with status 'done'111Successfully installed Flask-Migrate-2.5.2 Mako-1.0.10 alembic-1.0.10 amqp-2.4.2 billiard-3.6.0.0 celery-4.3.0 coverage-4.5.3 flask-sqlalchemy-2.4.0 kombu-4.5.0 pytest-cov-2.7.1 python-editor-1.0.4 redis-3.2.1 sqlalchemy-1.3.3 vine-1.3.0112You are using pip version 10.0.1, however version 19.1.1 is available.113You should consider upgrading via the 'pip install --upgrade pip' command.114$ yarn test:py:cov115yarn run v1.6.0116$ python3 -m pytest -v -W error::RuntimeWarning --cov=zesje --cov-report=xml:cov.xml --cov-report=html:cov.html --cov-report=term tests/117============================= test session starts ==============================118platform linux -- Python 3.6.5, pytest-3.6.3, py-1.5.4, pluggy-0.6.0 -- /usr/sbin/python3119cachedir: .pytest_cache120rootdir: /builds/works-on-my-machine/zesje, inifile: pytest.ini121plugins: cov-2.7.1, celery-4.3.0122collecting ... collected 71 items123tests/test_check_keypoints.py::test_runtime_error_check_corner_marker[Not enough corner markers] PASSED [ 1%]124tests/test_check_keypoints.py::test_runtime_error_check_corner_marker[Too many corner] PASSED [ 2%]125tests/test_check_keypoints.py::test_runtime_error_check_corner_marker[Two markers detected in same corner] PASSED [ 4%]126tests/test_check_keypoints.py::test_runtime_error_check_corner_marker[Enough markers, evenly spread] PASSED [ 5%]127tests/test_database.py::test_exam_generate_token_length_uppercase[No existing token] PASSED [ 7%]128tests/test_database.py::test_exam_generate_token_length_uppercase[Existing token] PASSED [ 8%]129tests/test_get_student_number.py::test_get_studentnumber_precision PASSED [ 9%]130tests/test_pdf_generation.py::test_add_corner_markers_and_bottom_bar[a4] PASSED [ 11%]131tests/test_pdf_generation.py::test_add_corner_markers_and_bottom_bar[square] PASSED [ 12%]132tests/test_pdf_generation.py::test_generate_id_grid PASSED [ 14%]133tests/test_pdf_generation.py::test_generate_pdfs_num_files PASSED [ 15%]134tests/test_pdf_generation.py::test_generate_checkboxes[checkboxes0] PASSED [ 16%]135tests/test_pdf_generation.py::test_generate_checkboxes[checkboxes1] PASSED [ 18%]136tests/test_pdf_generation.py::test_generate_checkboxes[checkboxes2] PASSED [ 19%]137tests/test_pdf_generation.py::test_join_pdfs[a4] PASSED [ 21%]138tests/test_pdf_generation.py::test_join_pdfs[square] PASSED [ 22%]139tests/test_pdf_generation.py::test_generate_datamatrix PASSED [ 23%]140tests/test_pregrader.py::test_ideal_crops[box_coords0-True] PASSED [ 25%]141tests/test_pregrader.py::test_ideal_crops[box_coords1-False] PASSED [ 26%]142tests/test_pregrader.py::test_ideal_crops[box_coords2-True] PASSED [ 28%]143tests/test_pregrader.py::test_ideal_crops[box_coords3-True] PASSED [ 29%]144tests/test_pregrader.py::test_ideal_crops[box_coords4-True] PASSED [ 30%]145tests/test_pregrader.py::test_ideal_crops[box_coords5-True] PASSED [ 32%]146tests/test_pregrader.py::test_shifted_crops[1 filled bottom right] PASSED [ 33%]147tests/test_pregrader.py::test_shifted_crops[1 filled top left] PASSED [ 35%]148tests/test_pregrader.py::test_shifted_crops[5 filled with a bit of 6] PASSED [ 36%]149tests/test_pregrader.py::test_shifted_crops[4 fully filled with the label] PASSED [ 38%]150tests/test_pregrader.py::test_shifted_crops[6 empty with label] PASSED [ 39%]151tests/test_pregrader.py::test_shifted_crops[7 partially cropped, filled and a part of 6] PASSED [ 40%]152tests/test_rotation_scan.py::test_calc_angle[Same horizontal line] PASSED [ 42%]153tests/test_rotation_scan.py::test_calc_angle[Same vertical line] PASSED [ 43%]154tests/test_rotation_scan.py::test_calc_angle[Negative angle] PASSED [ 45%]155tests/test_rotation_scan.py::test_calc_angle[Positive angle] PASSED [ 46%]156tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex1.jpg] PASSED [ 47%]157tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex3.jpg] PASSED [ 49%]158tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex5.jpg] PASSED [ 50%]159tests/test_rotation_scan.py::test_detect_enough_cornermarkers[jamy2.jpg] PASSED [ 52%]160tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex6.jpg] PASSED [ 53%]161tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex4.jpg] PASSED [ 54%]162tests/test_rotation_scan.py::test_detect_enough_cornermarkers[jamy1.jpg] PASSED [ 56%]163tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex2.jpg] PASSED [ 57%]164tests/test_rotation_scan.py::test_detect_valid_cornermarkers[latex1.jpg] PASSED [ 59%]165tests/test_rotation_scan.py::test_detect_valid_cornermarkers[latex3.jpg] PASSED [ 60%]166tests/test_rotation_scan.py::test_detect_valid_cornermarkers[latex5.jpg] PASSED [ 61%]167tests/test_rotation_scan.py::test_detect_valid_cornermarkers[jamy2.jpg] PASSED [ 63%]168tests/test_rotation_scan.py::test_detect_valid_cornermarkers[latex6.jpg] PASSED [ 64%]169tests/test_rotation_scan.py::test_detect_valid_cornermarkers[latex4.jpg] PASSED [ 66%]170tests/test_rotation_scan.py::test_detect_valid_cornermarkers[jamy1.jpg] PASSED [ 67%]171tests/test_rotation_scan.py::test_detect_valid_cornermarkers[latex2.jpg] PASSED [ 69%]172tests/test_scans.py::test_decode_barcode[Simple test 1] PASSED [ 70%]173tests/test_scans.py::test_decode_barcode[Simple test 2] PASSED [ 71%]174tests/test_scans.py::test_decode_barcode[High numbers] PASSED [ 73%]175tests/test_scans.py::test_pipeline FAILED [ 74%]176tests/test_scans.py::test_noise[Low noise] FAILED [ 76%]177tests/test_scans.py::test_noise[Medium noise] FAILED [ 77%]178tests/test_scans.py::test_noise[High noise] PASSED [ 78%]179tests/test_scans.py::test_rotate[Large rot] PASSED [ 80%]180tests/test_scans.py::test_rotate[Small rot] FAILED [ 81%]181tests/test_scans.py::test_rotate[Medium rot] PASSED [ 83%]182tests/test_scans.py::test_rotate[failing rot] PASSED [ 84%]183tests/test_scans.py::test_scale[smaller scale] FAILED [ 85%]184tests/test_scans.py::test_scale[larger scale] PASSED [ 87%]185tests/test_scans.py::test_skew[small skew] FAILED [ 88%]186tests/test_scans.py::test_skew[larger skew] FAILED [ 90%]187tests/test_scans.py::test_all_effects[1st full test] FAILED [ 91%]188tests/test_scans.py::test_all_effects[second full test] FAILED [ 92%]189tests/test_scans.py::test_image_extraction[blank pdf] PASSED [ 94%]190tests/test_scans.py::test_image_extraction[flattened pdf] PASSED [ 95%]191tests/test_three_corners.py::test_three_straight_corners_1 PASSED [ 97%]192tests/test_three_corners.py::test_three_straight_corners_2 PASSED [ 98%]193tests/test_three_corners.py::test_pdf PASSED [100%]194=================================== FAILURES ===================================195________________________________ test_pipeline _________________________________196new_exam = ExamMetadata(token='IHQYZAFOWVQX', barcode_coords=[40, 90, 510, 560])197datadir = '/builds/works-on-my-machine/zesje/tests/data'198 def test_pipeline(new_exam, datadir):199 genPDF = generate_pdf(new_exam, 5)200 for image in makeImage(genPDF):201> success, reason = scans.process_page(image, new_exam, datadir)202tests/test_scans.py:196: 203_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 204zesje/scans.py:344: in process_page205 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)206_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 207sub = <Submission 1>, exam = <Exam 1>, page = 0208page_img = array([[[255, 255, 255],209 [255, 255, 255],210 [255, 255, 255],211 ...,212 [255, 255, 255],213 ...[255, 255, 255],214 ...,215 [255, 255, 255],216 [255, 255, 255],217 [255, 255, 255]]], dtype=uint8)218corner_keypoints = [(28, 28), (562, 28), (28, 812), (563, 812)]219 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):220 """221 Adds the multiple choice options that are identified as marked as a feedback option to a solution223 Parameters224 ------225 sub : Submission226 the current submission227 exam : Exam228 the current exam229 page_img : Image230 image of the page231 corner_keypoints : array232 locations of the corner keypoints as (x, y) tuples233 """234 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]236> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)237E ValueError: too many values to unpack (expected 2)238zesje/pregrader.py:25: ValueError239____________________________ test_noise[Low noise] _____________________________240new_exam = ExamMetadata(token='NHABIKFPQOWG', barcode_coords=[40, 90, 510, 560])241datadir = '/builds/works-on-my-machine/zesje/tests/data', threshold = 0.02242expected = True243 @pytest.mark.parametrize('threshold, expected', [244 (0.02, True),245 (0.12, True),246 (0.92, False)],247 ids=['Low noise', 'Medium noise', 'High noise'])248 def test_noise(new_exam, datadir, threshold, expected):249 genPDF = generate_pdf(new_exam, 1)250 for image in makeImage(genPDF):251 image = apply_whitenoise(image, threshold)252> success, reason = scans.process_page(image, new_exam, datadir)253tests/test_scans.py:209: 254_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 255zesje/scans.py:344: in process_page256 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)257_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 258sub = <Submission 1>, exam = <Exam 1>, page = 0259page_img = array([[[253, 254, 253],260 [251, 253, 251],261 [250, 254, 253],262 ...,263 [250, 251, 250],264 ...[250, 252, 254],265 ...,266 [254, 252, 250],267 [250, 252, 250],268 [254, 252, 251]]], dtype=uint8)269corner_keypoints = [(28, 28), (562, 28), (28, 812), (563, 812)]270 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):271 """272 Adds the multiple choice options that are identified as marked as a feedback option to a solution274 Parameters275 ------276 sub : Submission277 the current submission278 exam : Exam279 the current exam280 page_img : Image281 image of the page282 corner_keypoints : array283 locations of the corner keypoints as (x, y) tuples284 """285 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]287> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)288E ValueError: too many values to unpack (expected 2)289zesje/pregrader.py:25: ValueError290----------------------------- Captured stdout call -----------------------------291[[[255 255 255]292 [255 255 255]293 [255 255 255]294 ...295 [255 255 255]296 [255 255 255]297 [255 255 255]]298 [[255 255 255]299 [255 255 255]300 [255 255 255]301 ...302 [255 255 255]303 [255 255 255]304 [255 255 255]]305 [[255 255 255]306 [255 255 255]307 [255 255 255]308 ...309 [255 255 255]310 [255 255 255]311 [255 255 255]]312 ...313 [[255 255 255]314 [255 255 255]315 [255 255 255]316 ...317 [255 255 255]318 [255 255 255]319 [255 255 255]]320 [[255 255 255]321 [255 255 255]322 [255 255 255]323 ...324 [255 255 255]325 [255 255 255]326 [255 255 255]]327 [[255 255 255]328 [255 255 255]329 [255 255 255]330 ...331 [255 255 255]332 [255 255 255]333 [255 255 255]]]334(842, 592, 3)335___________________________ test_noise[Medium noise] ___________________________336new_exam = ExamMetadata(token='IVVQQOLVCDFM', barcode_coords=[40, 90, 510, 560])337datadir = '/builds/works-on-my-machine/zesje/tests/data', threshold = 0.12338expected = True339 @pytest.mark.parametrize('threshold, expected', [340 (0.02, True),341 (0.12, True),342 (0.92, False)],343 ids=['Low noise', 'Medium noise', 'High noise'])344 def test_noise(new_exam, datadir, threshold, expected):345 genPDF = generate_pdf(new_exam, 1)346 for image in makeImage(genPDF):347 image = apply_whitenoise(image, threshold)348> success, reason = scans.process_page(image, new_exam, datadir)349tests/test_scans.py:209: 350_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 351zesje/scans.py:344: in process_page352 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)353_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 354sub = <Submission 1>, exam = <Exam 1>, page = 0355page_img = array([[[232, 224, 225],356 [226, 250, 249],357 [234, 230, 241],358 ...,359 [250, 226, 251],360 ...[228, 233, 235],361 ...,362 [235, 226, 247],363 [226, 249, 239],364 [226, 234, 242]]], dtype=uint8)365corner_keypoints = [(28, 28), (562, 28), (28, 812), (563, 812)]366 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):367 """368 Adds the multiple choice options that are identified as marked as a feedback option to a solution370 Parameters371 ------372 sub : Submission373 the current submission374 exam : Exam375 the current exam376 page_img : Image377 image of the page378 corner_keypoints : array379 locations of the corner keypoints as (x, y) tuples380 """381 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]383> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)384E ValueError: too many values to unpack (expected 2)385zesje/pregrader.py:25: ValueError386----------------------------- Captured stdout call -----------------------------387[[[255 255 255]388 [255 255 255]389 [255 255 255]390 ...391 [255 255 255]392 [255 255 255]393 [255 255 255]]394 [[255 255 255]395 [255 255 255]396 [255 255 255]397 ...398 [255 255 255]399 [255 255 255]400 [255 255 255]]401 [[255 255 255]402 [255 255 255]403 [255 255 255]404 ...405 [255 255 255]406 [255 255 255]407 [255 255 255]]408 ...409 [[255 255 255]410 [255 255 255]411 [255 255 255]412 ...413 [255 255 255]414 [255 255 255]415 [255 255 255]]416 [[255 255 255]417 [255 255 255]418 [255 255 255]419 ...420 [255 255 255]421 [255 255 255]422 [255 255 255]]423 [[255 255 255]424 [255 255 255]425 [255 255 255]426 ...427 [255 255 255]428 [255 255 255]429 [255 255 255]]]430(842, 592, 3)431____________________________ test_rotate[Small rot] ____________________________432new_exam = ExamMetadata(token='LTFGFRKXEDBL', barcode_coords=[40, 90, 510, 560])433datadir = '/builds/works-on-my-machine/zesje/tests/data', rotation = 0.5434expected = True435 @pytest.mark.parametrize('rotation, expected', [436 (-2, True),437 (0.5, True),438 (0.8, True),439 (2, False)],440 ids=['Large rot', 'Small rot', 'Medium rot', 'failing rot'])441 def test_rotate(new_exam, datadir, rotation, expected):442 genPDF = generate_pdf(new_exam, 1)443 for image in makeImage(genPDF):444 image = apply_scan(img=image, rotation=rotation)445 # image.show()446> success, reason = scans.process_page(image, new_exam, datadir)447tests/test_scans.py:224: 448_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 449zesje/scans.py:344: in process_page450 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)451_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 452sub = <Submission 1>, exam = <Exam 1>, page = 0453page_img = array([[[255, 255, 255],454 [255, 255, 255],455 [255, 255, 255],456 ...,457 [255, 255, 255],458 ...[255, 255, 255],459 ...,460 [255, 255, 255],461 [255, 255, 255],462 [255, 255, 255]]], dtype=uint8)463corner_keypoints = [(25, 30), (560, 26), (31, 815), (566, 811)]464 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):465 """466 Adds the multiple choice options that are identified as marked as a feedback option to a solution468 Parameters469 ------470 sub : Submission471 the current submission472 exam : Exam473 the current exam474 page_img : Image475 image of the page476 corner_keypoints : array477 locations of the corner keypoints as (x, y) tuples478 """479 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]481> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)482E ValueError: too many values to unpack (expected 2)483zesje/pregrader.py:25: ValueError484__________________________ test_scale[smaller scale] ___________________________485new_exam = ExamMetadata(token='IEVFCGFWMJUX', barcode_coords=[40, 90, 510, 560])486datadir = '/builds/works-on-my-machine/zesje/tests/data', scale = 0.99487expected = True488 @pytest.mark.parametrize('scale, expected', [489 (0.99, True),490 (1.1, False)],491 ids=['smaller scale', 'larger scale'])492 def test_scale(new_exam, datadir, scale, expected):493 genPDF = generate_pdf(new_exam, 1)494 for image in makeImage(genPDF):495 image = apply_scan(img=image, scale=scale)496 # image.show()497> success, reason = scans.process_page(image, new_exam, datadir)498tests/test_scans.py:237: 499_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 500zesje/scans.py:344: in process_page501 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)502_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 503sub = <Submission 1>, exam = <Exam 1>, page = 0504page_img = array([[[255, 255, 255],505 [255, 255, 255],506 [255, 255, 255],507 ...,508 [255, 255, 255],509 ...[255, 255, 255],510 ...,511 [255, 255, 255],512 [255, 255, 255],513 [255, 255, 255]]], dtype=uint8)514corner_keypoints = [(27, 27), (557, 28), (28, 804), (557, 803)]515 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):516 """517 Adds the multiple choice options that are identified as marked as a feedback option to a solution519 Parameters520 ------521 sub : Submission522 the current submission523 exam : Exam524 the current exam525 page_img : Image526 image of the page527 corner_keypoints : array528 locations of the corner keypoints as (x, y) tuples529 """530 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]532> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)533E ValueError: too many values to unpack (expected 2)534zesje/pregrader.py:25: ValueError535____________________________ test_skew[small skew] _____________________________536new_exam = ExamMetadata(token='ZENVMREXGCZX', barcode_coords=[40, 90, 510, 560])537datadir = '/builds/works-on-my-machine/zesje/tests/data', skew = (10, 10)538expected = True539 @pytest.mark.parametrize('skew, expected', [540 ((10, 10), True),541 ((-10, -5), True)],542 ids=['small skew', 'larger skew'])543 def test_skew(new_exam, datadir, skew, expected):544 genPDF = generate_pdf(new_exam, 1)545 for image in makeImage(genPDF):546 image = apply_scan(img=image, skew=skew)547 # image.show()548> success, reason = scans.process_page(image, new_exam, datadir)549tests/test_scans.py:250: 550_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 551zesje/scans.py:344: in process_page552 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)553_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 554sub = <Submission 1>, exam = <Exam 1>, page = 0555page_img = array([[[255, 255, 255],556 [255, 255, 255],557 [255, 255, 255],558 ...,559 [255, 255, 255],560 ...[255, 255, 255],561 ...,562 [255, 255, 255],563 [255, 255, 255],564 [255, 255, 255]]], dtype=uint8)565corner_keypoints = [(38, 38), (573, 38), (38, 823), (572, 823)]566 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):567 """568 Adds the multiple choice options that are identified as marked as a feedback option to a solution570 Parameters571 ------572 sub : Submission573 the current submission574 exam : Exam575 the current exam576 page_img : Image577 image of the page578 corner_keypoints : array579 locations of the corner keypoints as (x, y) tuples580 """581 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]583> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)584E ValueError: too many values to unpack (expected 2)585zesje/pregrader.py:25: ValueError586____________________________ test_skew[larger skew] ____________________________587new_exam = ExamMetadata(token='LXVNEOKNRJZE', barcode_coords=[40, 90, 510, 560])588datadir = '/builds/works-on-my-machine/zesje/tests/data', skew = (-10, -5)589expected = True590 @pytest.mark.parametrize('skew, expected', [591 ((10, 10), True),592 ((-10, -5), True)],593 ids=['small skew', 'larger skew'])594 def test_skew(new_exam, datadir, skew, expected):595 genPDF = generate_pdf(new_exam, 1)596 for image in makeImage(genPDF):597 image = apply_scan(img=image, skew=skew)598 # image.show()599> success, reason = scans.process_page(image, new_exam, datadir)600tests/test_scans.py:250: 601_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 602zesje/scans.py:344: in process_page603 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)604_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 605sub = <Submission 1>, exam = <Exam 1>, page = 0606page_img = array([[[255, 255, 255],607 [255, 255, 255],608 [255, 255, 255],609 ...,610 [255, 255, 255],611 ...[255, 255, 255],612 ...,613 [255, 255, 255],614 [255, 255, 255],615 [255, 255, 255]]], dtype=uint8)616corner_keypoints = [(18, 23), (553, 23), (18, 808), (553, 808)]617 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):618 """619 Adds the multiple choice options that are identified as marked as a feedback option to a solution621 Parameters622 ------623 sub : Submission624 the current submission625 exam : Exam626 the current exam627 page_img : Image628 image of the page629 corner_keypoints : array630 locations of the corner keypoints as (x, y) tuples631 """632 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]634> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)635E ValueError: too many values to unpack (expected 2)636zesje/pregrader.py:25: ValueError637_______________________ test_all_effects[1st full test] ________________________638new_exam = ExamMetadata(token='YJWXKBYUZLJN', barcode_coords=[40, 90, 510, 560])639datadir = '/builds/works-on-my-machine/zesje/tests/data', rotation = 0.5640scale = 0.99, skew = (10, 10), expected = True641 @pytest.mark.parametrize('rotation, scale, skew, expected', [642 (0.5, 0.99, (10, 10), True),643 (0.5, 1.01, (-10, -5), True)],644 ids=['1st full test', 'second full test'])645 def test_all_effects(646 new_exam, datadir, rotation,647 scale, skew, expected):648 genPDF = generate_pdf(new_exam, 1)649 for image in makeImage(genPDF):650 image = apply_scan(651 img=image, rotation=rotation, scale=scale, skew=skew)652 # image.show()653> success, reason = scans.process_page(image, new_exam, datadir)654tests/test_scans.py:266: 655_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 656zesje/scans.py:344: in process_page657 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)658_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 659sub = <Submission 1>, exam = <Exam 1>, page = 0660page_img = array([[[255, 255, 255],661 [255, 255, 255],662 [255, 255, 255],663 ...,664 [255, 255, 255],665 ...[255, 255, 255],666 ...,667 [255, 255, 255],668 [255, 255, 255],669 [255, 255, 255]]], dtype=uint8)670corner_keypoints = [(34, 39), (564, 35), (40, 816), (570, 812)]671 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):672 """673 Adds the multiple choice options that are identified as marked as a feedback option to a solution675 Parameters676 ------677 sub : Submission678 the current submission679 exam : Exam680 the current exam681 page_img : Image682 image of the page683 corner_keypoints : array684 locations of the corner keypoints as (x, y) tuples685 """686 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]688> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)689E ValueError: too many values to unpack (expected 2)690zesje/pregrader.py:25: ValueError691______________________ test_all_effects[second full test] ______________________692new_exam = ExamMetadata(token='JLSNOTERDVID', barcode_coords=[40, 90, 510, 560])693datadir = '/builds/works-on-my-machine/zesje/tests/data', rotation = 0.5694scale = 1.01, skew = (-10, -5), expected = True695 @pytest.mark.parametrize('rotation, scale, skew, expected', [696 (0.5, 0.99, (10, 10), True),697 (0.5, 1.01, (-10, -5), True)],698 ids=['1st full test', 'second full test'])699 def test_all_effects(700 new_exam, datadir, rotation,701 scale, skew, expected):702 genPDF = generate_pdf(new_exam, 1)703 for image in makeImage(genPDF):704 image = apply_scan(705 img=image, rotation=rotation, scale=scale, skew=skew)706 # image.show()707> success, reason = scans.process_page(image, new_exam, datadir)708tests/test_scans.py:266: 709_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 710zesje/scans.py:344: in process_page711 add_feedback_to_solution(sub, exam, barcode.page, image_array, corner_keypoints)712_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 713sub = <Submission 1>, exam = <Exam 1>, page = 0714page_img = array([[[255, 255, 255],715 [255, 255, 255],716 [255, 255, 255],717 ...,718 [255, 255, 255],719 ...[255, 255, 255],720 ...,721 [255, 255, 255],722 [255, 255, 255],723 [255, 255, 255]]], dtype=uint8)724corner_keypoints = [(15, 25), (555, 21), (21, 818), (561, 814)]725 def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):726 """727 Adds the multiple choice options that are identified as marked as a feedback option to a solution729 Parameters730 ------731 sub : Submission732 the current submission733 exam : Exam734 the current exam735 page_img : Image736 image of the page737 corner_keypoints : array738 locations of the corner keypoints as (x, y) tuples739 """740 problems_on_page = [problem for problem in exam.problems if problem.widget.page == page]742> top_left_point, fixed_corner_keypoints = fix_corner_markers(corner_keypoints, page_img.shape)743E ValueError: too many values to unpack (expected 2)744zesje/pregrader.py:25: ValueError745----------- coverage: platform linux, python 3.6.5-final-0 -----------746Name Stmts Miss Cover747-----------------------------------------------748zesje/__init__.py 18 4 78%749zesje/__main__.py 5 5 0%750zesje/_static_version.py 3 3 0%751zesje/_version.py 99 40 60%752zesje/api/__init__.py 40 0 100%753zesje/api/_helpers.py 10 5 50%754zesje/api/emails.py 107 77 28%755zesje/api/exams.py 189 148 22%756zesje/api/export.py 25 20 20%757zesje/api/feedback.py 55 39 29%758zesje/api/graders.py 18 8 56%759zesje/api/images.py 27 21 22%760zesje/api/mult_choice.py 60 47 22%761zesje/api/problems.py 54 38 30%762zesje/api/scans.py 35 24 31%763zesje/api/signature.py 23 17 26%764zesje/api/solutions.py 68 55 19%765zesje/api/students.py 61 44 28%766zesje/api/submissions.py 38 29 24%767zesje/api/summary_plot.py 58 47 19%768zesje/api/widgets.py 22 17 23%769zesje/database.py 119 2 98%770zesje/datamatrix.py 14 13 7%771zesje/emails.py 62 47 24%772zesje/factory.py 31 3 90%773zesje/images.py 49 11 78%774zesje/pdf_generation.py 112 10 91%775zesje/pregrader.py 52 15 71%776zesje/scans.py 363 99 73%777zesje/statistics.py 57 50 12%778-----------------------------------------------779TOTAL 1874 938 50%780Coverage HTML written to dir cov.html781Coverage XML written to file cov.xml782===================== 9 failed, 62 passed in 37.75 seconds =====================783error Command failed with exit code 1.784info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.785ERROR: Job failed: exit code 1