<commit_before># coding: utf-8
import pytest

import astropy.units as u

from poliastro import plotting
from poliastro.plotting import OrbitPlotter


def test_OrbitPlotter_has_axes():
    ax = "Unused axes"
    op = OrbitPlotter(ax)
    assert op.ax is ax


def test_set_frame_raises_error_if_frame_exists():
    op = OrbitPlotter()
    p = [1, 0, 0] * u.one
    q = [0, 1, 0] * u.one
    w = [0, 0, 1] * u.one
    op.set_frame(p, q, w)
    with pytest.raises(NotImplementedError):
        op.set_frame(p, q, w)
<commit_msg>Fixed matplotlib-related tests Travis CI doesn't have X server.<commit_after># coding: utf-8
import pytest

import astropy.units as u

import matplotlib
matplotlib.use("Agg", warn=False) # use Agg backend for these tests

from poliastro import plotting
from poliastro.plotting import OrbitPlotter


def test_OrbitPlotter_has_axes():
    ax = "Unused axes"
    op = OrbitPlotter(ax)
    assert op.ax is ax


def test_set_frame_raises_error_if_frame_exists():
    op = OrbitPlotter()
    p = [1, 0, 0] * u.one
    q = [0, 1, 0] * u.one
    w = [0, 0, 1] * u.one
    op.set_frame(p, q, w)
    with pytest.raises(NotImplementedError):
        op.set_frame(p, q, w)

{'fraction_non_alphanumeric': 0.10886075949367088, 'fraction_numerical': 0.016877637130801686, 'mean_word_length': 3.360294117647059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4018620', 'n_tokens_mistral': 489, 'n_tokens_neox': 457, 'n_words': 128}