-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Draft test example. #27
Conversation
@dahlb please a look if you like this approach, and we can make adjustments before I farm this out to testing real devices. |
it looks promising and does a nice job of mocking the api in a simple way. I'm new to the unittest package, but I found this https://docs.python.org/3/library/unittest.html which suggests replacing |
This is where pytest kicks in -- when we run unittests with pytest as the test driver, then pytest replaces stock assert function to include the context of the current running test as well the values of the expression nodes (just like self.assert* do). Another advantage of pytest as the test driver is that we are not writing the |
I was able to use the stock version with
without adding any main stuff, but pytest didn't work in my virtual env, I'll try to look at test harness choices tonight along with a github hook for running them |
I am using the home assistant core env if that helps. If we will use the
unittest driver (e.g pytest doesn’t work for you) I think we shall stick
with the unittest syntax for assertions.
…On Tue, Dec 10, 2024 at 11:24 AM Bren Dahl ***@***.***> wrote:
I was able to use the stock version with
python3 -m unittest tests/*.py
without adding any *main* stuff, but pytest didn't work in my virtual
env, I'll try to look at test harness choices tonight along with a github
hook for running them
—
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABBWTDPFQRLXZB6VDOXYFD2E45VPAVCNFSM6AAAAABTEB4TAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZSGY3TGNRYGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I figured out my env issue and got pytest working, just need to find a github hook to use |
I think we just add a new github workflow (forking lint.yaml). |
For coverage on all of the attribute setters and the translation from info dict to the attributes.
ff4470a
to
561a965
Compare
Apparently I cannot trigger it. I think it is also missing a pip install -e .
For coverage on all of the attribute setters and the translation from info dict to the attributes.
#25