Split test fixtures by language?
See original GitHub issueI’m working with cltk/cltk/tests/test_tag.py . The setUp
fixture downloads all models for all languages tested in the test case, meaning that for every test function, the system re-downloads everything. This makes running tests slow.
Would it make sense to break the one test case into one per language, so that the fixtures can be specific to the language?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Test Fixtures - Washington
Test fixture can all the language features. – initial, delays, read/write files, etc. Simulation. Test Fixture. (Specification). Circuit Description.
Read more >Split Thread: Fixtures vs Factories in Elixir - Chat / Discussions
Fixtures are a set of data that represents a baseline set of data that covers a large portion of your tests for the...
Read more >Test fixture - Wikipedia
A test fixture is an environment used to consistently test some item, device, or piece of software. Test fixtures can be found when...
Read more >How do I register a language with a test fixture for parser, etc ...
I'm working on migrating my plugin tests from PlatformLiteFixture to the IdeaTestFixtureFactory framework. I have simple platform tests...
Read more >Scenario-Based Unit Testing: Organization - Stack Overflow
While I'm personally not in favor of splitting my fixtures into multiple files, one area I can see this making a lot of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Clement has submitted #814 which adds ON-only tests.
@free-variation Within this Issue, would you like to submit an OE test module?
Also, a question for all: What do you think of the following?
cltk/tests/nlp
cltk/tests/languages
This would be more intuitive to newcomers, I think.
I started writing a long response explaining why I did not like this proposal, however the more I wrote the more intuitive it seemed.
Here is what I like about the current system: the tests mirror the project’s directory structure, eg, anything in
cltk.ner
will be intest_ner.py
. This makes a lot of sense for those developing cross-language functionality.However, for those focusing on one particular language, you’re certainly right that it’s awkward to only need a subset of tests within each models.
In the long run, I think we will need to cater more to the latter (language-specific devs) than the former (cross-language nlp specialists).
Would it be too confusing to have both? For example, retain at least 1 test for each language, for each of the current test modules (say, Latin for test_tagger.py), but also have language-specific modules, too (eg,
test_old_english.py
). This would inevitably lead to some test duplication, however in the case of testing, I might view this as a benefit.On top of this, of course, we are working toward doctests too, which offer good, if sometimes minimal, tests.
BTW:
This is what I do when testing locally. I agree that it’s kinda ugly, however combined with the build server, codecov, and PR review ought to keep us from making mistakes (namely, leaving a large block of test code commented out).
Unless there are strong objections to this three-pronged testing methodology (dir-level; module-level; and doctests), I am open to moving ahead. @todd-cook You can be a sanity check – do you think this is crazy?
@free-variation Between you, @Sedictious, and @clemsciences there are enough Old English examples, I imagine, to give this a shot. You like to try?