Passed
Pull Request — main (#169)
by
unknown
01:37
created

tests.core.test_heartbeat   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 25
dl 0
loc 37
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A TestHeartbeat.test_update_sequence() 0 3 2
A TestHeartbeat.test_get() 0 2 1
A TestHeartbeat.test_handle_heartbeat() 0 4 1
A TestHeartbeat.test_handle_hello() 0 7 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A web_socket_client_protocol() 0 3 1
1
# Copyright Pincer 2021-Present
0 ignored issues
show
Bug introduced by
There seems to be a cyclic import (pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.reaction -> pincer.objects.message.emoji).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.guild -> pincer.objects.guild.webhook).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.audit_log -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.message.sticker -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.attachment -> pincer.utils -> pincer.utils.signature -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.attachment -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.guild -> pincer.objects.guild.template).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.app -> pincer.objects.app.interactions -> pincer.objects.message.message).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.file -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.app -> pincer.objects.app.throttling -> pincer.objects.message.context).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.reaction -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.sticker -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.utils -> pincer.utils.tasks).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
introduced by
Missing module docstring
Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.followed_channel -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.attachment -> pincer.utils -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.guild -> pincer.objects.guild.invite).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.app.select_menu -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.ban -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.audit_log -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.ban -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.widget -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.app -> pincer.objects.app.throttling -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.overwrite -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.reaction -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.sticker -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.app -> pincer.objects.app.interactions -> pincer.objects.message.user_message -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.invite -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.thread -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.message -> pincer.objects.app -> pincer.objects.app.throttling -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.voice_state).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.guild.member -> pincer.objects.user -> pincer.objects.user.voice_state).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.voice_state -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.reaction -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.voice_state -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.user -> pincer.objects.user.connection).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.app -> pincer.objects.app.application -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.app -> pincer.objects.app.interaction_base -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.sticker -> pincer.objects.user -> pincer.objects.user.integration -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.user_message -> pincer.objects.app.interaction_base -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.user_message).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.app -> pincer.objects.app.interactions -> pincer.objects.app.interaction_base -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.app -> pincer.objects.app.select_menu -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.reaction -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer.objects.message -> pincer.objects.message.button -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.guild.role -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.sticker -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.events.presence -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.app -> pincer.objects.app.interactions -> pincer.objects.message.user_message -> pincer.objects.message.embed -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.reaction -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.app -> pincer.objects.app.interactions -> pincer.objects.message.user_message -> pincer.objects.message.attachment -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.sticker -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.sticker -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.reference -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.guild -> pincer.objects.guild.stage -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.context -> pincer.objects.app -> pincer.objects.app.interactions -> pincer.objects.message.user_message -> pincer.objects.message.component -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.guild.webhook -> pincer.objects.guild -> pincer.objects.guild.template -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.user_message -> pincer.objects.guild.member).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.message.button -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.reaction -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (pincer -> pincer.objects -> pincer.objects.app -> pincer.objects.app.interactions -> pincer.objects.message.message -> pincer.objects.message.file -> pincer.utils -> pincer.utils.tasks -> pincer.utils.insertion -> pincer.objects.message -> pincer.objects.message.button -> pincer.objects.message.emoji -> pincer.objects.user -> pincer.objects.user.integration -> pincer.objects.user.user).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
2
# Full MIT License can be found in `LICENSE` at the project root.
3
4
from unittest.mock import AsyncMock, Mock, patch
0 ignored issues
show
Bug introduced by
The name AsyncMock does not seem to exist in module unittest.mock.
Loading history...
5
6
import pytest
0 ignored issues
show
introduced by
Unable to import 'pytest'
Loading history...
7
8
from pincer.core.heartbeat import Heartbeat
9
from tests.utils.utils import assert_not_raises
10
11
12
@pytest.fixture
13
def web_socket_client_protocol():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
14
    return AsyncMock()
15
16
17
class TestHeartbeat:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
18
    def test_get(self):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
introduced by
Missing function or method docstring
Loading history...
19
        assert Heartbeat.get() == 0
20
21
    @pytest.mark.asyncio
22
    async def test_handle_hello(self, web_socket_client_protocol):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Comprehensibility Bug introduced by
web_socket_client_protocol is re-defining a name which is already available in the outer-scope (previously defined on line 13).

It is generally a bad practice to shadow variables from the outer-scope. In most cases, this is done unintentionally and might lead to unexpected behavior:

param = 5

class Foo:
    def __init__(self, param):   # "param" would be flagged here
        self.param = param
Loading history...
23
        payload = Mock()
24
        payload.data.get.return_value = 1
25
        with patch("pincer.core.heartbeat.Heartbeat"):
26
            await Heartbeat.handle_hello(web_socket_client_protocol, payload)
27
        web_socket_client_protocol.send.assert_awaited_once()
28
29
    @pytest.mark.asyncio
30
    async def test_handle_heartbeat(self, web_socket_client_protocol):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Comprehensibility Bug introduced by
web_socket_client_protocol is re-defining a name which is already available in the outer-scope (previously defined on line 13).

It is generally a bad practice to shadow variables from the outer-scope. In most cases, this is done unintentionally and might lead to unexpected behavior:

param = 5

class Foo:
    def __init__(self, param):   # "param" would be flagged here
        self.param = param
Loading history...
31
        await Heartbeat.handle_heartbeat(web_socket_client_protocol, "GARBAGE")
32
        web_socket_client_protocol.send.assert_awaited_once()
33
34
    def test_update_sequence(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
35
        with assert_not_raises():
36
            Heartbeat.update_sequence(42)
37