Skip to content

Commit

Permalink
test: use non-interactive plotting backend (#138)
Browse files Browse the repository at this point in the history
The use of a non-interactive plotting backend prevents plots from being
displayed in pop-up windows while running tests. The tests would
previously block when a plot was displayed until the user closed it.

Resolves #31
  • Loading branch information
mbelak-dtml authored Sep 20, 2023
1 parent 5703186 commit e83c9e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import warnings

import matplotlib.pyplot as plt

# switch matplotlib backend to non-Gui, preventing plots being displayed
plt.switch_backend("Agg")
# suppress UserWarning that the current backend cannot show plots
warnings.filterwarnings("ignore", "Matplotlib is currently using agg")

0 comments on commit e83c9e9

Please sign in to comment.