| Conditions | 4 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import json |
||
| 11 | @pytest.fixture |
||
| 12 | def vim(): |
||
| 13 | child_argv = os.environ.get('NVIM_CHILD_ARGV') |
||
| 14 | listen_address = os.environ.get('NVIM_LISTEN_ADDRESS') |
||
| 15 | if child_argv is None and listen_address is None: |
||
| 16 | child_argv = '["nvim", "-u", "NONE", "--embed", "--headless"]' |
||
| 17 | |||
| 18 | if child_argv is not None: |
||
| 19 | editor = pynvim.attach('child', argv=json.loads(child_argv)) |
||
| 20 | else: |
||
| 21 | editor = pynvim.attach('socket', path=listen_address) |
||
| 22 | |||
| 23 | return editor |
||
| 24 |