You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not quite sure how is this supposed to work, since the mehod is outside of the TestCase class
import unittest
import testing.postgresql
def tearDownModule(self):
Postgresql.clear_cache()
class Base(unittest.TestCase):
def setUp(self) -> None:
self.postgresql = Postgresql()
print(self.postgresql.url())
def tearDown(self) -> None:
self.postgresql.stop()
class TestInitial(Base):
def some_test_suite(self):
print('Test this works')
def some_test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestInitial))
return suite
if __name__ == '__main__':
with testing.postgresql.Postgresql() as postgresql:
engine = create_engine(postgresql.url())
db = psycopg2.connect(**postgresql.dsn())
runner = unittest.TextTestRunner()
runner.run(some_test_suite())
Next what happens is two things:
No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
and
ERROR: testing.common.database: failed to shutdown the server automatically. Any server processes and files might have been leaked. Please remove them and call the stop() certainly
Full log:
postgresql://[email protected]:47359/test
No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
.
----------------------------------------------------------------------
Ran 1 test in 0.807s
OK
ERROR: testing.common.database: failed to shutdown the server automatically.
Any server processes and files might have been leaked. Please remove them and call the stop() certainly
ERROR: testing.common.database: failed to shutdown the server automatically.
Any server processes and files might have been leaked. Please remove them and call the stop() certainly
I've been struggling with this for quite a while and I will appreciate any feedback. Thank you
The text was updated successfully, but these errors were encountered:
Hello, the below appears when following the guide:
I'm not quite sure how is this supposed to work, since the mehod is outside of the TestCase class
Next what happens is two things:
No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
and
ERROR: testing.common.database: failed to shutdown the server automatically. Any server processes and files might have been leaked. Please remove them and call the stop() certainly
Full log:
I've been struggling with this for quite a while and I will appreciate any feedback. Thank you
The text was updated successfully, but these errors were encountered: