# Path: test/_common.py
# def print_test_result(expected, actual, error=None):
#     print(f"[expected]\n{expected}\n")
#     print(f"[actual]\n{actual}\n")
# 
#     if error:
#         print(error, file=sys.stderr)
# 
#     print("----------------------------------------")
# 
# Path: test/data.py
# TIME = datetime.datetime(2017, 1, 1, 0, 0, 0)
# INF = float("inf")
# NAN = float("nan")


import collections
import os
import sys
import pytest
import pytablewriter as ptw
    import pandas as pd
from decimal import Decimal
from tabledata import TableData
from ..._common import print_test_result
from ...data import headers, value_matrix
        writer.write_table()

        print(expected, file=sys.stderr)

        actual = ptw.PandasDataFramePickleWriter()
        actual.from_dataframe(pd.read_pickle(test_filepath))
        actual.table_name = expected.table_name

        print_test_result(
            expected=ptw.dumps_tabledata(expected), actual=ptw.dumps_tabledata(actual.tabledata)
        )

        assert ptw.dumps_tabledata(actual.tabledata) == ptw.dumps_tabledata(expected)

    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],
        [[data.table, data.header, data.value, data.expected] for data in empty_test_data_list],
    )
    def test_smoke_empty(self, tmpdir, table, header, value, expected):
        test_filepath = str(tmpdir.join("empty.pkl"))
        writer = ptw.PandasDataFramePickleWriter(
            table_name=table, headers=header, value_matrix=value
        )
        writer.open(test_filepath)
        writer.write_table()
        assert not os.path.isfile(test_filepath)

    def test_exception(self):
        writer = ptw.PandasDataFramePickleWriter(
            table_name="tablename",

# Path: test/_common.py
# def print_test_result(expected, actual, error=None):
#     print(f"[expected]\n{expected}\n")
#     print(f"[actual]\n{actual}\n")
# 
#     if error:
#         print(error, file=sys.stderr)
# 
#     print("----------------------------------------")
# 
# Path: test/data.py
# TIME = datetime.datetime(2017, 1, 1, 0, 0, 0)
# INF = float("inf")
# NAN = float("nan")


# Path: test/writer/binary/test_pandas_writer.py
import collections
import os
import sys
import pytest
import pytablewriter as ptw
    import pandas as pd
from decimal import Decimal
from tabledata import TableData
from ..._common import print_test_result
from ...data import headers, value_matrix

        writer.write_table()

        print(expected, file=sys.stderr)

        actual = ptw.PandasDataFramePickleWriter()
        actual.from_dataframe(pd.read_pickle(test_filepath))
        actual.table_name = expected.table_name

        print_test_result(
            expected=ptw.dumps_tabledata(expected), actual=ptw.dumps_tabledata(actual.tabledata)
        )

        assert ptw.dumps_tabledata(actual.tabledata) == ptw.dumps_tabledata(expected)

    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],
        [[data.table, data.header, data.value, data.expected] for data in empty_test_data_list],
    )
    def test_smoke_empty(self, tmpdir, table, header, value, expected):
        test_filepath = str(tmpdir.join("empty.pkl"))
        writer = ptw.PandasDataFramePickleWriter(
            table_name=table, headers=header, value_matrix=value
        )
        writer.open(test_filepath)
        writer.write_table()
        assert not os.path.isfile(test_filepath)

    def test_exception(self):
        writer = ptw.PandasDataFramePickleWriter(
            table_name="tablename",

            headers=["ha", "hb", "hc"],