-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exception Handling - Created custom exception classes (#50)
* Add base exceptions for error handling * update pyright version for pipeline * reformatting for black * using ParsingError + unit tests * type stub for pytest * Fixed pyright errors with pytest + formatting for black * Renamed DeserializationError Co-authored-by: Yefri Gaitan <yefrigaitan@gmail.com>
- Loading branch information
Showing
5 changed files
with
92 additions
and
31 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
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,34 @@ | ||
""" | ||
This type stub file was generated by pyright. | ||
""" | ||
|
||
from _pytest import __version__ | ||
from _pytest.assertion import register_assert_rewrite | ||
from _pytest.compat import _setup_collect_fakemodule | ||
from _pytest.config import ExitCode, UsageError, cmdline, hookimpl, hookspec, main | ||
from _pytest.debugging import pytestPDB as __pytestPDB | ||
from _pytest.fixtures import fillfixtures as _fillfuncargs, fixture, yield_fixture | ||
from _pytest.freeze_support import freeze_includes | ||
from _pytest.main import Session | ||
from _pytest.mark import MARK_GEN as mark, param | ||
from _pytest.nodes import Collector, File, Item | ||
from _pytest.outcomes import exit, fail, importorskip, skip, xfail | ||
from _pytest.python import Class, Function, Instance, Module, Package | ||
from _pytest.python_api import approx, raises | ||
from _pytest.recwarn import deprecated_call, warns | ||
from _pytest.warning_types import ( | ||
PytestAssertRewriteWarning, | ||
PytestCacheWarning, | ||
PytestCollectionWarning, | ||
PytestConfigWarning, | ||
PytestDeprecationWarning, | ||
PytestExperimentalApiWarning, | ||
PytestUnhandledCoroutineWarning, | ||
PytestUnknownMarkWarning, | ||
PytestWarning, | ||
) | ||
|
||
""" | ||
pytest: unit and functional testing with Python. | ||
""" | ||
set_trace = __pytestPDB.set_trace |
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,8 @@ | ||
""" | ||
This type stub file was generated by pyright. | ||
""" | ||
|
||
""" | ||
pytest entry point | ||
""" | ||
if __name__ == "__main__": ... |
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,16 @@ | ||
class VolgaError(Exception): | ||
"""Base class for all volga-related errors.""" | ||
|
||
pass | ||
|
||
|
||
class DeserializationError(VolgaError): | ||
"""Raised during serialization errors when parsing or building object instances.""" | ||
|
||
pass | ||
|
||
|
||
class ParsingError(VolgaError): | ||
"""Raised during deserialization errors when parsing object instances.""" | ||
|
||
pass |
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