Skip to content

Commit

Permalink
Test case for RST302 Malformed table.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc committed Apr 16, 2021
1 parent 51e8e51 commit 655987b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/RST302/table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""Example with some RST tables.
This file should fail RST validation:
$ flake8 --select RST RST302/table.py
RST302/table.py:18:1: RST302 Malformed table.
RST302/table.py:36:1: RST302 Malformed table.
See below.
""" # noqa: E510


def simple_table(data):
"""Print a simple RST table.
Sample output:
== ====
ID Name
-- ----
01 Paul
02 Peter
-- ----
As you should spot, the table lines are too short
for valid RST.
"""
pass


def grid_table(data):
"""Print an RST grid table.
Sample output:
+--+----+
|ID|Name|
+==+====+
|01|Paul|
|02|Peter|
+--+----+
Again, not quite right.
"""
pass

0 comments on commit 655987b

Please sign in to comment.