hypothesis / hypothesis/h

Resources refactoring

Open
#5,015 1 comment 0 reactions 1 assignee Claimed by @seanh View on GitHub
code health refactoring
Dominant language
Python
Stars
3.2k
Forks
459
Avg merge
27d 1h
Merged PRs (30d)
1

Description

Notes https://slack-files.com/T03QZM0HN-FA511033L-69dc4d7561

- [x] Move all factories into resources.py
- [x] Split resources.py into traversal/roots.py and traversal.contexts.py
- [x] Rename all "factories" to "roots"
- [x] Rename all "resources" to "contexts"
- [x] Docstrings
- [ ] All roots should return contexts, not models
- [ ] Roots should call model classes or services to do DB queries, not do them themselves
- [ ] Some views can be simplified by using contexts
- [ ] Grep the code for "resource". In some places (e.g. variable names, test class names) we're still calling things "resources" that are now called "contexts"
- [ ] Context classes are being used in the tests for various other modules. They should be mocked.
- [ ] Fix `roots_test.py` and `contexts_test.py`. Looks like there might be some bad stuff in there. E.g. I see a `FakeGroup` class.
- [ ] Write an ADR

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.