candango / firenado

Web Framework that extends Tornado Web organizing the application, and adding extra features.
Apache License 2.0
12 stars 9 forks source link

Create a test case launching ProcessLauncher #400

Closed piraz closed 1 year ago

piraz commented 2 years ago

The best as faster way to test a firenado application is running a ProcessLauncher against a fixture application.

We use this approach testing with behave. The behave.api.async_step.async_run_until_complete has no problem with asynchronous pexpect execution we just need to wait a little to keep the loop running.

This will be an initial approach but I think that maintaining the ioloop running on the test case class context instead of the setUp/teardown will remove the extra asynchronous sleep call.

piraz commented 2 years ago

From tornado v6.2.0b1:

.AsyncTestCase (and .AsyncHTTPTestCase) are deprecated. Use unittest.IsolatedAsyncioTestCase instead.

Let's get the ProcessLauncherTestCase using the right base class.

piraz commented 2 years ago

Maybe we can use this https://stackoverflow.com/a/46324983/2887989.

Tests are failing on Python 3.11.

piraz commented 1 year ago

Fixed by: #428