Skip to content

Commit

Permalink
Add missing attrs.converters/filters, fortify type tests (#931)
Browse files Browse the repository at this point in the history
Fixes #930
  • Loading branch information
hynek committed Mar 14, 2022
1 parent 2a703cc commit 83d91b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/attrs/__init__.pyi
Expand Up @@ -23,13 +23,15 @@ from attr import __version_info__ as __version_info__
from attr import _FilterType
from attr import assoc as assoc
from attr import Attribute as Attribute
from attr import converters as converters
from attr import define as define
from attr import evolve as evolve
from attr import Factory as Factory
from attr import exceptions as exceptions
from attr import Factory as Factory
from attr import field as field
from attr import fields as fields
from attr import fields_dict as fields_dict
from attr import filters as filters
from attr import frozen as frozen
from attr import has as has
from attr import make_class as make_class
Expand Down
28 changes: 12 additions & 16 deletions tests/typing_example.py
Expand Up @@ -394,27 +394,23 @@ class MatchArgs2:
attrs.astuple(MatchArgs2(1, 2))


def importing_from_attr() -> None:
def accessing_from_attr() -> None:
"""
Use a function to keep the ns clean.
"""
from attr.converters import optional
from attr.exceptions import FrozenError
from attr.filters import include
from attr.setters import frozen
from attr.validators import and_
attr.converters.optional
attr.exceptions.FrozenError
attr.filters.include
attr.setters.frozen
attr.validators.and_

assert optional and FrozenError and include and frozen and and_


def importing_from_attrs() -> None:
def accessing_from_attrs() -> None:
"""
Use a function to keep the ns clean.
"""
from attrs.converters import optional
from attrs.exceptions import FrozenError
from attrs.filters import include
from attrs.setters import frozen
from attrs.validators import and_

assert optional and FrozenError and include and frozen and and_
attrs.converters.optional
attrs.exceptions.FrozenError
attrs.filters.include
attrs.setters.frozen
attrs.validators.and_

0 comments on commit 83d91b2

Please sign in to comment.