Yelp / fuzz-lightyear

A pytest-inspired, DAST framework, capable of identifying vulnerabilities in a distributed, micro-service ecosystem through chaos engineering testing and stateful, Swagger fuzzing.
Other
205 stars 25 forks source link

cache fixture results per sequence, clearing the cache at the end #14

Closed acoover closed 4 years ago

acoover commented 5 years ago

fixes #13

acoover commented 5 years ago

This change removes the ability to override dependency injection for fixtures by providing explicit values for parameters. @domanchi can you provide some clarity on the motivation behind that functionality?

domanchi commented 5 years ago

@acoover: when I envisioned this tool, I imagined fixtures being flexible enough to exist with other helper functions. This means that it supports manual fixture invocations (e.g. if you wanted to specify a precise value, or use it just as another factory to create data).

I don't think our internal use of this tool requires this manual invocation though.

acoover commented 4 years ago

@acoover: when I envisioned this tool, I imagined fixtures being flexible enough to exist with other helper functions. This means that it supports manual fixture invocations (e.g. if you wanted to specify a precise value, or use it just as another factory to create data).

I don't think our internal use of this tool requires this manual invocation though.

The fixture dependency-injection is magical enough that the additionally complexity required to support manual invocation doesn't seem worth the effort. My feeling is that most fixtures will alias other functions which perform the bulk of the work to setup the fixture. That is to say, most fixtures look like this

@fuzz_lightyear.register_factory('foo')
def foo():
   return foo_factory(bar=1)

Allowing foo to be invoked directly is of little value over just invoking the foo_factory method.

As a datapoint, pytest explicitly disallows fixtures to be invoked directly.