Defines a context manager to be used in case a shared YCM state between subtests is to be avoided, as could be the case with completion caching.
( custom_options = {} )
| 136 | |
| 137 | @contextlib.contextmanager |
| 138 | def youcompleteme_instance( custom_options = {} ): |
| 139 | """Defines a context manager to be used in case a shared YCM state |
| 140 | between subtests is to be avoided, as could be the case with completion |
| 141 | caching.""" |
| 142 | with UserOptions( custom_options ): |
| 143 | ycm = YouCompleteMe() |
| 144 | WaitUntilReady() |
| 145 | try: |
| 146 | test_utils.VIM_PROPS_FOR_BUFFER.clear() |
| 147 | yield ycm |
| 148 | finally: |
| 149 | StopServer( ycm ) |