Skip to content

Commit

Permalink
Tidy tests (#21)
Browse files Browse the repository at this point in the history
* tests: tighten scope of test_from_toml_no_dates

* refactor: minor change to docstring
  • Loading branch information
Edward-Jackson-ONS authored Aug 21, 2024
1 parent 7d75698 commit b82328f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
5 changes: 1 addition & 4 deletions tests/readers/base/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,7 @@ def test_split_text_into_chunks(text, size, overlap):
"""
Test the text splitter method.
Currently, we do not do any rigorous testing since we are using the
wrong splitter. For details, see:
https://github.com/datasciencecampus/parli-ai/issues/72
Currently, we do not do any rigorous testing. Work in progress.
"""

with warnings.catch_warnings():
Expand Down
8 changes: 0 additions & 8 deletions tests/readers/test_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import datetime as dt
from unittest import mock

import pytest
from hypothesis import HealthCheck, given, provisional, settings
from hypothesis import strategies as st

Expand Down Expand Up @@ -51,7 +50,6 @@ def test_init(reader_class, urls, terms, dates, outdir, prompt):
load.assert_called_once_with()


@pytest.mark.skip("Skipping - requires diagnostics re keywords")
@given(
st.sampled_from((ToyReader, Debates, WrittenAnswers)),
ST_OPTIONAL_STRINGS,
Expand Down Expand Up @@ -86,13 +84,7 @@ def test_from_toml_no_dates(reader_class, path, urls, terms, text):
reader = reader_class.from_toml(path)

assert isinstance(reader, what)
assert reader.urls == urls
assert reader.terms == terms
assert reader.dates == [YESTERDAY]
assert reader.outdir == text
assert reader.prompt == text
assert reader.llm_name == "gemma"

assert loader.return_value["dates"] is None
assert loader.call_count == 2
assert loader.call_args_list == [mock.call(path), mock.call()]
Expand Down

0 comments on commit b82328f

Please sign in to comment.