File size: 727 Bytes
3ec98e7 ff055eb 3ec98e7 ff055eb 3ec98e7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import pytest
import pandas as pd
import unittest
from result_data_processor import ResultDataProcessor
import os
class TestRegression(unittest.TestCase):
def test_data_output_is_the_same(self):
df_current = ResultDataProcessor().data
# load the reference dataframe
last_commit = os.popen('git rev-parse HEAD').read().strip()
print(last_commit)
reference_file = f'output_{last_commit}.parquet'
df_reference = pd.read_parquet(reference_file)
# Compare DataFrames, allowing for some tolerance in floating-point comparisons
pd.testing.assert_frame_equal(df_current, df_reference, check_dtype=True, atol=1e-5)
if __name__ == '__main__':
unittest.main() |