Thomas O'Neill
Thomas O'Neill

Reputation: 1

Pytest with Pycharm and Django issue

Running pytest from command line works fine, but I'd love to be able to do this through Pycharm as the ability to debug tests would be amazing. I'm running on Pycharm 2024.1.1, on a Cookiecutter project that doesn't use Docker. Here in my pytest run configuration:

Pycharm pytest run configuration

When I run it I get:

Using existing test database for alias 'default' ('test_co2t')...

test setup failed
self = <DatabaseWrapper vendor='postgresql' alias='__no_db__'>

    @async_unsafe
    def ensure_connection(self):
        """Guarantee that a connection to the database is established."""
        if self.connection is None:
            with self.wrap_database_errors:
>               self.connect()

I've tried many different combinations of settings. I've verified that pytest is installed in the chosen interpreter.

I thought I would ask if it should possible to do this, before I sink more hours into messing around with the settings. Thanks!

Upvotes: 0

Views: 47

Answers (0)

Related Questions