1

I'm running parallel unittesting using Django 's manage.py test command.

The issue is that this command only recognized the unittest-way test method - for those that has the pytest-way eg no test class and have fixture param, manage.py test will skip them.

So my question is how to get manage.py test collect the pytest-way test methods?

p.s.

The reason I go for Django unittest manage.py test is because of its --parallel feature ie it can handle beautifully test database creation for each parallel thread the test running in.

Nam G VU
  • 33,193
  • 69
  • 233
  • 372
  • If you're writing pytest-style tests, then you need to switch to using `pytest` instead of `manage.py test` as the runner. You might find the [pytest-django](https://pytest-django.readthedocs.io/en/latest/) plugin useful. – Alasdair Nov 09 '20 at 16:01
  • @Alasdair Thanks for pointing out - I added the reason why I need `Django unittest` to take care of in-parallel test database. – Nam G VU Nov 09 '20 at 16:08
  • 1
    See [here](https://pytest-django.readthedocs.io/en/latest/usage.html#running-tests-in-parallel-with-pytest-xdist) for running the tests in parallel with pytest-django. – Alasdair Nov 09 '20 at 16:11
  • Thanks @Alasdair to point out that pytest-django capable of handling parallel test databases as well - I'll try pytest-django and back to us later. – Nam G VU Nov 10 '20 at 01:27
  • @Alasdair it's working using pytest-django to run test in parallel. Please add your answer to get accepted. Thanks. – Nam G VU Nov 11 '20 at 11:31
  • 1
    Glad you got it working. You can add your own answer to say how you solved the problem. – Alasdair Nov 11 '20 at 15:19

0 Answers0