Skip to content

Unify Testdata Path Computation #146

@bmerkle

Description

@bmerkle

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:

  1. Relative to test file (all test_*.py files)
  2. Hardcoded relative to CWD (query.py and server.py... and also test_transripts.py)
  3. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions