hgrecco / pint-pandas

Pandas support for pint
Other
166 stars 40 forks source link

ruff now rejects importing pytest fixtures (as_frame) #193

Closed MichaelTiemannOSC closed 1 year ago

MichaelTiemannOSC commented 1 year ago

I pushed some changes for a pull request after successfully running the test suite. I was able to fix up black's preferences for spacing and indentation, but not able to make ruff happy. The ruff team pointed me at this issue, which cites the fact that pytest prefers using contest.py to share fixtures between modules, rather than using python imports:

https://github.com/astral-sh/ruff/issues/4046

I'm a total pytest novice so I don't have an opinion. But if the ruff developers won't fix it, my PR (https://github.com/hgrecco/pint-pandas/pull/140) will be stalled until something outside my control changes: the test_pandas_exceptiontests.py prologue, ruff, or the CI/CD rules that pint-pandas uses.

Help!

hgrecco commented 1 year ago

You can use # noqa (see here) for the time being.

MichaelTiemannOSC commented 1 year ago

I mistakenly put the F811 on the wrong line (because the error was not reported with a line number in the error text, and I conflated two things). With the F811 on the correct line, it passes ruff.