mozilla / frost

Unit testing framework for test driven security of AWS, GCP, Heroku and more.
https://mozilla.github.io/frost/
Mozilla Public License 2.0
104 stars 24 forks source link

Make sure all test id's are reproducible #417

Closed ajvb closed 3 years ago

ajvb commented 3 years ago

Fixes the ids argument in all parameterize calls that make use of zip() so that the outputted id is actually generated.

Fixes #412

hwine commented 3 years ago

Not sure how hard it was to make all these changes, but since we're using tests as code maybe we should look into tools for editing the concrete syntax tree (e.g. something based on https://pypi.org/project/libcst/ or another library I couldn't dig up).

You lost me -- what's the maintenance issue you see (i.e. use case), and how would libcst solve that?

g-k commented 3 years ago

Not sure how hard it was to make all these changes, but since we're using tests as code maybe we should look into tools for editing the concrete syntax tree (e.g. something based on https://pypi.org/project/libcst/ or another library I couldn't dig up).

You lost me -- what's the maintenance issue you see (i.e. use case), and how would libcst solve that?

Safely editing a bunch of test and resource files e.g. converting all str.format calls to f-strings https://libcst.readthedocs.io/en/latest/codemods_tutorial.html

hwine commented 3 years ago

You lost me -- what's the maintenance issue you see (i.e. use case), and how would libcst solve that?

Safely editing a bunch of test and resource files e.g. converting all str.format calls to f-strings https://libcst.readthedocs.io/en/latest/codemods_tutorial.html

Ah, there's a pre-commit plugin for that (and more): pyupgrade. Besides fstrings, it also catches other python changes that the code can take advantages of. See the README

I'd be happy to see that plugin added to frost -- it'll help when we have to go to python 3.9 (yearly updates now). I think all of it's changes should be a separate PR for a "flag day", so we can all do our merges-for-active-branches prior, and have that change apply cleanly.