Skip to content

Commit

Permalink
beartype.door API tests x 5.
Browse files Browse the repository at this point in the history
This commit is the next in a commit chain repairing currently failing
tests pertaining to the `beartype.door` subpackage, recently implemented
by Harvard microscopist and general genius @tlambert03 in PR #136.
Specifically, this commit:

* Declares a new `beartype.roar.BeartypeDoorNonpepException` type,
  raised when the `beartype.roar.TypeHint` constructor is passed an
  object that is *not* a PEP-compliant type hint currently supported by
  the DOOR API.
* Extricates the `beartype.door._doorcls.is_subclass()` and
  `beartype.door._doorcls.die_unless_typehint()` functions into a new
  `beartype.door._doortest` submodule for maintainability.
* Folds the prior `test_typehint_fail()` unit test into the existing
  `test_typehint_new()` unit test.

(*Thunderous blunderbuss!*)
  • Loading branch information
leycec committed Jul 12, 2022
1 parent 45f9f27 commit 2a9bf72
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 248 deletions.
4 changes: 3 additions & 1 deletion beartype/door/__init__.py
Expand Up @@ -4,7 +4,7 @@
# See "LICENSE" for further details.

'''
**Beartype Decidedly Object-Orientedly Recursive (DOOR) API.**
**Beartype Decidedly Object-Oriented Runtime-checking (DOOR) API.**
This subpackage provides an object-oriented type hint class hierarchy,
encapsulating the crude non-object-oriented type hint declarative API
Expand All @@ -23,5 +23,7 @@
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
from beartype.door._doorcls import (
TypeHint as TypeHint,
)
from beartype.door._doortest import (
is_subhint as is_subhint,
)

0 comments on commit 2a9bf72

Please sign in to comment.