1

Hi I started building up automation suite using selenium with python. As most tutorial used python unit test framework.

I have 5 scenarios of testing login page. Next 50 or more test are going to be needed already logged into the app.

I find unittest framework is rigid and do not give enough flexibility. found This link simply building own framework, other than using already written assertions, I don't see any big advantages using unit test framework as tester. May be it's good for unit-testing for python developers. Can anybody please enlight me if I'm wrong.

  • 1
    what specifically in unittest do you find rigid or lacking flexibility? – Corey Goldberg Mar 27 '18 at 17:23
  • I'm new to both selenium and Python. I'm using only unittest not Py.test. what I specially looking for is test dependency. (I know theoretically it's bad But not need to logging in each time you try to run test ) – 1234 Mar 27 '18 at 20:47
  • you really don't want dependent test cases – Corey Goldberg Apr 2 '18 at 19:08
1

You are not wrong, the unit test framework is a good way to demo something or have a proof of concept, but it is limited for slower, complex integration tests.

In my current project I have tried proboscis which has somewhat richer feature set, and recently moved Robot framework. Both were better than plain unittest but still lacks some features.

If you are using a continuous integration framework don't forget integration with it, unittest and Robot have ready, out of the box, integration including user friendly results display

  • I think proboscis may have what I'm looking for specially "Allows for explicit test dependencies and skipping of dependent tests on failures." – 1234 Mar 27 '18 at 20:34
2

How much experience do you have in Python development? Not sure what features are you missing in Pyunit (which cannot be added with reasonable efforts).

Py.test is extremely popular python test framework with rich and flexible features. The catch is, you need to learn how to use those features.

I prefer to use the simplest tool for the job, which is mature enough and having likely long-time support. Both Pyunit and py.test fits that description.

I found Pyunit simple enough, and easy enough to customize and extend by adding the features I needed (simpler that learning how to configure those same features in Py.test). YMMV.

  • 1
    good answer. I also like that Py.test can run traditional unittest testcases – Corey Goldberg Mar 27 '18 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.