-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
We found out that Testdata Path Computation needs to be improved a bit:
I think it makes sense to introduce a small utility method to have one place where we compute the test location files.
Maybe a fixture that computes the path of testdata? Or even several for the paths of commonly used test data files?
Currently we have three patterns:
- Relative to test file (all test_*.py files)
- Hardcoded relative to CWD (query.py and server.py... and also test_transripts.py)
- Relative to script dir (ingest_podcast.py)
I would refactor this, to fix the duplication and inconsistency. The implementation approach would use:
- pytest fixture (adding code and info to conftest.py)
- compute the testdata_path in only one place
- provide used test files as constants
My question is:
- how should we deal with non test scripts (like query.py or server.py)
- or better why does the production code like server.py include testdata at all, and wouldnt it be better to change the code of server.py to NOT contain any reference to test data
what do you think @gvanrossum ?
Metadata
Metadata
Assignees
Labels
No labels