From: Cooper Lees Date: Sun, 17 May 2020 19:18:49 +0000 (-0700) Subject: Add black-primer unittests (#1426) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/8acc22f11480dab297ad31fa80fa63bea15066c6?hp=8acc22f11480dab297ad31fa80fa63bea15066c6 Add black-primer unittests (#1426) * Add black-primer unittests - Get this tool covered with some decent unittests for all unittests wins - Have a CLI and lib test class - Import it from `test_black.py` so we always run tests - Revert typing asyncio.Queue as Queue[str] so we can work in 3.6 - **mypy**: Until black > 3.6 disallow_any_generics=False for primer code Test: - Run tests: `coverage run tests/test_primer.py` or `coverage run -m unittest` ``` (b) cooper-mbp1:black cooper$ coverage report Name Stmts Miss Cover --------------------------------------------- src/black_primer/cli.py 49 8 84% src/black_primer/lib.py 148 28 81% tests/test_primer.py 114 1 99% --------------------------------------------- TOTAL 311 37 88% ``` * Use ProactorEventLoop for Windows + fix false path for Linux * Set Windows to use ProactorEventLoop in to benefit all callers * sys.platform seems to not having the loop applied - So type ignore and use platform.system() gate * Have each test loop correctly set to ProactorEventLoop on Windows for < 3.8 too ---