test_install   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_initialize_autocomplete_runs_without_readline() 0 8 2
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