pkw,
@pkw@mastodon.sdf.org avatar

#python fixture config is magic and I don't like it.

def test_something(fixture):
...

So in pytest. What this does is get the name of the param fixture to see if it matches the name of a previously defined fixture function. If you don't know that it looks bizarre. That IS NOT a parameter passed into a function but a sentinel that is used to look up a fixture by it's parameter name.

WHY not just pass in the ACTUAL FIXTURE ?!?!

def test_something(fixtures=[fixture1, fixture2]):
...

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • magazineikmin
  • rosin
  • Youngstown
  • ngwrru68w68
  • khanakhh
  • slotface
  • InstantRegret
  • mdbf
  • GTA5RPClips
  • kavyap
  • thenastyranch
  • DreamBathrooms
  • everett
  • tacticalgear
  • JUstTest
  • tester
  • Durango
  • cubers
  • ethstaker
  • cisconetworking
  • modclub
  • osvaldo12
  • Leos
  • normalnudes
  • megavids
  • provamag3
  • anitta
  • lostlight
  • All magazines