-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Test Refactor #8185
Copy link
Copy link
Labels
Contribution wantedLow risknice-to-have featuresnice-to-have featuresenhancementNew feature or requestNew feature or requestrefactorNon-breaking feature enhancementsNon-breaking feature enhancements
Metadata
Metadata
Labels
Contribution wantedLow risknice-to-have featuresnice-to-have featuresenhancementNew feature or requestNew feature or requestrefactorNon-breaking feature enhancementsNon-breaking feature enhancements
The
testsdirectory has gotten large over time as we've added new components with their test cases. It's absolutely a good thing to have thorough testing but as a almost-flat directory it's hard to find things and it's cumbersome to view so many files in IDEs. Further there are likely many areas of refactoring that we can do to reduce duplicate code and introduce more helper routines to do common tasks. I would suggest a few things to improve our tests:testsinto subdirectories mirroring those in themonaidirectory. Tests for transforms would go undertransforms, those for networks undernetworks, etc. It may be necessary to have more directory structure under these as well but this doesn't need to be overcomplicated.parameterizedin deeply-nested for loops, eg.:A simple routine for doing product over dictionaries can reduce this code significantly: