Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): category_test teardown order fix.
The error occurs during the teardown phase when the test tries to delete categories that reference terms that have already been deleted. Here's the relevant part of the error: python Copy code E AttributeError: 'NoneType' object has no attribute 'title_group' sefaria/model/schema.py:220: AttributeError This suggests that library.get_term(self.sharedTitle) is returning None, and the code attempts to access term.title_group, resulting in an AttributeError. The root cause is likely that the terms are being deleted before the categories that reference them during teardown. This can happen due to the order in which pytest tears down fixtures, especially when using scope='module' and autouse=True. Change the scope to 'function' to ensure that it's torn down after create_new_cats.
- Loading branch information