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 2020/07/14 00:57:38 UTC

[GitHub] [beam] rosetn commented on a change in pull request #12246: Add Python snippets in testing guide.

rosetn commented on a change in pull request #12246:
URL: https://github.com/apache/beam/pull/12246#discussion_r454032716



##########
File path: website/www/site/content/en/documentation/pipelines/test-your-pipeline.md
##########
@@ -180,8 +191,21 @@ PAssert.that(output)
   "elem3",
   "elem2");
 {{< /highlight >}}
+{{< highlight py >}}
+from apache_beam.testing.util import assert_that
+from apache_beam.testing.util import equal_to
 
-Any code that uses `PAssert` must link in `JUnit` and `Hamcrest`. If you're using Maven, you can link in `Hamcrest` by adding the following dependency to your project's `pom.xml` file:
+output = ...
+
+// Check whether a PCollection contains some elements in any order.

Review comment:
       Change // to hash marks

##########
File path: website/www/site/content/en/documentation/pipelines/test-your-pipeline.md
##########
@@ -284,3 +345,32 @@ public class WordCountTest {
     }
 }
 {{< /highlight >}}
+
+{{< highlight py >}}
+class WordCountTest(unittest.TestCase):
+
+  # Our input data, which will make up the initial PCollection.
+  WORDS = [

Review comment:
       Out of curiosity: why are the list names in all caps? I don't see anything in the PEP8 against it, but it's inconsistent with most of our code samples.




----------------------------------------------------------------
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.

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