Skip to content

Quick fixes of some unit tests#748

Merged
digicosmos86 merged 4 commits intomainfrom
747-fix-one-unit-test
Jul 1, 2025
Merged

Quick fixes of some unit tests#748
digicosmos86 merged 4 commits intomainfrom
747-fix-one-unit-test

Conversation

@digicosmos86
Copy link
Copy Markdown
Collaborator

One unit test starts to fail possibly because of how the new numpy handles print output. This PR fixes this and suppresses a few DeprecationWarnings that will become SyntaxErrors in Python 3.12

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes test failures caused by updated NumPy string representations and suppresses upcoming DeprecationWarnings by converting NumPy arrays to Python lists.

  • Updated regex patterns in unit tests to use raw strings, escaping backslashes correctly
  • Converted NumPy array slices to lists in data_validator.py to avoid deprecated behaviors

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/param/test_user_param.py Switched regex matches to raw strings for backslash-safe patterns
tests/param/test_param.py Same raw-string update for regex in bounds validation tests
src/hssm/data_validator.py Changed array slicing results to list conversions (.tolist)
Comments suppressed due to low confidence (1)

src/hssm/data_validator.py:100

  • NumPy arrays use .tolist() instead of .to_list(). Please change .to_list() to .tolist() for correct list conversion.
                np.setdiff1d(self.choices, unique_responses).to_list()

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/hssm/data_validator.py 97.61% <100.00%> (ø)
src/hssm/prior.py 89.18% <100.00%> (ø)
tests/param/test_param.py 100.00% <100.00%> (ø)
tests/param/test_user_param.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@AlexanderFengler AlexanderFengler left a comment

Choose a reason for hiding this comment

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

lgtm!

@digicosmos86 digicosmos86 merged commit 8340797 into main Jul 1, 2025
5 checks passed
@digicosmos86 digicosmos86 deleted the 747-fix-one-unit-test branch February 10, 2026 15:58
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.

Fix: one unit test that is failing now possibly due to dependency updates

3 participants