def test_pytest_collection_finish_test_execution_factory_injection_enabled_with_patched_pytest( self, terminal_writer_mock: mock.MagicMock, getoption_mock: ConfigGetOptionMock, test_pytest_bdd_session: Session, patched_hook_test_execution_proxy_manager: IProxyManager, ) -> None: pytest_configure(test_pytest_bdd_session.config) pytest_collection_finish(test_pytest_bdd_session) assert terminal_writer_mock.call_count == 1 assert not patched_hook_test_execution_proxy_manager.collection_prepared
def test_pytest_configure_disabled_options( self, terminal_writer_mock: mock.MagicMock, test_prepared_config: Config, patched_hook_test_execution_proxy_manager: IProxyManager, ) -> None: pytest_configure(test_prepared_config) assert test_prepared_config.getoption( _OptionName.ENABLE_INJECTION.as_variable) is False terminal_writer_mock.assert_called_once() assert not patched_hook_test_execution_proxy_manager.pytest_patched
def test_pytest_configure_disabled_injection( self, test_prepared_config: Config, getoption_mapping: Mapping[str, Any], getoption_mock: ConfigGetOptionMock, patched_hook_test_execution_proxy_manager: IProxyManager, ) -> None: assert test_prepared_config.getoption( _OptionName.ENABLE_INJECTION.as_variable) is getoption_mapping.get( _OptionName.ENABLE_INJECTION.as_variable) pytest_configure(test_prepared_config) assert not patched_hook_test_execution_proxy_manager.pytest_patched
def test_pytest_configure_failed_no_option( self, test_empty_config: Config) -> None: with pytest.raises(ValueError, match="no option named"): pytest_configure(test_empty_config)