deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

deepdiff 7.0.1 test failure in Fedora rawhide with Python 3.13

Open susilehtola opened this issue 1 year ago • 4 comments
trafficstars

Describe the bug Tests fail in Fedora rawhide

=================================== FAILURES ===================================
_ TestCommands.test_diff_command[t1_corrupt.json-t2.json-Expecting property name enclosed in double quotes-1] _
self = <tests.test_command.TestCommands object at 0x3ff2342f750>
t1 = '/builddir/build/BUILD/python-deepdiff-7.0.1-build/deepdiff-7.0.1/tests/fixtures/t1_corrupt.json'
t2 = '/builddir/build/BUILD/python-deepdiff-7.0.1-build/deepdiff-7.0.1/tests/fixtures/t2.json'
expected_in_stdout = 'Expecting property name enclosed in double quotes'
expected_exit_code = 1
    @pytest.mark.parametrize('t1, t2, expected_in_stdout, expected_exit_code', [
        ('t1.json', 't2.json', '"dictionary_item_added": [\n    "root[0]', 0),
        ('t1_corrupt.json', 't2.json', "Expecting property name enclosed in double quotes", 1),
        ('t1.json', 't2_json.csv', '"old_value": "value2"', 0),
        ('t2_json.csv', 't1.json', '"old_value": "value3"', 0),
        ('t1.csv', 't2.csv', '"new_value": "James"', 0),
        ('t1.toml', 't2.toml', "10.0.0.2", 0),
        ('t1.pickle', 't2.pickle', '"new_value": 5,\n      "old_value": 1', 0),
        ('t1.yaml', 't2.yaml', '"new_value": 61,\n      "old_value": 65', 0),
    ])
    def test_diff_command(self, t1, t2, expected_in_stdout, expected_exit_code):
        t1 = os.path.join(FIXTURES_DIR, t1)
        t2 = os.path.join(FIXTURES_DIR, t2)
        runner = CliRunner()
        result = runner.invoke(diff, [t1, t2])
        assert result.exit_code == expected_exit_code
>       assert expected_in_stdout in result.output
E       AssertionError: assert 'Expecting property name enclosed in double quotes' in 'Error when loading t1: Illegal trailing comma before end of object: line 3 column 21 (char 45)\n'
E        +  where 'Error when loading t1: Illegal trailing comma before end of object: line 3 column 21 (char 45)\n' = <Result SystemExit('Error when loading t1: Illegal trailing comma before end of object: line 3 column 21 (char 45)')>.output
tests/test_command.py:29: AssertionError
=============================== warnings summary ===============================
tests/test_serialization.py:341
  /builddir/build/BUILD/python-deepdiff-7.0.1-build/deepdiff-7.0.1/tests/test_serialization.py:341: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    (7, datetime.datetime.utcnow(), datetime.datetime.fromisoformat),
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_command.py::TestCommands::test_diff_command[t1_corrupt.json-t2.json-Expecting property name enclosed in double quotes-1]
============= 1 failed, 904 passed, 10 skipped, 1 warning in 3.07s =============

OS, DeepDiff version and Python version (please complete the following information): deepdiff 7.0.1 on Fedora rawhide

DEBUG util.py:463:   python3-dateutil          noarch 1:2.8.2-16.fc41  build      879.2 KiB
DEBUG util.py:463:   python3-devel             s390x  3.13.0~b4-2.fc41 build        1.8 MiB
DEBUG util.py:463:   python3-jsonpickle        noarch 3.2.2-2.fc41     build      298.4 KiB
DEBUG util.py:463:   python3-numpy             s390x  1:1.26.4-8.fc41  build       41.8 MiB
DEBUG util.py:463:   python3-pydantic          noarch 2.8.2-2.fc41     build        4.3 MiB
DEBUG util.py:463:   python3-pytest            noarch 7.4.3-6.fc41     build        3.6 MiB
DEBUG util.py:463:   python3-tomli-w           noarch 1.0.0-14.fc41    build       28.3 KiB

Full root log Full build log

susilehtola avatar Jul 30 '24 12:07 susilehtola

Hi @susilehtola We don't currently test on Fedora. Looking quickly on github, it seems like we may be able to add it to the Github actions test matrix:

jobs:
  fedora-job:
    runs-on: ubuntu-latest
    container: fedora:35
    steps:
      - run: cat /etc/os-release

PRs are very welcome!

seperman avatar Jul 30 '24 18:07 seperman

Hi,

deepdiff fails to build in Debian as well [1] The root cause is that json module in Python 3.13 introduced new error [2]; I think the failing test needs to be adjusted.

Kind Regards.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1088239 [2] https://github.com/python/cpython/pull/113227/commits/75bbcd458ee8aa89f01

s3v- avatar Dec 09 '24 21:12 s3v-

Hi, I just noticed the issue has already been fixed in this this PR

s3v- avatar Dec 11 '24 13:12 s3v-

Well, it's not yet merged...

susilehtola avatar Dec 11 '24 15:12 susilehtola