7
7
8
8
from subprocess import call , Popen , PIPE
9
9
10
- from nose import SkipTest
11
- from nose . tools import assert_true
10
+ import pytest
11
+
12
12
13
13
HERE = dirname (__file__ )
14
14
TINY_PAGES = pjoin (HERE , 'tinypages' )
@@ -19,7 +19,7 @@ def setup_module():
19
19
try :
20
20
ret = call (['sphinx-build' , '--help' ], stdout = PIPE , stderr = PIPE )
21
21
except OSError :
22
- raise SkipTest ('Need sphinx-build on path for these tests' )
22
+ pytest . skip ('Need sphinx-build on path for these tests' )
23
23
if ret != 0 :
24
24
raise RuntimeError ('sphinx-build does not return 0' )
25
25
@@ -60,29 +60,29 @@ def teardown_class(cls):
60
60
shutil .rmtree (cls .page_build )
61
61
62
62
def test_some_plots (self ):
63
- assert_true ( isdir (self .html_dir ) )
63
+ assert isdir (self .html_dir )
64
64
65
65
def plot_file (num ):
66
66
return pjoin (self .html_dir , 'some_plots-{0}.png' .format (num ))
67
67
68
68
range_10 , range_6 , range_4 = [plot_file (i ) for i in range (1 , 4 )]
69
69
# Plot 5 is range(6) plot
70
- assert_true ( file_same (range_6 , plot_file (5 ) ))
70
+ assert file_same (range_6 , plot_file (5 ))
71
71
# Plot 7 is range(4) plot
72
- assert_true ( file_same (range_4 , plot_file (7 ) ))
72
+ assert file_same (range_4 , plot_file (7 ))
73
73
# Plot 11 is range(10) plot
74
- assert_true
B7B5
( file_same (range_10 , plot_file (11 ) ))
74
+ assert file_same (range_10 , plot_file (11 ))
75
75
# Plot 12 uses the old range(10) figure and the new range(6) figure
76
- assert_true ( file_same (range_10 , plot_file ('12_00' ) ))
77
- assert_true ( file_same (range_6 , plot_file ('12_01' ) ))
76
+ assert file_same (range_10 , plot_file ('12_00' ))
77
+ assert file_same (range_6 , plot_file ('12_01' ))
78
78
# Plot 13 shows close-figs in action
79
- assert_true ( file_same (range_4 , plot_file (13 ) ))
79
+ assert file_same (range_4 , plot_file (13 ))
80
80
# Plot 14 has included source
81
81
with open (pjoin (self .html_dir , 'some_plots.html' ), 'rb' ) as fobj :
82
82
html_contents = fobj .read ()
83
- assert_true ( b'# Only a comment' in html_contents )
83
+ assert b'# Only a comment' in html_contents
84
84
# check plot defined in external file.
85
- assert_true ( file_same (range_4 , pjoin (self .html_dir , 'range4.png' ) ))
86
- assert_true ( file_same (range_6 , pjoin (self .html_dir , 'range6.png' ) ))
85
+ assert file_same (range_4 , pjoin (self .html_dir , 'range4.png' ))
86
+ assert file_same (range_6 , pjoin (self .html_dir , 'range6.png' ))
87
87
# check if figure caption made it into html file
88
- assert_true ( b'This is the caption for plot 15.' in html_contents )
88
+ assert b'This is the caption for plot 15.' in html_contents
0 commit comments