1

I know that one can run the tests written for unittest directly by pytest. But I want to rewrite them to make use of all that pytest has to offer. So, I would like to know

  1. How to go about doing it manually?
  2. If there is an automated tool which can do or at least partially do it.
Tejas Shetty
  • 685
  • 6
  • 30
  • 1
    There seems to be a [conversion tool](https://github.com/pytest-dev/unittest2pytest), though I haven't tested it. Generally, I would do this incrementally - if you want to change a certain test, convert the related test class. – MrBean Bremen Apr 14 '20 at 14:27

1 Answers1

1

I am new to pytest (but not new to xunit). It looks to me like you will spend most of your time refactoring setup and teardown into fixtures. See four phase test.

If you have a class hierarchy to test look here.

Ray Tayek
  • 9,841
  • 8
  • 50
  • 90