Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Sunday, 28 March 2021

PyTest

PyTest is an Open source Python testing framework that is primarily used for unit testing. This particular Python testing framework in 2020 is scalable as it is useful for writing simple automation tests as well as complex functional tests for applications and libraries. It is easy to get started with  PyTest. It is compatible with python 3.5+ and PyPy3.

Test suites written using PyTest are more compact as a lot of boiler-plate code is not required and there is no requirement to include tests into largest test classes. Unlike the default Python testing framework 2020. Which mandates tests to start with test or end with test, there is no fixed test case nomenclature in PyTest. This is because PyTest has built in features that supports auto discovery of test modules and functions.

There is no need to remember self.assert* names due to the introduction of the useful feature of assert rewriting that helps in providing detailed information on failing assert statements.

Prerequisites -

The best part about PyTest, Python testing framework, is that it involves a gentle learning curve. It is easy to get started with PyTest, especially if we have prior working knowledge about any existing Python testing frameworks. we will just need a Python IDE for development and Python Package Manager for installing PyTest.

Pros -

There are a number of advantages of the PyTest framework,, major one's are:

  1. It is compatible with other Python testing frameworks such as unittest(or PyUnit)
  2. PyTest can also be used for creating complex functional test cases.
  3. It requires less effort to port existing implementations using other Python testing frameworks to PyTest.
  4. PyTest can be used for projects that practice TDD(Test Drivern Development) as well as Open-source projects.
  5. PyTest is instrumental in creating effective test cases  and test suites as it supports. parameterization.Using parameterization, test cases can be executed with different input configurations thereby resulting in minimal code repetition.
  6. Testing using PyTest are easy to understand as there is very little boiler-plate code.
  7. It supports fixtures and calssess due to which common test objects are available through the lifecycle of a module/class/function/session.
  8. PyTest is extensible and the Python testing framework already has rich plugin architecture. There are currently 315+ external plugins with PyTest.
  9. It supprots Parallel test execution through the pytest xdist plugin
  10. Assets in PyTest provides detailed information about the failures scenarios.

Is PyTest The best Python Testing Framework...?

We can choose PyTest over the default selenium Python framework i.e.unitest in case we are developing complex functional tests. Fixtures, Classes as well as Parameterization can be extremely handy for automation test development.