pytest-dev / pytest-random-order

pytest plugin to randomise the order of tests with some control over the randomness
MIT License
67 stars 10 forks source link

process_failed_first_last_failed → NotImplementedError #41

Open Natim opened 4 years ago

Natim commented 4 years ago

I often encounter this exception, especially when I previously ran pytest and a syntax error prevented it to run.

File "/usr/local/lib/python3.7/site-packages/random_order/plugin.py", line 60, in pytest_collection_modifyitems
INTERNALERROR>     process_failed_first_last_failed(session, config, items)
INTERNALERROR>   File "/usr/local/lib/python3.7/site-packages/random_order/cache.py", line 28, in process_failed_first_last_failed
INTERNALERROR>     raise NotImplementedError()
INTERNALERROR> NotImplementedError
jbasko commented 4 years ago

1) Do you have a name of the test that caused this? 2) Is that a method in a test class or a plain test function?

I'm asking because the issue is to do with the parsing of the name of the failed test in the cache plugin's lastfailed.

Natim commented 4 years ago

Oh interesting. Let me dig that information for you.

Natim commented 4 years ago

Is it possible that it is the case when pytest is run on tests that don't include the file in question? I run pytest 3 times in a raw and I have the issue if pytest is ran without the erroneous file.

jbasko commented 4 years ago

I just tried removing the test or test module that has last failed and then running with --last-failed and was not able to reproduce the error. If you could edit locally that raise NotImplementedError() line to include more information that would help. It's my bad to raise such an uninformative exception.

ssbarnea commented 1 year ago

Today I found the same bug on a project but it happened only once, very weird.