lightly-ai / lightly-ai/lightly
Cleanup Tests
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 367
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 5
Description
## Description
The goal is to:
* Rename test files to match package file structure
* Move all tests to pytest format
* Split subtests into individual tests or use pytest.mark.parametrize
* Move tests for classes into classes and tests for functions into functions. For example:
```
class TestClassName:
def test_method(self) -> None:
assert ClassName().method() == something
def test_function() -> None:
assert module.function() == something
```
In this issue we don't care about the api tests. They are handled in a different project.
For outdated/deprecated modules, such as active learning, we should keep the effort minimal. I would suggest to only make the test filenames match the package file structure. But not change the tests themselves.
See https://github.com/lightly-ai/lightly/blob/master/tests/models/modules/test_memory_bank.py for an example test file.
## Tasks
- [ ] Cleanup tests for the lightly/transforms subpackage
- [ ] Cleanup tests for the lightly/loss subpackage
- [ ] Cleanup tests for the lightly/models/modules subpackage
- [ ] Cleanup tests for lightly/models/utils.py
- [ ] Rename test files for models in lightly/models subpackage
- [ ] Cleanup tests for the lightly/data subpackage
- [ ] Cleanup tests for the lightly/embedding subpackage
- [ ] Cleanup tests for lightly/utils subpackage
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the example at tests/models/modules/test_memory_bank.py, then inspect the test files for one listed subpackage and compare them with the corresponding lightly package structure. Done means the listed test areas are renamed and converted to pytest style as appropriate, with classes, functions, and parametrized cases organized as described; leave API tests out and keep outdated modules to filename changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100