pytest-dev / pytest-twisted

test twisted code with pytest
BSD 3-Clause "New" or "Revised" License
46 stars 24 forks source link

become a full package... and `return` not `defer.returnValue()` #184

Closed altendky closed 3 months ago

altendky commented 3 months ago

https://github.com/pytest-dev/pytest-twisted/issues/183

(thanks hynek!)

altendky commented 3 months ago

So the new syntax return something that replaces defer.returnValue(something) is not compatible (at a syntax level) with py2. Probably obvious to those that have thought about the point of defer.returnValue() recently, but I'm being explicit, and had to rediscover this myself. So either we can drop py2, which would presumably not be horrible, or we can have separate files. This could easily be the final straw for py2 support here, but I really prefer having a package instead of a single file anyways so it's kind of an excuse for that transformation.

hynek commented 3 months ago

Given that Twisted has dropped Python 2 forever ago and the older pytest-twisted plugins work with old versions, I see no reasons against dropping everything up to 3.8.

altendky commented 3 months ago

https://github.com/pytest-dev/pytest-twisted#python-2-support-plans

Yeah, it would be quite reasonable to drop py2. Most of this change is just me finally making the project form I prefer. Then a little is py2-compat silliness. If I end up having to monkey around with the duplicated code much then the annoyance will grow on me.