-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
244 additions
and
2 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,62 @@ | ||
<!-- | ||
A new scriv changelog fragment. | ||
Uncomment the section that is right (remove the HTML comment wrapper). | ||
--> | ||
|
||
<!-- | ||
### Removed | ||
- A bullet item for the Removed category. | ||
--> | ||
### Added | ||
|
||
- [attrs](https://www.attrs.org/en/stable/index.html) can now contain unmanaged values | ||
|
||
``` python | ||
import datetime as dt | ||
import uuid | ||
import attrs | ||
from dirty_equals import IsDatetime | ||
from inline_snapshot import Is, snapshot | ||
|
||
|
||
@attrs.define | ||
class Attrs: | ||
ts: dt.datetime | ||
id: uuid.UUID | ||
|
||
|
||
def test(): | ||
id = uuid.uuid4() | ||
|
||
assert Attrs(dt.datetime.now(), id) == snapshot( | ||
Attrs(ts=IsDatetime(), id=Is(id)) | ||
) | ||
``` | ||
|
||
<!-- | ||
### Changed | ||
|
||
- A bullet item for the Changed category. | ||
|
||
--> | ||
<!-- | ||
### Deprecated | ||
|
||
- A bullet item for the Deprecated category. | ||
|
||
--> | ||
<!-- | ||
### Fixed | ||
|
||
- A bullet item for the Fixed category. | ||
|
||
--> | ||
<!-- | ||
### Security | ||
|
||
- A bullet item for the Security category. | ||
|
||
--> |
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
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