Skip to content

Commit

Permalink
Change marks for fixed integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed May 14, 2020
1 parent f9de16b commit baef25d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions integration_tests/rtm/test_issue_631.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def tearDown(self):
if hasattr(self, "rtm_client") and not self.rtm_client._stopped:
self.rtm_client.stop()

@pytest.mark.skipif(condition=is_not_specified(), reason="this is just for reference")
@pytest.mark.skipif(condition=is_not_specified(), reason="to avoid rate_limited errors")
def test_issue_631_sharing_event_loop(self):
self.success = None
self.text = "This message was sent to verify issue #631"

self.rtm_client = RTMClient(
token=self.bot_token,
run_async=False, # even though run_async=False, handlers for RTM events can be a coroutine
loop=asyncio.new_event_loop(), # TODO: remove this
run_async=False,
loop=asyncio.new_event_loop(), # TODO: this doesn't work without this
)

# @RTMClient.run_on(event="message")
Expand Down Expand Up @@ -72,8 +72,7 @@ def test_issue_631_sharing_event_loop(self):

# Solution (1) for #631
@RTMClient.run_on(event="message")
# even though run_async=False, handlers for RTM events can be a coroutine
async def send_reply(**payload):
def send_reply(**payload):
self.logger.debug(payload)
data = payload['data']
web_client = payload['web_client']
Expand All @@ -82,7 +81,7 @@ async def send_reply(**payload):
if "text" in data and self.text in data["text"]:
channel_id = data['channel']
thread_ts = data['ts']
self.success = await web_client.chat_postMessage(
self.success = web_client.chat_postMessage(
channel=channel_id,
text="Thanks!",
thread_ts=thread_ts
Expand All @@ -106,7 +105,6 @@ def connect():
self.web_client = WebClient(
token=self.bot_token,
run_async=False,
loop=asyncio.new_event_loop(), # TODO: this doesn't work without this
)
new_message = self.web_client.chat_postMessage(channel=self.channel_id, text=self.text)
self.assertFalse("error" in new_message)
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/samples/issues/issue_497.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)


# This doesn't work
# Fixed in 2.6.0: This doesn't work
@app.route("/sync/singleton", methods=["GET"])
def singleton():
try:
Expand Down

0 comments on commit baef25d

Please sign in to comment.