diff --git a/docs/mkdocs.py b/docs/mkdocs.py index aa19556349f38c63a08a2bf7ccdc36c0c4b2aee1..685860e925567f289b47f9a14d3a2e6734250036 100644 --- a/docs/mkdocs.py +++ b/docs/mkdocs.py @@ -8,7 +8,7 @@ if __name__ == "__main__": bibtex = make_bibliography("../setup.py", "./") out = subprocess.check_output("python --version").decode("utf-8") - fn = unitgrade_private.__path__[0] + "/../../examples/02631/instructor/week5/report1intro.py" + fn = unitgrade_private.__path__[0] + "/../../examples/02631/instructor/week5/looping_tests.py" out = subprocess.check_output(f"cd {os.path.dirname(fn)} && python {os.path.basename(fn)} --noprogress", shell=True, encoding='utf8', errors='strict') out = out.replace("", "") diff --git a/requirements.txt b/requirements.txt index 5fcd9059477be6d2e794970466b92d320122be00..577cf4398f649a48d7fb01ed0547b0795ec0a22a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ colorama numpy scikit_learn snipper +importnb # Experimental notebook inclusion feature. May not be required. \ No newline at end of file diff --git a/src/unitgrade/framework.py b/src/unitgrade/framework.py index badb2d45ba89d597c131d6aed192f7ef38d9c493..409ee1895537050d403756d26f34ca480f3562e0 100644 --- a/src/unitgrade/framework.py +++ b/src/unitgrade/framework.py @@ -251,6 +251,7 @@ class UTestCase(unittest.TestCase): if "def" in lines2[j] or "class" in lines2[j]: break from snipper.legacy import gcoms + fun = lines2[j] comments, _ = gcoms("\n".join(lines2[j:l])) if rel not in cc: @@ -479,7 +480,8 @@ class UTestCase(unittest.TestCase): if self._cache_contains(key): CC = self._cache_get(key) cl, m = self.cache_id() - gprint(f"> An error occured while solving: {cl}.{m}. The files/methods you need to edit are:") # For the test {id} in {file} you should edit:") + # Insert newline to get better formatting. + gprint(f"\n> An error occured during the test: {cl}.{m}. The following files/methods has code in them you are supposed to edit and may therefore be the cause of the problem:") for file in CC: rec = CC[file] gprint(f"> * {file}") diff --git a/src/unitgrade/utils.py b/src/unitgrade/utils.py index 00ea948b56c9a3cac92239d0f7f5f3401cc4a2a5..23442d2d3bdee735866bd73f9a71103c05aeaaba 100644 --- a/src/unitgrade/utils.py +++ b/src/unitgrade/utils.py @@ -13,7 +13,7 @@ _CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"]) def gprint(s): - print(f"{Fore.GREEN}{s}") + print(f"{Fore.LIGHTGREEN_EX}{s}") myround = lambda x: np.round(x) # required for obfuscation.