Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF authored Jul 23, 2024
2 parents 4d46121 + 7a47e70 commit 43f423b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ recursive-include pylatex *.py
recursive-include python2_source/pylatex *.py
include versioneer.py
include examples/kitten.jpg
include examples/sample-logo.png
2 changes: 1 addition & 1 deletion pylatex/base_classes/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from __future__ import annotations

from collections import UserList
from collections.abc import Generator
from contextlib import contextmanager
from typing import TypeVar
from collections.abc import Generator

from pylatex.utils import dumps_list

Expand Down
20 changes: 6 additions & 14 deletions tests/test_tabular.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python
import os.path as osp

from pylatex import Document, Section, Tabular, MultiColumn, StandAloneGraphic
from pylatex import Document, MultiColumn, Section, StandAloneGraphic, Tabular

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


def test_tabular_can_add_row_passing_many_arguments(sample_logo_path):
def test_tabular_can_add_row_passing_many_arguments():
"""
Test that Tabular can add a row as described in the function body:
The first method is to pass the content of each cell as a separate argument.
Expand All @@ -16,6 +17,7 @@ def test_tabular_can_add_row_passing_many_arguments(sample_logo_path):
"""
doc = Document()
sample_logo_path = osp.join(__file__[0:-15], "..", "examples", "sample-logo.png")

with doc.create(Section("Can Add Row Passing Many Arguments")):
with doc.create(Tabular("|c|c|", booktabs=True)) as table:
Expand All @@ -30,7 +32,7 @@ def test_tabular_can_add_row_passing_many_arguments(sample_logo_path):
doc.generate_pdf(clean_tex=False)


def test_tabular_can_add_row_passing_iterable(sample_logo_path):
def test_tabular_can_add_row_passing_iterable():
"""
Test that Tabular can add a row as described in the function body:
The second method
Expand All @@ -44,6 +46,7 @@ def test_tabular_can_add_row_passing_iterable(sample_logo_path):
"""
doc = Document()

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

table.add_row(multi_columns_array)
doc.generate_pdf()


if __name__ == "__main__":
import os.path as osp

sample_logo_path = osp.abspath(
osp.join(__file__[0:-15], "..", "examples", "sample-logo.png")
)

test_tabular_can_add_row_passing_many_arguments(sample_logo_path=sample_logo_path)
test_tabular_can_add_row_passing_iterable(sample_logo_path=sample_logo_path)

0 comments on commit 43f423b

Please sign in to comment.