/
__init__.py
63 lines (49 loc) · 1.76 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# tests
# Testing package for the yellowbrick visualization library.
#
# Author: Rebecca Bilbro <rbilbro@districtdatalabs.com>
# Created: Wed May 18 10:48:46 2016 -0400
#
# Copyright (C) 2016 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: __init__.py [0c5ba04] benjamin@bengfort.com $
"""
Testing package for the yellowbrick visualization library.
"""
##########################################################################
## Imports
##########################################################################
import matplotlib
## IMPORTANT! Set matplotlib to use the Agg backend before imported anywhere!
matplotlib.use("Agg")
##########################################################################
## Test Constants
##########################################################################
EXPECTED_VERSION = "1.2.1"
##########################################################################
## Initialization Tests
##########################################################################
class TestInitialization(object):
def test_sanity(self):
"""
Test that tests work by confirming 7-3 = 4
"""
assert 7 - 3 == 4, "The world went wrong!!"
def test_import(self):
"""
Assert that the yellowbrick package can be imported.
"""
try:
import yellowbrick
except ImportError:
self.fail("Could not import the yellowbrick library!")
def test_version(self):
"""
Assert that the test version matches the library version.
"""
try:
import yellowbrick as yb
assert yb.__version__ == EXPECTED_VERSION
except ImportError:
self.fail("Could not import the yellowbrick library!")