Repository navigation
Port test suite back to unittest, and fix the easy bitrot - #353
Draft
PhoenixBound wants to merge 1 commit into
Draft
PhoenixBound wants to merge 1 commit into
PhoenixBound wants to merge 1 commit into
Conversation
The original nose is no longer maintained by its maintainers, only nose2. And nose2 renames things to look more like unittest anyway, so we might as well go with something standard. I'm not *against* pytest, but... it was easy to get this to work without a dependency, so why not keep doing things this way? All checks for ROMs are now gated behind checks for the files existing. A few tests are known to fail, due to changes in CoilSnake since the tests were written (mainly block indexing and color conversion). Tests can be run using `python -m unittest discover -s tests`.
This branch has not been deployed
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.
CoilSnake's unit tests were ported from the Python standard library module
unittesttonosepretty early on, in b5e61b0. Nose has received no commits in 10 years and has this written on its home page:So I didn't try installing nose or getting the existing test suite to work as-is, and decided to port it to one of the listed options.
Nose2 uses slightly different function names than the original Nose (
snake_casenames becomecamelCasenames), and its documentation and maintainers generally recommend switching to other, more popular frameworks. Unittest is a bit verbose, but it's still a fairly mechanical translation from Nose, especially compared to what I've seen of pytest. pytest also has some support for incrementally switching from a unittest-based project if desired. And unittest has the benefit that you don't need to install a third-party dependency. So I went with unittest.Other changes:
There are a few tests that are still failing or misbehaving in nontrivial ways:
test_getitem_sliceandtest_setitem_slicein tests/model/common/test_blocks.py: appears to be a regression from Music support #270, which added support for indexing with negative numbers in slices. It's not just that negative numbers were expected to not work; there's unintuitive behavior going on like0:-1becoming0:len(x)-1and grabbing a non-empty sequence.EbColor.from_list, as part of town map bug fixes in CoilSnake 2.3; once in 3c1f732 specifically forEbColor.from_yml_rep, as a hack after many image-related problem reports with CoilSnake 2.3; and once in Fix palette bug when image file has less than the expected number of colours #260 for all the rest of the functions, which made all the EbColor factory functions consistent by reducing everything to 5 bits on construction. It's probably safe to update the tests here, but I haven't convinced myself of it yetCoilSnake/coilsnake/util/common/project.py
Line 59 in 346cfc7
Tests can be run using
python -m unittest discover -s tests. Marked as a draft for now because of the above issues, and because I haven't updated DEVELOPMENT.md with documentation, or removed references to Nose in setup.py.