Skip to content

Conversation

@kilomeow
Copy link

@kilomeow kilomeow commented Oct 6, 2021

ValueError message contains wrong command

ValueError message contains wrong command
@Bibo-Joshi
Copy link
Member

Bibo-Joshi commented Oct 6, 2021

Hi, thanks for the catch! It seems that this test

@pytest.mark.parametrize(
'cmd',
['way_too_longcommand1234567yes_way_toooooooLong', 'ïñválídletters', 'invalid #&* chars'],
ids=['too long', 'invalid letter', 'invalid characters'],
)
def test_invalid_commands(self, cmd):
with pytest.raises(ValueError, match='not a valid bot command'):
CommandHandler(cmd, self.callback_basic)

doesn't check the error message carefully enough. Could you maybe change the match argument of pytest.raises to match=f'`{cmd}` is not a valid bot command' so that we improve this?

@harshil21 harshil21 added this to the v14 milestone Oct 7, 2021
@harshil21 harshil21 added the 📋 pending-reply work status: pending-reply label Oct 8, 2021
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
@Bibo-Joshi
Copy link
Member

Thanks for the update! However, the unit test will have to be adapted before we can merge :)

@Bibo-Joshi
Copy link
Member

closing due to inactivity & in favor of #2837

@Bibo-Joshi Bibo-Joshi closed this Dec 31, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2022
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🔌 enhancement pr description: enhancement 📋 pending-reply work status: pending-reply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants