udim commented on a change in pull request #11939:
URL: https://github.com/apache/beam/pull/11939#discussion_r436908464
##########
File path: sdks/python/apache_beam/typehints/typehints_test.py
##########
@@ -612,54 +613,70 @@ def test_match_type_variables(self):
hint.match_type_variables(typehints.Dict[int, str]))
-class SetHintTestCase(TypeHintTestCase):
+class BaseSetHintTest:
Review comment:
Nice solution! I've run into this in the past.
What's happening is that pytest is loading all modules and inspecting their
attributes looking for tests to run. Another solution solution would have been
to set `BaseSetHintTest = None` near the bottom of this module. Effectively
both solutions are hiding the base class from being collected by pytest.
##########
File path: sdks/python/apache_beam/typehints/typehints_test.py
##########
@@ -615,8 +615,8 @@ def test_match_type_variables(self):
class BaseSetHintTest:
class CommonTests(TypeHintTestCase):
- def __init__(self, string_type, py_type, beam_type, *args, **kwargs):
- super().__init__(*args, **kwargs)
+ def __init__(self, string_type, py_type, beam_type, method_name='runTest'):
Review comment:
This is fine, but I would leave this out. We don't use this feature
##########
File path: sdks/python/apache_beam/typehints/typehints_test.py
##########
@@ -615,8 +615,8 @@ def test_match_type_variables(self):
class BaseSetHintTest:
class CommonTests(TypeHintTestCase):
- def __init__(self, string_type, py_type, beam_type, *args, **kwargs):
- super().__init__(*args, **kwargs)
+ def __init__(self, string_type, py_type, beam_type, method_name='runTest'):
Review comment:
This is fine, but I would leave `method_name` out. We don't use this
feature
----------------------------------------------------------------
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:
[email protected]