pytest-postgresql
pytest-postgresql copied to clipboard
Error: Context manager 'postgresql_factory' doesn't implement __enter__ and __exit__.
What action do you want to perform
Use the the fixture with with connection.cursor() as cursor: and connection.close() statements
What are the results
Context manager 'postgresql_factory' doesn't implement enter and exit.
What are the expected results
Be able to use the connection from the fixture the same way I use connection from psycopg2
postgresql_factory is not context manager, it does return connection though. Are you trying to use it as such?
What's your use case? ANd what is the full error?