betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
562 stars 61 forks source link

No obvious way to react to parametrized fixtures deprecation warning #164

Open khardix opened 5 years ago

khardix commented 5 years ago

Each time I use the betamax_parametrized_session fixture, I'm getting a DeprecationWarning about their behaviour becoming default in 1.0. However, there is no straightforward way to react to those warnings -- switching to the betamax_session breaks the parametrization support (and gives me another warning about it).

My current workaround involves filtering these warnings to not clutter my test outputs. If this is the "correct" way to handle those, I think it should at least be documented as such (and I volunteer for writing that piece). Otherwise, there should be (ideally future-proof) way of getting parametrized fixtures without warning.

One suggestion I can think of is getting rid of the warning for now, until 1.0 comes. At that point, make the switch of betamax_session to parametrized, and provide betamax_parametrized_session as deprecated alias (in other words, add a reworded warning back). Apply the same process to *_recorder. In further future version (2.0? 1.x?), drop the aliases.

hroncok commented 5 years ago

See also: https://github.com/betamaxpy/betamax/pull/113#issuecomment-239221670 (and further)

khardix commented 5 years ago

Reading the linked PR, I understand that 1.0 is the target release for dropping the _parametrized versions/names. In that case, I would still like to see a transitory period when both names are available, although parametrized is deprecated, i.e.: