You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
slack-annotations doesn't have any unittests: when you run make test (which is an alias for tox, which is an alias for tox -e tests) or when you open a PR and CI runs on GitHub Actions, it runs the tests in tests/unit/slack_annotations/ but those consist of only a couple of placeholder tests:
There's test_help() and test_version(). These are actually real unit tests for the --help and --version command-line arguments, but nothing else in cli.py is tested.
And there's test_it() which is just a placeholder test for core.py.
It would be good to fill this out with proper unittests.
Note that slack-annotations makes HTTP requests to the Hypothesis API. We don't want it to make real HTTP requests when you run the functests. Since slack-annotations uses HTTPX to send HTTP requests we may be able to use something like pytest-httpx or respx.
Note: it's okay to use some # pragma: no cover's to get make test coverage to pass if there are some parts of the code that are too awkward or not worthwhile to write tests for. Our approach to unittests is that we enforce 100% coverage but are pragmatic about using # pragma: no cover to get there if necessary.
Note: the code in this project was hacked together without a lot of care. You might find that you have to refactor it in order to make it unit-testable. You might find it helpful to write functests first (there's a separate issue for those: #7) as these will enable large-scale refactorings with confidence.
The text was updated successfully, but these errors were encountered:
slack-annotations doesn't have any unittests: when you run
make test
(which is an alias fortox
, which is an alias fortox -e tests
) or when you open a PR and CI runs on GitHub Actions, it runs the tests intests/unit/slack_annotations/
but those consist of only a couple of placeholder tests:test_help()
andtest_version()
. These are actually real unit tests for the--help
and--version
command-line arguments, but nothing else incli.py
is tested.test_it()
which is just a placeholder test forcore.py
.It would be good to fill this out with proper unittests.
Note that slack-annotations makes HTTP requests to the Hypothesis API. We don't want it to make real HTTP requests when you run the functests. Since slack-annotations uses HTTPX to send HTTP requests we may be able to use something like pytest-httpx or respx.
Done when
# pragma: nocover
incli.py
has been removed# pragma: no cover
incore.py
has been removedmake test coverage
(which will enforce 100% unittest coverage) is passingNote: it's okay to use some
# pragma: no cover
's to getmake test coverage
to pass if there are some parts of the code that are too awkward or not worthwhile to write tests for. Our approach to unittests is that we enforce 100% coverage but are pragmatic about using# pragma: no cover
to get there if necessary.Note: the code in this project was hacked together without a lot of care. You might find that you have to refactor it in order to make it unit-testable. You might find it helpful to write functests first (there's a separate issue for those: #7) as these will enable large-scale refactorings with confidence.
The text was updated successfully, but these errors were encountered: