Skip to content

Repetitive loadconstants #1443

@ivanistheone

Description

@ivanistheone

Summary

If we cd to contentcuration and run pytest -s (to show stdout) we see hundreds of

***** Loading Constants *****
Site: 3 constants saved (2 new)
License: 9 constants saved (9 new)
ContentKind: 7 constants saved (7 new)
FileFormat: 14 constants saved (14 new)
FormatPreset: 22 constants saved (22 new)
Language: 248 constants saved (248 new)
************ DONE. ************

Category

Select one: TEST PERF

How to reproduce

# yarn run services in one tab
# in another tab
pipenv shell
cd contentcuration
pytest -s

Potential fix

replace https://github.com/learningequality/studio/blob/develop/contentcuration/contentcuration/tests/base.py#L47-L50
and https://github.com/learningequality/studio/blob/develop/contentcuration/contentcuration/tests/base.py#L80-L82 etc

with somethin like setUpModule and tearDownModule:
https://docs.python.org/3/library/unittest.html#setupmodule-and-teardownmodule

Real-life consequences

Tests will run a little faster on devs' machines and in CI.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions