feat: built-in testing module (PyNestTestingModule + TestBed) (#118)#136
Open
ItayTheDar wants to merge 1 commit into
Open
feat: built-in testing module (PyNestTestingModule + TestBed) (#118)#136ItayTheDar wants to merge 1 commit into
ItayTheDar wants to merge 1 commit into
Conversation
…Nest#118) Adds nest.testing — a first-class testing toolkit modeled after @nestjs/testing and Suites: - PyNestTestingModule.create_testing_module(imports/controllers/providers) with fluent TestingModuleBuilder - override_provider(token).use_value/.use_class/.use_factory - override_guard(Guard).use_value/.use_class (patches applied only during route registration, restored immediately — no state leaks between tests) - use_auto_mock(): replaces class providers with create_autospec mocks (async methods become AsyncMocks), with exclude= and mock_factory= - TestingModule.get/init/close, awaitable compile(), async context manager - create_http_client() (httpx ASGITransport), create_test_client(), create_nest_application() - TestBed.solitary/sociable with .mock().using/.final and expose() for Suites-style unit tests without a container - PyNestContainer.replace_provider() + provider_descriptors hook - pynest-api[testing] extra (httpx); pytest-asyncio added to test group - docs/testing.md with pytest fixture patterns; 35 new tests Closes PythonNest#118 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds nest.testing — a first-class testing toolkit modeled after @nestjs/testing and Suites:
Closes #118