Skip to content

Convert pubchem_test.py to use plain pytest instead of unittest#1278

Merged
mhucka merged 1 commit intoquantumlib:mainfrom
mhucka:avoid-unittest-in-pubchem
Apr 23, 2026
Merged

Convert pubchem_test.py to use plain pytest instead of unittest#1278
mhucka merged 1 commit intoquantumlib:mainfrom
mhucka:avoid-unittest-in-pubchem

Conversation

@mhucka
Copy link
Copy Markdown
Contributor

@mhucka mhucka commented Apr 23, 2026

The failures in CI of the tests may be due to the use of the old Python unittest framework. This PR avoids the use of unittest in that file.

The failures in CI of the tests may be due to the use of the old Pyton
unittest framework. This PR avoids the use of `unittest` in that file.
@mhucka mhucka changed the title Avoid unittest Convert pubchem_test.py to use plain pytest instead of unittest Apr 23, 2026
@mhucka mhucka marked this pull request as ready for review April 23, 2026 18:48
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the pubchem_test.py file to transition from the unittest framework to pytest. Key changes include converting the test class to a standard Python class, replacing @patch decorators with the monkeypatch fixture, and updating unittest assertion methods to standard assert statements and pytest.approx. I have no feedback to provide as there are no review comments to evaluate.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the src/openfermion/chem/pubchem_test.py file to migrate from the unittest framework to pytest. Key changes include converting the test class to a standard Python class, replacing unittest.mock.patch decorators with the monkeypatch fixture, and updating unittest assertion methods to standard assert statements and pytest.approx. I have no feedback to provide as there were no review comments.

@mhucka mhucka added this pull request to the merge queue Apr 23, 2026
Merged via the queue into quantumlib:main with commit 0ec18cc Apr 23, 2026
18 checks passed
@mhucka mhucka deleted the avoid-unittest-in-pubchem branch April 23, 2026 21:02
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