Repository navigation
Let other packages use the test fixtures as a pytest plugin - #37
Merged
Merged
Conversation
A package that counts or generates with mapFolding registers
`pytest_plugins = ('mapFolding.tests.conftest',)` and receives the fixtures by name.
- `testing` extra: installs everything `mapFolding.tests` imports, including dulwich, without
which `mapFolding.oeis` cannot be imported. The `testing` group now builds on it.
- Package data: the `.album` and `.pkl` samples in `tests/dataSamples`. Without the `.pkl`
files, the released `getDataFrameFoldings` and the `arrayFoldings` fixture fail outside a checkout.
- `identifiers` fixture: a `Default` whose `pathRoot` is a directory one test owns, changed in
place, so a generator and its entry point write there.
- `argv` fixture removed: the `OEIS_for_n` tests set `sys.argv` with `monkeypatch`.
- README: how to test your own algorithms, and corrected test module names and install command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GMd3z8bGZQ5aV7bsZxiFzi
hunterhogan
marked this pull request as ready for review
November 29, 2026 20:45
main made `dulwich` and `pandas` lazy imports, so the `testing` extra no longer needs `dulwich`. The extra gains `packaging`, which `commandImport` in `conftest.py` imports, and `test_optionalDependencies` checks that the extra lets `mapFolding.tests`, its plugin `conftest.py`, and `conftestAnnex.py` import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GMd3z8bGZQ5aV7bsZxiFzi
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A package that counts or generates with mapFolding can now test its own algorithms with mapFolding's fixtures. It adds
mapFolding[testing]to its testing dependencies and registers the plugin in its rootconftest.py:Changes
testingextra:hypothesis,packaging,pandas,pyarrow,pytest>=9.0, andpytest-xdist. These cover whatmapFolding.testsimports, includingpackaging, whichcommandImportimports. Thepandasandpyarrowentries serve the fixtures that readdataSamples. Since main madedulwichandpandaslazy imports, the extra no longer needsdulwich.testingdependency group now namesmapFolding[testing]instead of repeating the list. I checked that both pip (-e . --group testing) and uv resolve a group that names its own project's extra.test_optionalDependenciesgains atestingrow. It checks thatmapFolding.tests,mapFolding.tests.conftest, andmapFolding.tests.conftestAnneximport afterpip install mapFolding[testing]..albumand.pklfiles intests/dataSamples. The released wheels ship the.pysamples but not these files, sogetDataFrameFoldingsfails outside a checkout, and so do thearrayFoldings,albumKnown, andpathAlbumfixtures. This adds about 600 KB to the wheel.identifiersfixture: given aDefaultthrough indirect parametrization, it points thatDefault'spathRootat a directory that one test owns. The change is made in place withpatch.dictand undone after the test, so it also redirects a generator's entry point that reads the module-levelDefaultand takes no arguments.argvfixture removed: the pytest skill does not allow a general-purposeargvfixture, and shipping one in a public plugin would spread it to other packages.test_OEIS_for_nandtest_OEIS_for_nErrornow setsys.argvwithmonkeypatch.test_algorithms.pyandtest_oeis_byFormula.pydo not exist, and.[development,testing]named extras that are dependency groups.Verification
-n 4. Before this PR the count was 13134; the five additional tests aretest_pyproject.pywith its newtestingrow.pytestandpytest-xdistfrom the extra makes thetestingrow fail. Removing only one of them does not, becausepytest-xdistrequirespytest.dulwich: the plugin loads,expectedandidentifierswork, andgetDataFrameFoldingsreads the packaged.pkl.A release is needed before downstream packages can require this.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GMd3z8bGZQ5aV7bsZxiFzi