-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime type checking decorator implemented and tested for rdf api
- Loading branch information
Showing
8 changed files
with
44 additions
and
49 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
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,3 @@ | ||
import os | ||
|
||
os.environ['PQANALYSIS_BEARTYPE_LEVEL'] = "RELEASE" |
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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
import pytest | ||
|
||
from PQAnalysis.analysis.rdf.api import rdf | ||
from PQAnalysis.type_checking import _get_type_error_message | ||
|
||
from .. import pytestmark # pylint: disable=unused-import | ||
from ...conftest import assert_logging | ||
from ...conftest import assert_logging_with_exception | ||
|
||
|
||
class TestRDFAPI: | ||
def test_wrong_param_types(self, caplog): | ||
assert_logging( | ||
assert_logging_with_exception( | ||
caplog=caplog, | ||
logging_name=rdf.__name__, | ||
logging_name="TypeChecking", | ||
logging_level="ERROR", | ||
message_to_test="Input file must be a string", | ||
message_to_test=_get_type_error_message( | ||
"input_file", 1, str, | ||
), | ||
exception=TypeError, | ||
function=rdf, | ||
input_file=1, | ||
) |
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