Skip to content

Conversation

@PicoCentauri
Copy link
Collaborator

@PicoCentauri PicoCentauri commented Jan 8, 2026

We are using pytest for testing but still the testsuite uses the unittest style. Moving it to pytest makes sense also in the light of fixing #279 as handling warnings is nice in pytest.

As this is a very monotonic job, I mostly vibecoded this with Copilot based on Sonnet 4.5. To help Copilot, I created an instruction file with some useful tricks on how to work on the repo.

Besides, I also cleaned up the tests:

  • use np.testing instead of concatenating assert and numpy functions
  • if we use pytest.raises() we always match against the specific error message to avoid test passing if a wrong error is raised.

I don't expect a line by line review for this PR. What I did and I also would do for a review is to check example conversations of some tests. Copilot had especially problems with test_kernel_pcovc.py and test_pcovc.py...

@PicoCentauri PicoCentauri changed the title Convert unittest to real pytests Convert testfiles from unittest to pytests Jan 9, 2026
@cajchristian
Copy link
Collaborator

These changes look good. I also gave the PCovC/R and KCPovC/R tests a deeper look through, and everything looks great. Can you also update contributing.rst?

Copy link
Collaborator

@cajchristian cajchristian left a comment

Choose a reason for hiding this comment

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

Thanks!

@PicoCentauri PicoCentauri merged commit b56516c into main Jan 13, 2026
10 checks passed
@PicoCentauri PicoCentauri deleted the pytest-tests branch January 13, 2026 17:35
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.

3 participants