Skip to content

Fix unit tests for the analysis module#36

Merged
p-j-smith merged 2 commits intomainfrom
paul/fix-test-imports
Aug 14, 2025
Merged

Fix unit tests for the analysis module#36
p-j-smith merged 2 commits intomainfrom
paul/fix-test-imports

Conversation

@p-j-smith
Copy link
Copy Markdown
Collaborator

Fixes #30

The tests for the analysis module were broken because the module isn't installed in the virtual environment when installing the pyonb package.

  • move the analysis module into pyonb.analysis
  • update docs to reflect the move

Running pytest tests/analysis/test_eval_ocr.py now passes:

Test output
===================================================== test session starts =====================================================
platform darwin -- Python 3.13.1, pytest-8.4.1, pluggy-1.6.0 -- /Users/paul/git/safehr/pyonb/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/paul/git/safehr/pyonb
configfile: pyproject.toml
plugins: anyio-4.9.0, cov-6.2.1
collected 2 items

tests/analysis/test_eval_ocr.py::test_read_file PASSED                                                                  [ 50%]
tests/analysis/test_eval_ocr.py::test_evaluate_metrics PASSED                                                           [100%]

====================================================== 2 passed in 0.07s ======================================================

Copy link
Copy Markdown
Collaborator

@tomaroberts tomaroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely stuff, thanks Paul. Please merge.

@p-j-smith p-j-smith merged commit 4845baa into main Aug 14, 2025
3 checks passed
@tomaroberts tomaroberts deleted the paul/fix-test-imports branch August 21, 2025 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve pathing around unit testing

2 participants