<commit_before>import inspect
import ispyb.api.main
import pkgutil
import pytest

@pytest.mark.incremental
class TestAPIDocumentation(object):
  def test_create_main_api_object(self):
    ispyb.api.main.API()

  def test_that_all_public_api_functions_are_documented(self):
    apiobj = ispyb.api.main.API()
    function_names = dir(apiobj)
    public_fn_names = filter(lambda name: not name.startswith('_'),
                             function_names)
    undocumented_functions = \
        filter(lambda name: not inspect.getdoc(getattr(apiobj, name)),
               public_fn_names)
    assert undocumented_functions == []<commit_msg>clearer error message for undocumented API calls<commit_after>import inspect
import ispyb.api.main
import pkgutil
import pytest

@pytest.mark.incremental
class TestAPIDocumentation(object):
  def test_create_main_api_object(self):
    ispyb.api.main.API()

  def test_that_all_public_api_functions_are_documented(self):
    apiobj = ispyb.api.main.API()
    function_names = dir(apiobj)
    public_fn_names = filter(lambda name: not name.startswith('_'),
                             function_names)
    for function in public_fn_names:
      assert inspect.getdoc(getattr(apiobj, function)), \
          "The API call %s is not documented." % function
{'fraction_non_alphanumeric': 0.08682170542635659, 'fraction_numerical': 0.0, 'mean_word_length': 3.728937728937729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7576077', 'n_tokens_mistral': 408, 'n_tokens_neox': 399, 'n_words': 82}