You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Raising an Assertion Error in unittest's setUpClass method causes exception in jsontestrunner's getLeaderboardData
To Reproduce
importunittestfromgradescope_utils.autograder_utils.decoratorsimport (
weight,
number,
leaderboard,
)
classTestAutograder(unittest.TestCase):
@classmethoddefsetUpClass(cls) ->None:
raiseAssertionError("compile for all tests failed")
returnsuper().setUpClass()
@number(1.1)@weight(1)deftest_01(self):
"Test 01"pass
Expected behavior
Raised error would have populated results.json for all test cases of that class.
Instead, received following error:
The autograder produced the following output:
Traceback (most recent call last):
File "/usr/lib/python3.10/unittest/suite.py", line 166, in _handleClassSetUp
setUpClass()
File "/autograder/source/tests/test.py", line 14, in setUpClass
raise AssertionError("compile for all tests failed")
AssertionError: compile for all tests failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/autograder/source/run_tests.py", line 8, in <module>
JSONTestRunner(visibility='visible',stdout_visibility='visible').run(suite)
File "/usr/local/lib/python3.10/dist-packages/gradescope_utils/autograder_utils/json_test_runner.py", line 196, in run
test(result)
File "/usr/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.10/unittest/suite.py", line 122, in run
test(result)
File "/usr/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.10/unittest/suite.py", line 122, in run
test(result)
File "/usr/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.10/unittest/suite.py", line 114, in run
self._handleClassSetUp(test, result)
File "/usr/lib/python3.10/unittest/suite.py", line 176, in _handleClassSetUp
self._createClassOrModuleLevelException(result, e,
File "/usr/lib/python3.10/unittest/suite.py", line 236, in _createClassOrModuleLevelException
self._addClassOrModuleLevelException(result, exc, errorName, info)
File "/usr/lib/python3.10/unittest/suite.py", line 246, in _addClassOrModuleLevelException
result.addError(error, sys.exc_info())
File "/usr/local/lib/python3.10/dist-packages/gradescope_utils/autograder_utils/json_test_runner.py", line 136, in addError
self.processResult(test, err)
File "/usr/local/lib/python3.10/dist-packages/gradescope_utils/autograder_utils/json_test_runner.py", line 123, in processResult
if self.getLeaderboardData(test)[0]:
File "/usr/local/lib/python3.10/dist-packages/gradescope_utils/autograder_utils/json_test_runner.py", line 51, in getLeaderboardData
column_name = getattr(getattr(test, test._testMethodName), '__leaderboard_column__', None)
AttributeError: '_ErrorHolder' object has no attribute '_testMethodName'
The text was updated successfully, but these errors were encountered:
GS doesn't seem to be responsive here for some goofy reason, but if you want to use my fork with your autograder you can add git+https://github.com/gregbell26/gradescope-utils to your requirements.txt instead of the official package.
Im also working on a complete rewrite of this package that will support the new features that the GS team has added to the platform.
Describe the bug
Raising an Assertion Error in unittest's setUpClass method causes exception in jsontestrunner's getLeaderboardData
To Reproduce
Expected behavior
Raised error would have populated results.json for all test cases of that class.
Instead, received following error:
The text was updated successfully, but these errors were encountered: