pytest-django
pytest-django copied to clipboard
A Django plugin for pytest.
_After the first test runner, the connection to DB dropped._ `django.db.utils.InterfaceError: connection already closed` _Seems to work with_ `pytest-django==4.2.0` **But broken with:** ``` pytest==6.2.4 pytest-django==4.4.0 psycopg2-binary==2.9.1 ``` **Error log:** ```...
If the first db test that gets run happens to have `transactional_db` (or `django_db(transaction=True)`) then all subsequent db tests will fail. This appears to be because the db setup (migrations...
Hi, Inside the conftest.py I have following configuration ```python @pytest.fixture(scope='session') def django_db_setup(django_db_setup, django_db_blocker): with django_db_blocker.unblock(): call_command('loaddata', 'tests/test_data/test_data1.json', database='default') call_command('loaddata', 'tests/test_data/test_data2.json', database='ipr') ``` As you can see i use two different...
This is my take on #105 and #243. This pull request adds a new fixture, `shared_db_wrapper`, that lets other fixtures access the database regardless of scope. `shared_db_wrapper` is a contextmanager...
The package on GNU Guix previously built successfully using: ``` dependencies: [email protected] [email protected] [email protected] + [email protected] ``` But after updating just pytest to 6.2.4, there are already these failures: ```...
Reimplement the Django TestCase's setUpTestData. Since we are already calling the setUpClass machinery from TestCase, it's a simple step to arrange for PytestDjangoTestCase to call the real test class's setUpTestData...
I am setting up my testing environment and my first pytest-django test works on Windows but errors out on Linux. I'm using a django custom user model as recommended for...
I haven't found this exact issue anywhere, apologies if I missed something. My special use-case is (ab-)using pytest-django for integration tests on a real server (of course not in production)...
This is a question rather than a real issue. The documentation does not have anything about this and I couldn't find any regarding issue. One can use [tags](https://docs.djangoproject.com/en/dev/topics/testing/tools/#tagging-tests) for Django...
When using the live_server in an integration test fixture: ```python @pytest.fixture(scope='session', name='server_url') def get_server_url(live_server, environment): """Start a django server to test against and return the url of the server.""" yield...