diff --git a/nbgrader/tests/apps/test_nbgrader_submit.py b/nbgrader/tests/apps/test_nbgrader_submit.py index c70a291be..32f3f43e6 100644 --- a/nbgrader/tests/apps/test_nbgrader_submit.py +++ b/nbgrader/tests/apps/test_nbgrader_submit.py @@ -248,4 +248,16 @@ def test_submit_max_dir_size(self, exchange, cache, course_dir): self._make_file(join("ps1", "large_file"), contents="x" * 2001) with pytest.raises(RuntimeError): self._submit("ps1", exchange, cache, - flags=['--CourseDirectory.max_dir_size=3']) \ No newline at end of file + flags=['--CourseDirectory.max_dir_size=3']) + + def test_ensure_timestamp(self, exchange, cache, course_dir): + # Ensure timestamp is created even if something goes wrong in submitting + # If timestamp is not created, feedback workflow can be broken + # see: https://github.com/jupyter/nbgrader/pull/1755 + self._release_and_fetch("ps1", exchange, cache, course_dir) + os.chmod("ps1/p1.ipynb", 0o244) + with pytest.raises(OSError): + self._submit("ps1", exchange, cache) + os.chmod("ps1/p1.ipynb", 0o644) + dirname = os.listdir(join(exchange, "abc101", "inbound"))[0] + assert os.path.isfile(join(exchange, "abc101", "inbound", dirname, "timestamp.txt"))