-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: ✅ rework tests to not start otel by default
- Loading branch information
1 parent
20fb2fc
commit 9dbb512
Showing
5 changed files
with
36 additions
and
10 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 |
---|---|---|
|
@@ -12,3 +12,6 @@ application: | |
plugins: | ||
activate: | ||
- opentelemetry_plugin | ||
|
||
opentelemetry: | ||
activate: true |
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,25 @@ | ||
"""The test class TestExampleClassParent is a test class for the class App.""" | ||
|
||
import injector | ||
|
||
from python_factory.core.plugins.opentelemetry_plugin.configs import OpenTelemetryConfig | ||
from python_factory.example import App, AppModule, application_factory | ||
|
||
|
||
class TestExampleClassParent: | ||
"""The test class for the class App.""" | ||
|
||
def binder_configure(self, binder: injector.Binder) -> None: | ||
"""Configure the binder for the test.""" | ||
binder.bind( | ||
interface=OpenTelemetryConfig, to=OpenTelemetryConfig(activate=False) | ||
) | ||
|
||
def application_factory_for_test(self) -> App: | ||
"""Create an application for testing.""" | ||
injector_instance = injector.Injector() | ||
injector_instance.binder.install(module=AppModule) | ||
self.binder_configure(injector_instance.binder) | ||
application: App = application_factory(injector_instance=injector_instance) | ||
|
||
return application |
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