datasette/tests
Simon Willison e8625695a3
xfail documentation unit tests for view classes, refs #299
More documentation unit tests. These ones check that every single **View class
imported into the datasette/app.py module are covered by our documentation.

Just one problem: they aren't documented yet. So I'm using the xfail pytest
decorator to mark these tests as allowed-to-fail. When you run the test suite
you now get a report of how many views still need to be documented, but it
doesn't fail the tests.

The output looks something like this:

    $ pytest tests/test_docs.py
    collected 31 items

    tests/test_docs.py ..........................XXXxx.                [100%]

    ============ 26 passed, 2 xfailed, 3 xpassed in 1.06 seconds ============

Once I have documented all the views I will remove the xfail so any future
views that are added without documentation will cause a test failure.

We can detect that a view is documented by looking for ReST label in the docs,
for example:

    .. _IndexView:

Some view classes can be used to power multiple URLs - the JsonDataView class
for example is used to power /-/metadata and /-/config and /-/plugins

In this case, the second part of the label can indicate the variety of page, e.g:

    .. _JsonDataView_metadata:

The test will pass as long as there is at least one label that starts with
_JsonDataView.
2018-07-27 20:13:26 -07:00
..
__init__.py Broke up test_app into test_api and test_html 2017-12-15 04:08:24 -08:00
fixtures.py ?_json_infinity=1 for handling Infinity/-Infinity - fixes #332 2018-07-23 20:07:57 -07:00
test_api.py ?_json_infinity=1 for handling Infinity/-Infinity - fixes #332 2018-07-23 20:07:57 -07:00
test_csv.py CSV export now respects --cors, fixes #326 2018-06-23 17:59:37 -07:00
test_docs.py xfail documentation unit tests for view classes, refs #299 2018-07-27 20:13:26 -07:00
test_html.py URLify URLs in custom SQL queries, closes #298 2018-07-23 20:56:32 -07:00
test_inspect.py Renamed test_tables.db to fixtures.db in unit tests 2018-06-17 11:34:16 -07:00
test_plugins.py Renamed test_tables.db to fixtures.db in unit tests 2018-06-17 11:34:16 -07:00
test_publish_heroku.py Unit tests for publish now/heroku - closes #348 2018-07-25 22:45:47 -07:00
test_publish_now.py Unit tests for publish now/heroku - closes #348 2018-07-25 22:45:47 -07:00
test_utils.py Fixed incorrect display of compound primary keys with foreign key references 2018-06-21 07:56:28 -07:00