Drop use of libcst.testing.*
Summary
In order to upgrade pyre I'd like to stop using libcst.testing.utils.data_provider and use parameterized instead
The former attempts to typecheck the decorator input against the test method, but currently that is not possible in python's type system.
This is a large change w/ no functional difference. I used this codemod to convert all the tests: https://gist.github.com/lpetre/05b729a0891427c2a9def8d1eda3153d
I've changed from this:
from libcst.testing.utils import data_provider, UnitTest
class FooTest(UnitTest):
@data_provider({"name": {"keyword": "value"}})
def test(self, *, keyword: str) -> None:
pass
To this equivalent in parameterized:
import unittest
from parameterized import param, parameterized
class FooTest(unittest.TestCase):
@parameterized([param("name", **{"keyword": "value"})])
def test(self, _name:str, keyword: str) -> None:
pass
Test Plan
python -m unittest
Codecov Report
:exclamation: No coverage uploaded for pull request base (
main@cebf376). Click here to learn what that means. The diff coverage isn/a.
@@ Coverage Diff @@
## main #207 +/- ##
=======================================
Coverage ? 86.15%
=======================================
Files ? 91
Lines ? 3755
Branches ? 0
=======================================
Hits ? 3235
Misses ? 520
Partials ? 0
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update cebf376...e4a0570. Read the comment docs.
Maybe add a type stub for parameterized, so pyre doesn't complain about a missing expand function?
Hey there! We appreciate your contributions, but we're in the process of making some large changes to the core of Fixit. We will try to have more info about the direction we're heading soon, but in the mean time, we are closing all outstanding PR's from before we started this work. Thank you for your understanding.