[ 
https://issues.apache.org/jira/browse/BEAM-5745?focusedWorklogId=156055&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-156055
 ]

ASF GitHub Bot logged work on BEAM-5745:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Oct/18 17:33
            Start Date: 18/Oct/18 17:33
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on issue #6687: [BEAM-5745] Fix 
annotation test for py3
URL: https://github.com/apache/beam/pull/6687#issuecomment-431096243
 
 
   For completeness, the overriding filter `('default', None, <class 
'Warning'>, None, 0)` is added by unit test framework here:
   
https://github.com/python/cpython/blob/1a2b52bbd2c6513aaf5bb915890ea7647713d5df/Lib/unittest/runner.py#L161.
   
   Full stacktrace:
   ```
     File "./setup.py", line 230, in <module>                                  
       'test': generate_protos_first(test),                           
     File "/tmp/py3env/lib/python3.5/site-packages/setuptools/__init__.py", 
line 140, in setup
       return distutils.core.setup(**attrs)                                     
 
     File "/usr/lib/python3.5/distutils/core.py", line 148, in setup            
                                           
       dist.run_commands()                     
     File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
       self.run_command(cmd)                                                    
 
     File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
       cmd_obj.run()                                                           
     File "./setup.py", line 165, in run
       super(cmd, self).run()
     File "/tmp/py3env/lib/python3.5/site-packages/setuptools/command/test.py", 
line 228, in run
       self.run_tests()
     File "/tmp/py3env/lib/python3.5/site-packages/setuptools/command/test.py", 
line 250, in run_tests
       exit=False,
     File "/usr/lib/python3.5/unittest/main.py", line 94, in __init__
       self.runTests()
     File "/usr/lib/python3.5/unittest/main.py", line 255, in runTests
       self.result = testRunner.run(self.test)
     File "/usr/lib/python3.5/unittest/runner.py", line 161, in run
       warnings.simplefilter(self.warnings)
     File ".../beam/sdks/python/apache_beam/utils/annotations.py", line 105, in 
my_simplefilter_patch
       traceback.print_stack(file=sys.stdout)    # <--- My monkey-patch.
   ```
   So the behavior of annotations doesn't change on Python 3, but some 
internals of unit test framework did. I lean towards removing 
`warnings.simplefilter("once")` from our code, since it's not done right, and 
removing unit tests that  verify that behavior. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 156055)
    Time Spent: 1h 40m  (was: 1.5h)

> Util test on annotations fails 
> -------------------------------
>
>                 Key: BEAM-5745
>                 URL: https://issues.apache.org/jira/browse/BEAM-5745
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Ruoyun Huang
>            Assignee: Ruoyun Huang
>            Priority: Minor
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Traceback (most recent call last):
>   File 
> "/usr/local/google/home/ruoyun/projects/beam/sdks/python/apache_beam/utils/annotations_test.py",
>  line 142, in test_frequency
>     label_check_list=[])
>   File 
> "/usr/local/google/home/ruoyun/projects/beam/sdks/python/apache_beam/utils/annotations_test.py",
>  line 149, in check_annotation
>     self.assertIn(fnc_name + ' is ' + annotation_type, 
> str(warning[-1].message))
> AssertionError: 'fnc2_test_annotate_frequency is experimental' not found in 
> 'fnc_test_annotate_frequency is experimental.'



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to