Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop 79 character line length limit in docs tests #6892

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,10 @@ class TestDocSnippets(unittest.TestCase):
* all source code in "code-block" directives is parsed to
check that the syntax is valid;

* lines must be shorter than 79 characters;

* any ReST warnings (like improper headers or broken indentation)
are reported as errors.
"""

MAX_LINE_LEN = 79

CodeSnippet = collections.namedtuple(
'CodeSnippet',
['filename', 'lineno', 'lang', 'code'])
Expand Down Expand Up @@ -146,11 +142,6 @@ def extract_code_blocks(self, source: str, filename: str):
f'Mismatched lint-on/lint-off in '
f'{filename}, line {lineno}')

if len(line) > self.MAX_LINE_LEN and lint_on:
reporter.lint_errors.add(
f'Line longer than {self.MAX_LINE_LEN} characters in '
f'{filename}, line {lineno}')

if not lint_on:
reporter.lint_errors.add(
f'Unexpected EOF. No closing \'.. lint-on\' found in '
Expand Down Expand Up @@ -449,19 +440,6 @@ def test_doc_test_broken_code_block_02(self):
with self.assertRaisesRegex(AssertionError, 'unable to parse edgeql'):
self.run_block_test(blocks[0])

@unittest.skipIf(docutils is None, 'docutils is missing')
def test_doc_test_broken_long_lines(self):
source = f'''
aaaaaa aa aaa:
- aaa
- {'a' * self.MAX_LINE_LEN}
- aaa
'''

with self.assertRaisesRegex(self.RestructuredTextStyleError,
r'lint errors:[.\s]*Line longer'):
self.extract_code_blocks(source, '<test>')

@unittest.skipIf(docutils is None, 'docutils is missing')
def test_doc_test_bad_header(self):
source = textwrap.dedent('''
Expand Down