1
1
#!/usr/bin/env python
2
+ import os .path as osp
2
3
3
4
from pylatex import Document , MultiColumn , Section , StandAloneGraphic , Tabular
4
5
5
6
# This file contains function that test several Tabular related functionality.
6
7
7
8
8
- def test_tabular_can_add_row_passing_many_arguments (sample_logo_path ):
9
+ def test_tabular_can_add_row_passing_many_arguments ():
9
10
"""
10
11
Test that Tabular can add a row as described in the function body:
11
12
The first method is to pass the content of each cell as a separate argument.
@@ -16,6 +17,7 @@ def test_tabular_can_add_row_passing_many_arguments(sample_logo_path):
16
17
17
18
"""
18
19
doc = Document ()
20
+ sample_logo_path = osp .join (__file__ [0 :- 15 ], ".." , "examples" , "sample-logo.png" )
19
21
20
22
with doc .create (Section ("Can Add Row Passing Many Arguments" )):
21
23
with doc .create (Tabular ("|c|c|" , booktabs = True )) as table :
@@ -30,7 +32,7 @@ def test_tabular_can_add_row_passing_many_arguments(sample_logo_path):
30
32
doc .generate_pdf (clean_tex = False )
31
33
32
34
33
- def test_tabular_can_add_row_passing_iterable (sample_logo_path ):
35
+ def test_tabular_can_add_row_passing_iterable ():
34
36
"""
35
37
Test that Tabular can add a row as described in the function body:
36
38
The second method
@@ -44,6 +46,7 @@ def test_tabular_can_add_row_passing_iterable(sample_logo_path):
44
46
"""
45
47
doc = Document ()
46
48
49
+ sample_logo_path = osp .join (__file__ [0 :- 15 ], ".." , "examples" , "sample-logo.png" )
47
50
with doc .create (Section ("Can Add Row Passing Iterable" )):
48
51
with doc .create (Tabular ("|c|c|" , booktabs = True )) as table :
49
52
multi_columns_array = [
@@ -57,14 +60,3 @@ def test_tabular_can_add_row_passing_iterable(sample_logo_path):
57
60
58
61
table .add_row (multi_columns_array )
59
62
doc .generate_pdf ()
60
-
61
-
62
- if __name__ == "__main__" :
63
- import os .path as osp
64
-
65
- sample_logo_path = osp .abspath (
66
- osp .join (__file__ [0 :- 15 ], ".." , "examples" , "sample-logo.png" )
67
- )
68
-
69
- test_tabular_can_add_row_passing_many_arguments (sample_logo_path = sample_logo_path )
70
- test_tabular_can_add_row_passing_iterable (sample_logo_path = sample_logo_path )
0 commit comments