internetarchive icon indicating copy to clipboard operation
internetarchive copied to clipboard

mypy: `nasa_item()` is defined twice in `tests/conftest.py`

Open cclauss opened this issue 2 years ago • 1 comments

Pytest fixture/function nasa_item() is defined twice in tests/conftest.py. Both flake8 and mypy complain. Is this intended? I believe that the last one wins.

https://github.com/jjjake/internetarchive/blob/master/tests/conftest.py#L117-L137

@JustAnotherArchivist

cclauss avatar Apr 25 '22 07:04 cclauss

I believe that the last one wins.

Probably, but I'm not sure what pytest does internally exactly. The tests don't directly reference the nasa_item function, that's filled in by pytest at runtime via name matching (so it depends on how it keeps track of the fixtures internally). I've never been a fan of that, and this is a good example why.

Introduced by 2f927ca7, by the way.

JustAnotherArchivist avatar Apr 25 '22 17:04 JustAnotherArchivist