Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions adiftools/adifgraph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd

Expand All @@ -7,8 +6,6 @@
except ModuleNotFoundError or ImportError:
from errors import AdifParserError

matplotlib.use('Agg')


def monthly_qso(df, fname):
''' plot monthly QSO '''
Expand Down
16 changes: 16 additions & 0 deletions tests/test_adifgraph.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import importlib

import matplotlib

from adiftools import adiftools
from adiftools import adifgraph

Expand All @@ -18,3 +22,15 @@ def test_band_percentage():
def test_monthly_band_qso():
adifgraph.monthly_band_qso(df, 'tests/monthly_band_qso.png')
assert True


def test_import_does_not_force_matplotlib_backend(monkeypatch):
calls = []

def spy_use(*args, **kwargs):
calls.append((args, kwargs))

monkeypatch.setattr(matplotlib, 'use', spy_use)
importlib.reload(adifgraph)

assert calls == []
Loading