diff --git a/requirements.txt b/requirements.txt index 5d7e63e6b2852ab010a359f5e0ba796f3d24e7e3..49a54362f535df8820fe190b09ec48fc3a49ed4f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,8 +10,5 @@ colorama numpy scikit_learn snipper -<<<<<<< HEAD importnb # Experimental notebook inclusion feature. May not be required. -======= -requests # To read remote files for automatic updating. ->>>>>>> c157b3d262cc96db218ca37a4f96005cfec0d138 +requests # To read remote files for automatic updating. diff --git a/src/unitgrade/evaluate.py b/src/unitgrade/evaluate.py index ab805b8595409ea77fb32fdcd5ffcd96de73e93e..9c4392b101915a3e060f7993676782dd9b2933eb 100644 --- a/src/unitgrade/evaluate.py +++ b/src/unitgrade/evaluate.py @@ -172,7 +172,9 @@ def evaluate_report(report, question=None, qitem=None, passall=False, verbose=Fa detail['status'] = 'error' else: raise Exception("Status not known.") - detail = {**detail, **msg}#['message'] = msg + + nice_title = s.title + detail = {**detail, **msg, 'nice_title': nice_title}#['message'] = msg details[key] = detail # q_[s._testMethodName] = ("pass", None) diff --git a/src/unitgrade/framework.py b/src/unitgrade/framework.py index 7ff3bdf439e332f273377fdf63227bdc95455442..f1d16b8352f844202746bba3b81ef8523868afd4 100644 --- a/src/unitgrade/framework.py +++ b/src/unitgrade/framework.py @@ -128,8 +128,8 @@ class Report: if not url.endswith("/"): url += "/" snapshot_file = os.path.dirname(self._file()) + "/unitgrade_data/.snapshot" - print("Sanity checking time using snapshot", snapshot_file) - print("and using self-identified file", self._file()) + # print("Sanity checking time using snapshot", snapshot_file) + # print("and using self-identified file", self._file()) if os.path.isfile(snapshot_file): with open(snapshot_file, 'r') as f: @@ -140,15 +140,15 @@ class Report: if self.url.startswith("https://gitlab"): # Try to turn url into a 'raw' format. - "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/cs102_autolab/report2_test.py?inline=false" + # "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/cs102_autolab/report2_test.py?inline=false" # url = self.url url = url.replace("-/tree", "-/raw") - print(url) + # print(url) # "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/tree/master/examples/autolab_example_py_upload/instructor/cs102_autolab" # "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/report2_test.py?inline=false" # "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/cs102_autolab/report2_test.py?inline=false" raw_url = urllib.parse.urljoin(url, os.path.basename(self._file()) + "?inline=false") - print("Is this file run in local mode?", self._is_run_in_grade_mode()) + # print("Is this file run in local mode?", self._is_run_in_grade_mode()) if self._is_run_in_grade_mode(): remote_source = requests.get(raw_url).text with open(self._file(), 'r') as f: @@ -430,12 +430,12 @@ class UTestCase(unittest.TestCase): # file = inspect.getfile(self.__class__) import importlib, inspect found_reports = [] - print("But do I have report", self._report) - print("I think I am module", self.__module__) - print("Importlib says", importlib.import_module(self.__module__)) + # print("But do I have report", self._report) + # print("I think I am module", self.__module__) + # print("Importlib says", importlib.import_module(self.__module__)) # This will delegate you to the wrong main clsas when running in grade mode. for name, cls in inspect.getmembers(importlib.import_module(self.__module__), inspect.isclass): - print("checking", cls) + # print("checking", cls) if issubclass(cls, Report): for q,_ in cls.questions: if q == self.__class__: