Skip to content

Fix getting of the "bad ticks" instructions for codeblocks - #3549

Open
roli2py wants to merge 3 commits into
python-discord:mainfrom
roli2py:fix-get-of-wrong-ticks-instructions
Open

Fix getting of the "bad ticks" instructions for codeblocks#3549
roli2py wants to merge 3 commits into
python-discord:mainfrom
roli2py:fix-get-of-wrong-ticks-instructions

Conversation

@roli2py

@roli2py roli2py commented Aug 17, 2026

Copy link
Copy Markdown

Also, because RE finding isn't overlapping now, the test_should_recognize_contained_codeblock_even_if_that_breaks_formatting unit test is failing. Not sure it's critical or not, so I marked it as expected to fail.

Closes #3547

@roli2py
roli2py requested a review from MarkKoz as a code owner August 17, 2026 11:01
Comment thread bot/exts/info/codeblock/_instructions.py Outdated
Comment on lines +33 to 34
@unittest.expectedFailure
def test_should_recognize_contained_codeblock_even_if_that_breaks_formatting(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the faulty code block here? I think this test shouldn't e an expected failure. Though if this is an edge case that's hard to fix, then I'm fine with letting this be a failure.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's an edge case, but I don't really know. I tried to figure out how to fix it, but it seems adding a lot of code and, therefore, an overwhelm.



class ProvideBadTicksInstructionsTest(unittest.TestCase):
def __assert_is_instructions_for_message_bad_ticks_one(self, message: str) -> None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a single underscore as a prefix, not a double underscore.

@roli2py roli2py Aug 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This method is test-case-specific and I think we can just leave with double underscore. As I understand, a single underscore is used when we need to use objects internally, for example, within the module and not only in the class.

UPD: rephrased the last sentence

Comment thread tests/bot/exts/info/codeblock/test_instructions.py Outdated
Comment thread tests/bot/exts/info/codeblock/test_instructions.py Outdated
Create the unit tests that check whether the finder recognizes Python
strings as codeblocks.
@roli2py
roli2py force-pushed the fix-get-of-wrong-ticks-instructions branch from 001bdca to 9b4162b Compare August 29, 2026 15:19
De-coupling helps to isolate the tests and make the tests more stabler
and independent from external objects.
@roli2py
roli2py requested a review from MarkKoz August 29, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No "wrong ticks" instruction for one or more identical code blocks with the wrong ticks

2 participants