Ask coding questions

← Back to all posts
Flask app in classroom assignment, unittests
Pavils (1)

I'd like to prepare some assignments in my classroom where students would write a simple web server using Flask framework.

If I create Flask app in my repl, and run it, a separate "browser" window appears, with live website in it. It even has a global URL that can be accessed from anywhere. However, if I run the same code in the assignment view, the code runs but the "browser" window does not appear, it's not clear if the server is accessible from outside.

If a live server could be started, it would be great if the student code could be verified with some unit tests. A test would make GET or POST requests to the server and expect certain results. But it's not clear if the current classroom framework allows to implement unit tests on a running code.