pytest-postgresql icon indicating copy to clipboard operation
pytest-postgresql copied to clipboard

Error: Context manager 'postgresql_factory' doesn't implement __enter__ and __exit__.

Open alon-parag opened this issue 3 years ago • 1 comments

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

alon-parag avatar Mar 31 '22 12:03 alon-parag

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?

fizyk avatar Mar 31 '22 15:03 fizyk