generated from dataforgoodfr/d4g-project-template
-
Notifications
You must be signed in to change notification settings - Fork 10
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
1 parent
799c0c7
commit 23b5851
Showing
4 changed files
with
13 additions
and
8 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .tracer import Tracer, TracerInitializationError | ||
from .tracer import Tracer | ||
|
||
__all__ = ["Tracer", "TracerInitializationError"] | ||
__all__ = ["Tracer"] |
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,6 @@ | ||
class GenAIImpactError(Exception): | ||
pass | ||
|
||
class TracerInitializationError(GenAIImpactError): | ||
"Tracer is initialized twice" | ||
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
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,6 +1,7 @@ | ||
import pytest | ||
from genai_impact import Tracer, TracerInitializationError | ||
from genai_impact import Tracer | ||
from genai_impact.exceptions import GenAIImpactError | ||
|
||
def test_double_init(tracer_init): | ||
with pytest.raises(TracerInitializationError) as e: | ||
with pytest.raises(GenAIImpactError) as e: | ||
Tracer.init() # Second initialization |