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
Provide a way that we can better rely on pythonlib-juju's signatures to help writing int tests. Ideally would like to rely on pytest-operator and not another library that is wrapped by it
Maybe by exposing a slightly safer ops_test.model/unit/app with some supported usage examples?
The reference docs for pytest-operator are REALLY hard to read, and it's very easy to miss things, could these be improved in a more readable / less manual format?
Issue
When developing integration tests, the current typing implementation doesn't support peeking (in my case, vim.lsp.buf.signature_help() using pyright as the LSP)
This is because of 'challenging' typing from pythonlib-juju
Although tightening up that typing is out of the scope for pytest-operator, the common workflow building int tests looks like:
Type ops_test.model or ops_test.model.applications
Go to the pythonlib-juju source code
Hope you find a usefully named method/attr by scouring the source for juju.applications, juju.unit, juju.model etc (often which does not have types)
Experiment with returned instances with some combination of vars(questionable_object) or dir(questionable_object), all of which takes a lot of time and trial-and-error that don't belong in test-writing
Overall, this makes building integration tests really slow, and more likely to blindly copy code from other examples of charm repos that have done the work already. Not bad on it's own, but probably undesirable.
Examples
Wall of error messages with Pyright
Returned attrs unpeekable
Hard-to-parse References render in GH
The text was updated successfully, but these errors were encountered:
Request
pythonlib-juju
's signatures to help writing int tests. Ideally would like to rely onpytest-operator
and not another library that is wrapped by itops_test.model/unit/app
with some supported usage examples?pytest-operator
are REALLY hard to read, and it's very easy to miss things, could these be improved in a more readable / less manual format?Issue
When developing integration tests, the current typing implementation doesn't support peeking (in my case,
vim.lsp.buf.signature_help()
usingpyright
as the LSP)This is because of 'challenging' typing from
pythonlib-juju
Although tightening up that typing is out of the scope for
pytest-operator
, the common workflow building int tests looks like:ops_test.model
orops_test.model.applications
pythonlib-juju
source codejuju.applications
,juju.unit
,juju.model
etc (often which does not have types)vars(questionable_object)
ordir(questionable_object)
, all of which takes a lot of time and trial-and-error that don't belong in test-writingOverall, this makes building integration tests really slow, and more likely to blindly copy code from other examples of charm repos that have done the work already. Not bad on it's own, but probably undesirable.
Examples
Wall of error messages with Pyright
Returned attrs unpeekable
Hard-to-parse References render in GH
The text was updated successfully, but these errors were encountered: