macobo / python-grader

Python >= 3.3 automatic grader
MIT License
11 stars 5 forks source link

@test_cases without description gives error #38

Closed aivarannamaa closed 10 years ago

aivarannamaa commented 10 years ago
Traceback (most recent call last):
  File "C:\workspaces\2014_kevad\Alused2\Auto2\tester.py", line 80, in <module>
    @test_cases(seisud)
  File "C:\Python34\lib\site-packages\grader-0.0.1-py3.4.egg\grader\wrappers.py", line 74, in test_cases
    description = ", ".join(str(i)+"={"+key+"}" for i, key in enumerate(test_args[0]))
  File "C:\Python34\lib\site-packages\grader-0.0.1-py3.4.egg\grader\wrappers.py", line 74, in <genexpr>
    description = ", ".join(str(i)+"={"+key+"}" for i, key in enumerate(test_args[0]))
TypeError: Can't convert 'list' object to str implicitly
aivarannamaa commented 10 years ago

It's also a bit confusing that when I temporarily wrote description="blaa", grader ran only one test, said that test failed but overall success was true:

{
    "results": [
        {
            "traceback": "Traceback (most recent call last):\n  File \"C:\\Python34\\lib\\site-packages\\grader-0.0.1-py3.4.egg\\grader\\execution_base.py\", line 63, in call_test_function\n    **pre_hook_info[\"extra_kwargs\"]\n  File \"C:\\Python34\\lib\\site-packages\\grader-0.0.1-py3.4.egg\\grader\\core.py\", line 46, in wrapper\n    result = test_function(module, *args, **kwargs)\n  File \"C:\\Python34\\lib\\site-packages\\grader-0.0.1-py3.4.egg\\grader\\wrappers.py\", line 95, in _inner\n    function(m, *_args, **_kw)\n  File \"C:\\Users\\Aivar\\AppData\\Local\\Temp\\tmplr7pxcyp\\tester.py\", line 86, in testi\n    ).format(expected, actual)\nAssertionError: Tulemus ei vastanud oodatule.\nOotasime ?, saime X\n",
            "success": false,
            "description": "blaa",
            "time": "0.140",
            "error_message": "AssertionError: Tulemus ei vastanud oodatule.\nOotasime ?, saime X",
            "log": [
                "EA ? X"
            ]
        }
    ],
    "success": true
}
macobo commented 10 years ago

I will look into that, thanks.

About the second - the general success means that running the tests succeeded (this can be false if for example the tester has a syntaxerror or trying to use docker without it being installed).