-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add type hints to test_framework (#1025)
* Change the type of `Handle`'s `key` (in `__init__` and `nest()` and the property) to explicitly allow `None * Add a CHANGES.md file to document changes (backfilled only to 2.7) * Tidy up the type hinting of `BoundStoredState.__getattr__` - multiple overloads need to be provided, and once that's done the ignores can be removed (and a bunch of type issues in the tests get resolved) * Ignore type where creating an object that's only partially complete, but the test only requires that much and fully creating it would be a lot of extra code for no real gain * Where's it's simple to do, pass the required attributes rather than `None` * Ignore types where we're checking handling of invalid types * Add casts around the very dynamic snapshot/restore functionality * For a couple of the "list of test cases" situations, move the documentation of what each element in the test case is to a new type definition that covers both what was there before and the (rough) expected type * Sprinkle type hints where required for pyright to be happy Partially addresses #1007
- Loading branch information
1 parent
d8827e0
commit 2794449
Showing
4 changed files
with
220 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 2.8.0 | ||
|
||
* The type of a `Handle`'s `key` was expanded from `str` to `str|None` | ||
|
||
# 2.7.0 | ||
|
||
* Added Unit.set_ports() | ||
* Type checks now allow comparing a `JujuVersion` to a `str` | ||
* Renamed `OpenPort` to `Port` (`OpenPort` remains as an alias) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.