Event Timeline
What exceptions are being ignored on line 57?
As I mentioned in the meeting, total=1 in the second half is a bug. Just using assertNotEquals does not verify that the thanks was successful. Another user could have done a thanks . You need to check that your test user did the thanks.
Exception handling is an error that is cropping up specifically for Topic:Sel4ipu6maqlbm0d on the Talk:Sandbox page on test:test, as I mentioned in the email. The exact error is as follows:
$ python -m unittest -v tests.flow_thanks_tests tests: max_retries reduced from 25 to 1 test_topic (tests.flow_thanks_tests.TestFlowThank) ... ERROR 11.651s ====================================================================== ERROR: test_topic (tests.flow_thanks_tests.TestFlowThank) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/flow_thanks_tests.py", line 53, in test_topic for topic in topics_list: File "pywikibot/flow.py", line 137, in topics topic = Topic.from_topiclist_data(self, root, data) File "pywikibot/flow.py", line 210, in from_topiclist_data topic._root = Post.fromJSON(topic, root_uuid, topiclist_data) File "pywikibot/flow.py", line 355, in fromJSON post = cls(page, post_uuid) File "pywikibot/flow.py", line 330, in __init__ raise NoPage(page, 'Topic must exist: %s') NoPage: Topic must exist: [[test:Topic:Sel4ipu6maqlbm0d]] ---------------------------------------------------------------------- Ran 1 test in 14.823s FAILED (errors=1)
We had discussed total=1 for thanks_tests. Here, for flow_thanks_tests, there are no direct means of extracting the user and checking for User.thanks_enabled, in which case we had agreed upon adding in a note and looking at it later. Hence I am not checking for User.thanks_enabled here.
Re total=1, the thanking user (the test user) is in the log. It is the recipient that isnt logged publically.
Please raise a task in phab about the NoPage in flow.py . as a general rule, never hide exceptions, and if you must hide an exception then specify exactly which exception should be ignored and add a very good code comment explaining why.