test_initialize_autocomplete_runs_without_readline()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
from unittest import mock
2
import pytest
3
import sys
4
5
6
@pytest.mark.filterwarnings(
7
    "ignore:.*imp module is deprecated.*"
8
)  # ansiwrap spits out an unrelated warning
9
def test_initialize_autocomplete_runs_without_readline():
10
    from jrnl import install
11
12
    with mock.patch.dict(sys.modules, {"readline": None}):
13
        install._initialize_autocomplete()  # should not throw exception
14