Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The test script starts with imports followed by declarations. A test script usually contains setup and teardown functions to initialize and destroy any setup data that is required for the test to run. In the above script , a symbolic link is created in the setup function. Testing framework recognises the funtions that start with the "test_" name in their names as test functions. In the above script test , test_gencords() function is the test function which runs the script to be tested externally and obtains the result. The difference in the results are compared (with the known sample outputs). The teardown function is executed at the end. In the above example, a symbolic link created in the setup is destroyed in the teardown function since the testing has been completed.

Pytest reports the result in the following format.

...