Skip to content

Commit 43f423b

Browse files
authored
Merge branch 'master' into master
2 parents 4d46121 + 7a47e70 commit 43f423b

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ recursive-include pylatex *.py
33
recursive-include python2_source/pylatex *.py
44
include versioneer.py
55
include examples/kitten.jpg
6+
include examples/sample-logo.png

pylatex/base_classes/containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from __future__ import annotations
99

1010
from collections import UserList
11+
from collections.abc import Generator
1112
from contextlib import contextmanager
1213
from typing import TypeVar
13-
from collections.abc import Generator
1414

1515
from pylatex.utils import dumps_list
1616

tests/test_tabular.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env python
2+
import os.path as osp
23

3-
from pylatex import Document, Section, Tabular, MultiColumn, StandAloneGraphic
4+
from pylatex import Document, MultiColumn, Section, StandAloneGraphic, Tabular
45

56
# This file contains function that test several Tabular related functionality.
67

78

8-
def test_tabular_can_add_row_passing_many_arguments(sample_logo_path):
9+
def test_tabular_can_add_row_passing_many_arguments():
910
"""
1011
Test that Tabular can add a row as described in the function body:
1112
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):
1617
1718
"""
1819
doc = Document()
20+
sample_logo_path = osp.join(__file__[0:-15], "..", "examples", "sample-logo.png")
1921

2022
with doc.create(Section("Can Add Row Passing Many Arguments")):
2123
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):
3032
doc.generate_pdf(clean_tex=False)
3133

3234

33-
def test_tabular_can_add_row_passing_iterable(sample_logo_path):
35+
def test_tabular_can_add_row_passing_iterable():
3436
"""
3537
Test that Tabular can add a row as described in the function body:
3638
The second method
@@ -44,6 +46,7 @@ def test_tabular_can_add_row_passing_iterable(sample_logo_path):
4446
"""
4547
doc = Document()
4648

49+
sample_logo_path = osp.join(__file__[0:-15], "..", "examples", "sample-logo.png")
4750
with doc.create(Section("Can Add Row Passing Iterable")):
4851
with doc.create(Tabular("|c|c|", booktabs=True)) as table:
4952
multi_columns_array = [
@@ -57,14 +60,3 @@ def test_tabular_can_add_row_passing_iterable(sample_logo_path):
5760

5861
table.add_row(multi_columns_array)
5962
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

Comments
 (0)