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 2021/12/13 14:49:26 UTC

[GitHub] [beam] pabloem commented on a change in pull request #16179: [BEAM-13344][Playground] support python unit tests

pabloem commented on a change in pull request #16179:
URL: https://github.com/apache/beam/pull/16179#discussion_r767826292



##########
File path: playground/backend/internal/validators/python_validators.go
##########
@@ -15,8 +15,34 @@
 
 package validators
 
-// GetPythonValidators return validators methods that should be applied to Go code
-func GetPythonValidators() *[]Validator {
-	//TODO: Will be added in task [BEAM-13292]
-	return &[]Validator{}
+import (
+	"beam.apache.org/playground/backend/internal/logger"
+	"io/ioutil"
+	"strings"
+)
+
+const pyUnitTestPattern = "import unittest"

Review comment:
       should we file a bug to make sure that this works fine? users may accidentaly import unittest without adding an actual test? (maybe?) - perhaps the frontend should show the user that `import unittest` will make the playground run unit tests.

##########
File path: playground/backend/internal/validators/python_validators.go
##########
@@ -15,8 +15,34 @@
 
 package validators
 
-// GetPythonValidators return validators methods that should be applied to Go code
-func GetPythonValidators() *[]Validator {
-	//TODO: Will be added in task [BEAM-13292]
-	return &[]Validator{}
+import (
+	"beam.apache.org/playground/backend/internal/logger"
+	"io/ioutil"
+	"strings"
+)
+
+const pyUnitTestPattern = "import unittest"

Review comment:
       another option is `(unittest.TestCase)` .. though I recognize this is hard.




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

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