Skip to content

Commit

Permalink
Add example of partial_credit decorator [ch22772]
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahima committed Feb 11, 2020
1 parent 8bf4f51 commit 1dfda16
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/src/tests/test_partial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import unittest
import random
from gradescope_utils.autograder_utils.decorators import partial_credit


class TestPartialCredit(unittest.TestCase):
def setUp(self):
pass

@partial_credit(10.0)
def test_partial(self, set_score=None):
"""Sets partial credit"""
set_score(random.randint(0, 100) *1.0/10.0)

0 comments on commit 1dfda16

Please sign in to comment.