You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/03 16:10:45 UTC

[GitHub] [beam] kennknowles opened a new issue, #18029: Update Python SDK example tests to use assert_that

kennknowles opened a new issue, #18029:
URL: https://github.com/apache/beam/issues/18029

   Most of our examples use assert_that to test examples:
   
   https://github.com/apache/incubator-beam/blob/python-sdk/sdks/python/apache_beam/examples/complete/autocomplete_test.py#L38
   
   Some of our examples use this pattern:
   
   1) Create a path(s)
   2) Construct fake command line arguments using these paths
   3) Construct an argparse object to parse these flags
   4) Do the (often trivial logic)
   5) Write to a file
   6) Manually open and read the file
   7) Compare results. 
   
   https://github.com/apache/incubator-beam/blob/python-sdk/sdks/python/apache_beam/examples/cookbook/multiple_output_pardo_test.py
   
   As well as being cumbersome, this obscures the core of what is being illustrated and tested. As many as possible tests should be updated to use assert_that.
   
   Imported from Jira [BEAM-520](https://issues.apache.org/jira/browse/BEAM-520). Original Jira may contain additional context.
   Reported by: altay.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org