Skip to content

Failed to run Pytest with parameters #11

@rcourivaud

Description

@rcourivaud

I try running pytest suites but I've an error :

INTERNALERROR>   File "/opt/test-runner/runner/__init__.py", line 50, in pytest_collection_modifyitems
INTERNALERROR>     items.sort(key=_sort_by_lineno)
INTERNALERROR>   File "/opt/test-runner/runner/__init__.py", line 48, in _sort_by_lineno
INTERNALERROR>     return TestOrder.lineno(test_id, source)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/opt/test-runner/runner/sort.py", line 94, in lineno
INTERNALERROR>     return cls._cache[test_id].lineno
INTERNALERROR>            ~~~~~~~~~~^^^^^^^^^
INTERNALERROR> KeyError: 'test_primes.py::test_isprime[prime_case0]'

The tests runs well locally but not with the python-grader. The grader works well with no parametrized pytest function.

I tried everything:

  1. Handle cache (remove, create)
  2. Upgrade pytest, pluggy
  3. Change the pytest parameters definition

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