Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tests fail on FreeBSD #323

Open
yurivict opened this issue May 31, 2022 · 8 comments
Open

Some tests fail on FreeBSD #323

yurivict opened this issue May 31, 2022 · 8 comments

Comments

@yurivict
Copy link

platform freebsd13 -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1, configfile: pytest.ini
plugins: forked-1.4.0, hypothesis-6.46.3, xdist-2.5.0, cov-2.9.0, rerunfailures-10.1, anyio-3.6.1, requests-mock-1.9.3, asyncio-0.18.3, flaky-3.7.0, trio-0.7.0, mock-1.10.4
asyncio: mode=legacy
collected 689 items                                                                                                                                                                          

tests/test_anyset.py .....                                                                                                                                                             [  0%]
tests/test_cache.py ss....                                                                                                                                                             [  1%]
tests/test_command.py ..FFFFFF...FFFFFFFFF.FF                                                                                                                                          [  4%]
tests/test_delta.py ........................................................................................                                                                           [ 17%]
tests/test_diff_math.py ....                                                                                                                                                           [ 18%]
tests/test_diff_numpy.py ............                                                                                                                                                  [ 20%]
tests/test_diff_other.py ..........                                                                                                                                                    [ 21%]
tests/test_diff_text.py ........................................................................................................sss.................................                   [ 41%]
tests/test_diff_tree.py .............s                                                                                                                                                 [ 43%]
tests/test_distance.py ......................................                                                                                                                          [ 49%]
tests/test_hash.py ......................................................................................                                                                              [ 61%]
tests/test_helper.py ...................................                                                                                                                               [ 66%]
tests/test_ignore_order.py .........................................................................                                                                                   [ 77%]
tests/test_lfucache.py ....                                                                                                                                                            [ 78%]
tests/test_model.py .....................                                                                                                                                              [ 81%]
tests/test_operators.py ......                                                                                                                                                         [ 82%]
tests/test_path.py ............                                                                                                                                                        [ 83%]
tests/test_search.py .............................................................                                                                                                     [ 92%]
tests/test_serialization.py FFFF......FFFF.....................................                                                                                                        [100%]

========================================================================================== FAILURES ==========================================================================================
________________________________________________________ TestCommands.test_diff_command[t1.json-t2_json.csv-'old_value': 'value2'-0] _________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4bd9d0>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.json'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2_json.csv', expected_in_stdout = "'old_value': 'value2'", expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, expected_in_stdout, expected_exit_code', [
        ('t1.json', 't2.json', "'dictionary_item_added\': [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, 'old_value': 1", 0),
        ('t1.yaml', 't2.yaml', "'new_value': 61, '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
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:28: AssertionError
________________________________________________________ TestCommands.test_diff_command[t2_json.csv-t1.json-'old_value': 'value3'-0] _________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4bda00>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2_json.csv'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.json', expected_in_stdout = "'old_value': 'value3'", expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, expected_in_stdout, expected_exit_code', [
        ('t1.json', 't2.json', "'dictionary_item_added\': [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, 'old_value': 1", 0),
        ('t1.yaml', 't2.yaml', "'new_value': 61, '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
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:28: AssertionError
____________________________________________________________ TestCommands.test_diff_command[t1.csv-t2.csv-'new_value': 'James'-0] ____________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4bdaf0>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.csv'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.csv', expected_in_stdout = "'new_value': 'James'", expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, expected_in_stdout, expected_exit_code', [
        ('t1.json', 't2.json', "'dictionary_item_added\': [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, 'old_value': 1", 0),
        ('t1.yaml', 't2.yaml', "'new_value': 61, '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
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:28: AssertionError
_________________________________________________________________ TestCommands.test_diff_command[t1.toml-t2.toml-10.0.0.2-0] _________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4bdb80>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.toml'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.toml', expected_in_stdout = '10.0.0.2', expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, expected_in_stdout, expected_exit_code', [
        ('t1.json', 't2.json', "'dictionary_item_added\': [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, 'old_value': 1", 0),
        ('t1.yaml', 't2.yaml', "'new_value': 61, '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
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:28: AssertionError
____________________________________________________ TestCommands.test_diff_command[t1.pickle-t2.pickle-'new_value': 5, 'old_value': 1-0] ____________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4bdc10>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.pickle'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.pickle', expected_in_stdout = "'new_value': 5, 'old_value': 1", expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, expected_in_stdout, expected_exit_code', [
        ('t1.json', 't2.json', "'dictionary_item_added\': [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, 'old_value': 1", 0),
        ('t1.yaml', 't2.yaml', "'new_value': 61, '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
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:28: AssertionError
_____________________________________________________ TestCommands.test_diff_command[t1.yaml-t2.yaml-'new_value': 61, 'old_value': 65-0] _____________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4bdca0>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.yaml'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.yaml', expected_in_stdout = "'new_value': 61, 'old_value': 65", expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, expected_in_stdout, expected_exit_code', [
        ('t1.json', 't2.json', "'dictionary_item_added\': [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, 'old_value': 1", 0),
        ('t1.yaml', 't2.yaml', "'new_value': 61, '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
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:28: AssertionError
______________________________________________________________ TestCommands.test_deeppatch_command[t1.json-t2_json.csv-args2-0] ______________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da0a0>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.json'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2_json.csv', args = {}, expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, args, expected_exit_code', [
        ('t1.json', 't2.json', {}, 0),
        ('t1_corrupt.json', 't2.json', {}, 1),
        ('t1.json', 't2_json.csv', {}, 0),
        ('t2_json.csv', 't1.json', {}, 0),
        ('t1.csv', 't2.csv', ["--ignore-order", "--report-repetition"], 0),
        ('t1.toml', 't2.toml', {}, 0),
        ('t1.pickle', 't2.pickle', {}, 0),
        ('t1.yaml', 't2.yaml', {}, 0),
    ])
    def test_deeppatch_command(self, t1, t2, args, expected_exit_code):
        t1_copy_path = f'/tmp/{t1}'
        t1 = os.path.join(FIXTURES_DIR, t1)
        t2 = os.path.join(FIXTURES_DIR, t2)
        copyfile(t1, t1_copy_path)
        runner = CliRunner()
        delta_pickled = runner.invoke(diff, [t1, t2, '--create-patch', *args])
>       assert delta_pickled.exit_code == expected_exit_code
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:54: AssertionError
______________________________________________________________ TestCommands.test_deeppatch_command[t2_json.csv-t1.json-args3-0] ______________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da130>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2_json.csv'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.json', args = {}, expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, args, expected_exit_code', [
        ('t1.json', 't2.json', {}, 0),
        ('t1_corrupt.json', 't2.json', {}, 1),
        ('t1.json', 't2_json.csv', {}, 0),
        ('t2_json.csv', 't1.json', {}, 0),
        ('t1.csv', 't2.csv', ["--ignore-order", "--report-repetition"], 0),
        ('t1.toml', 't2.toml', {}, 0),
        ('t1.pickle', 't2.pickle', {}, 0),
        ('t1.yaml', 't2.yaml', {}, 0),
    ])
    def test_deeppatch_command(self, t1, t2, args, expected_exit_code):
        t1_copy_path = f'/tmp/{t1}'
        t1 = os.path.join(FIXTURES_DIR, t1)
        t2 = os.path.join(FIXTURES_DIR, t2)
>       copyfile(t1, t1_copy_path)

tests/test_command.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

src = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2_json.csv', dst = '/tmp/t2_json.csv'

    def copyfile(src, dst, *, follow_symlinks=True):
        """Copy data from src to dst in the most efficient way possible.
    
        If follow_symlinks is not set and src is a symbolic link, a new
        symlink will be created instead of copying the file it points to.
    
        """
        sys.audit("shutil.copyfile", src, dst)
    
        if _samefile(src, dst):
            raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
    
        file_size = 0
        for i, fn in enumerate([src, dst]):
            try:
                st = _stat(fn)
            except OSError:
                # File most likely does not exist
                pass
            else:
                # XXX What about other special files? (sockets, devices...)
                if stat.S_ISFIFO(st.st_mode):
                    fn = fn.path if isinstance(fn, os.DirEntry) else fn
                    raise SpecialFileError("`%s` is a named pipe" % fn)
                if _WINDOWS and i == 0:
                    file_size = st.st_size
    
        if not follow_symlinks and _islink(src):
            os.symlink(os.readlink(src), dst)
        else:
>           with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2_json.csv'

/usr/local/lib/python3.8/shutil.py:264: FileNotFoundError
_________________________________________________________________ TestCommands.test_deeppatch_command[t1.csv-t2.csv-args4-0] _________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da1c0>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.csv'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.csv', args = ['--ignore-order', '--report-repetition'], expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, args, expected_exit_code', [
        ('t1.json', 't2.json', {}, 0),
        ('t1_corrupt.json', 't2.json', {}, 1),
        ('t1.json', 't2_json.csv', {}, 0),
        ('t2_json.csv', 't1.json', {}, 0),
        ('t1.csv', 't2.csv', ["--ignore-order", "--report-repetition"], 0),
        ('t1.toml', 't2.toml', {}, 0),
        ('t1.pickle', 't2.pickle', {}, 0),
        ('t1.yaml', 't2.yaml', {}, 0),
    ])
    def test_deeppatch_command(self, t1, t2, args, expected_exit_code):
        t1_copy_path = f'/tmp/{t1}'
        t1 = os.path.join(FIXTURES_DIR, t1)
        t2 = os.path.join(FIXTURES_DIR, t2)
>       copyfile(t1, t1_copy_path)

tests/test_command.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

src = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.csv', dst = '/tmp/t1.csv'

    def copyfile(src, dst, *, follow_symlinks=True):
        """Copy data from src to dst in the most efficient way possible.
    
        If follow_symlinks is not set and src is a symbolic link, a new
        symlink will be created instead of copying the file it points to.
    
        """
        sys.audit("shutil.copyfile", src, dst)
    
        if _samefile(src, dst):
            raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
    
        file_size = 0
        for i, fn in enumerate([src, dst]):
            try:
                st = _stat(fn)
            except OSError:
                # File most likely does not exist
                pass
            else:
                # XXX What about other special files? (sockets, devices...)
                if stat.S_ISFIFO(st.st_mode):
                    fn = fn.path if isinstance(fn, os.DirEntry) else fn
                    raise SpecialFileError("`%s` is a named pipe" % fn)
                if _WINDOWS and i == 0:
                    file_size = st.st_size
    
        if not follow_symlinks and _islink(src):
            os.symlink(os.readlink(src), dst)
        else:
>           with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.csv'

/usr/local/lib/python3.8/shutil.py:264: FileNotFoundError
________________________________________________________________ TestCommands.test_deeppatch_command[t1.toml-t2.toml-args5-0] ________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da250>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.toml'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.toml', args = {}, expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, args, expected_exit_code', [
        ('t1.json', 't2.json', {}, 0),
        ('t1_corrupt.json', 't2.json', {}, 1),
        ('t1.json', 't2_json.csv', {}, 0),
        ('t2_json.csv', 't1.json', {}, 0),
        ('t1.csv', 't2.csv', ["--ignore-order", "--report-repetition"], 0),
        ('t1.toml', 't2.toml', {}, 0),
        ('t1.pickle', 't2.pickle', {}, 0),
        ('t1.yaml', 't2.yaml', {}, 0),
    ])
    def test_deeppatch_command(self, t1, t2, args, expected_exit_code):
        t1_copy_path = f'/tmp/{t1}'
        t1 = os.path.join(FIXTURES_DIR, t1)
        t2 = os.path.join(FIXTURES_DIR, t2)
>       copyfile(t1, t1_copy_path)

tests/test_command.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

src = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.toml', dst = '/tmp/t1.toml'

    def copyfile(src, dst, *, follow_symlinks=True):
        """Copy data from src to dst in the most efficient way possible.
    
        If follow_symlinks is not set and src is a symbolic link, a new
        symlink will be created instead of copying the file it points to.
    
        """
        sys.audit("shutil.copyfile", src, dst)
    
        if _samefile(src, dst):
            raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
    
        file_size = 0
        for i, fn in enumerate([src, dst]):
            try:
                st = _stat(fn)
            except OSError:
                # File most likely does not exist
                pass
            else:
                # XXX What about other special files? (sockets, devices...)
                if stat.S_ISFIFO(st.st_mode):
                    fn = fn.path if isinstance(fn, os.DirEntry) else fn
                    raise SpecialFileError("`%s` is a named pipe" % fn)
                if _WINDOWS and i == 0:
                    file_size = st.st_size
    
        if not follow_symlinks and _islink(src):
            os.symlink(os.readlink(src), dst)
        else:
>           with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.toml'

/usr/local/lib/python3.8/shutil.py:264: FileNotFoundError
______________________________________________________________ TestCommands.test_deeppatch_command[t1.pickle-t2.pickle-args6-0] ______________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da2e0>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.pickle'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.pickle', args = {}, expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, args, expected_exit_code', [
        ('t1.json', 't2.json', {}, 0),
        ('t1_corrupt.json', 't2.json', {}, 1),
        ('t1.json', 't2_json.csv', {}, 0),
        ('t2_json.csv', 't1.json', {}, 0),
        ('t1.csv', 't2.csv', ["--ignore-order", "--report-repetition"], 0),
        ('t1.toml', 't2.toml', {}, 0),
        ('t1.pickle', 't2.pickle', {}, 0),
        ('t1.yaml', 't2.yaml', {}, 0),
    ])
    def test_deeppatch_command(self, t1, t2, args, expected_exit_code):
        t1_copy_path = f'/tmp/{t1}'
        t1 = os.path.join(FIXTURES_DIR, t1)
        t2 = os.path.join(FIXTURES_DIR, t2)
>       copyfile(t1, t1_copy_path)

tests/test_command.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

src = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.pickle', dst = '/tmp/t1.pickle'

    def copyfile(src, dst, *, follow_symlinks=True):
        """Copy data from src to dst in the most efficient way possible.
    
        If follow_symlinks is not set and src is a symbolic link, a new
        symlink will be created instead of copying the file it points to.
    
        """
        sys.audit("shutil.copyfile", src, dst)
    
        if _samefile(src, dst):
            raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
    
        file_size = 0
        for i, fn in enumerate([src, dst]):
            try:
                st = _stat(fn)
            except OSError:
                # File most likely does not exist
                pass
            else:
                # XXX What about other special files? (sockets, devices...)
                if stat.S_ISFIFO(st.st_mode):
                    fn = fn.path if isinstance(fn, os.DirEntry) else fn
                    raise SpecialFileError("`%s` is a named pipe" % fn)
                if _WINDOWS and i == 0:
                    file_size = st.st_size
    
        if not follow_symlinks and _islink(src):
            os.symlink(os.readlink(src), dst)
        else:
>           with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.pickle'

/usr/local/lib/python3.8/shutil.py:264: FileNotFoundError
________________________________________________________________ TestCommands.test_deeppatch_command[t1.yaml-t2.yaml-args7-0] ________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da370>, t1 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.yaml'
t2 = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t2.yaml', args = {}, expected_exit_code = 0

    @pytest.mark.parametrize('t1, t2, args, expected_exit_code', [
        ('t1.json', 't2.json', {}, 0),
        ('t1_corrupt.json', 't2.json', {}, 1),
        ('t1.json', 't2_json.csv', {}, 0),
        ('t2_json.csv', 't1.json', {}, 0),
        ('t1.csv', 't2.csv', ["--ignore-order", "--report-repetition"], 0),
        ('t1.toml', 't2.toml', {}, 0),
        ('t1.pickle', 't2.pickle', {}, 0),
        ('t1.yaml', 't2.yaml', {}, 0),
    ])
    def test_deeppatch_command(self, t1, t2, args, expected_exit_code):
        t1_copy_path = f'/tmp/{t1}'
        t1 = os.path.join(FIXTURES_DIR, t1)
        t2 = os.path.join(FIXTURES_DIR, t2)
>       copyfile(t1, t1_copy_path)

tests/test_command.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

src = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.yaml', dst = '/tmp/t1.yaml'

    def copyfile(src, dst, *, follow_symlinks=True):
        """Copy data from src to dst in the most efficient way possible.
    
        If follow_symlinks is not set and src is a symbolic link, a new
        symlink will be created instead of copying the file it points to.
    
        """
        sys.audit("shutil.copyfile", src, dst)
    
        if _samefile(src, dst):
            raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
    
        file_size = 0
        for i, fn in enumerate([src, dst]):
            try:
                st = _stat(fn)
            except OSError:
                # File most likely does not exist
                pass
            else:
                # XXX What about other special files? (sockets, devices...)
                if stat.S_ISFIFO(st.st_mode):
                    fn = fn.path if isinstance(fn, os.DirEntry) else fn
                    raise SpecialFileError("`%s` is a named pipe" % fn)
                if _WINDOWS and i == 0:
                    file_size = st.st_size
    
        if not follow_symlinks and _islink(src):
            os.symlink(os.readlink(src), dst)
        else:
>           with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.yaml'

/usr/local/lib/python3.8/shutil.py:264: FileNotFoundError
_____________________________________________________________________________ TestCommands.test_command_group_by _____________________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da430>

    def test_command_group_by(self):
        t1 = os.path.join(FIXTURES_DIR, 'c_t1.csv')
        t2 = os.path.join(FIXTURES_DIR, 'c_t2.csv')
        runner = CliRunner()
        diffed = runner.invoke(diff, [t1, t2, '--group-by', 'id'])
>       assert 0 == diffed.exit_code
E       assert 0 == 2
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:75: AssertionError
___________________________________________________________________________ TestCommands.test_command_math_epsilon ___________________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da550>

    def test_command_math_epsilon(self):
        t1 = os.path.join(FIXTURES_DIR, 'd_t1.yaml')
        t2 = os.path.join(FIXTURES_DIR, 'd_t2.yaml')
        runner = CliRunner()
        diffed = runner.invoke(diff, [t1, t2, '--math-epsilon', '0.1'])
>       assert 0 == diffed.exit_code
E       assert 0 == 2
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:84: AssertionError
_______________________________________________________________________________ TestCommands.test_command_grep _______________________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da670>

    def test_command_grep(self):
        path = os.path.join(FIXTURES_DIR, 'd_t1.yaml')
        runner = CliRunner()
        diffed = runner.invoke(grep, ['Sammy', path])
>       assert 0 == diffed.exit_code
E       assert 0 == 2
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:95: AssertionError
____________________________________________________________________________ TestCommands.test_command_err_grep2 _____________________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da8b0>

    def test_command_err_grep2(self):
        path = os.path.join(FIXTURES_DIR, 'invalid_yaml.yaml')
        runner = CliRunner()
        diffed = runner.invoke(grep, ['invalid', path])
>       assert "mapping keys are not allowed here" in diffed.output
E       assert 'mapping keys are not allowed here' in "Usage: grep [OPTIONS] ITEM PATH\nTry 'grep --help' for help.\n\nError: Invalid value for 'PATH': Path '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/invalid_yaml.yaml' does not exist.\n"
E        +  where "Usage: grep [OPTIONS] ITEM PATH\nTry 'grep --help' for help.\n\nError: Invalid value for 'PATH': Path '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/invalid_yaml.yaml' does not exist.\n" = <Result SystemExit(2)>.output

tests/test_command.py:109: AssertionError
_____________________________________________________________________________ TestCommands.test_command_extract ______________________________________________________________________________

self = <tests.test_command.TestCommands object at 0x84a4da9d0>

    def test_command_extract(self):
        path = os.path.join(FIXTURES_DIR, 'd_t1.yaml')
        runner = CliRunner()
        diffed = runner.invoke(extract, ['root[2][2]', path])
>       assert 0 == diffed.exit_code
E       assert 0 == 2
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_command.py:116: AssertionError
_________________________________________________________________________ TestSerialization.test_serialization_text __________________________________________________________________________

self = <tests.test_serialization.TestSerialization object at 0x84a71c280>

    def test_serialization_text(self):
        ddiff = DeepDiff(t1, t2)
>       assert "builtins.list" in ddiff.to_json_pickle()
E       TypeError: argument of type 'NoneType' is not iterable

tests/test_serialization.py:31: TypeError
___________________________________________________________________________ TestSerialization.test_deserialization ___________________________________________________________________________

self = <tests.test_serialization.TestSerialization object at 0x84a71c220>

    def test_deserialization(self):
        ddiff = DeepDiff(t1, t2)
        jsoned = ddiff.to_json_pickle()
        ddiff2 = DeepDiff.from_json_pickle(jsoned)
>       assert ddiff == ddiff2
E       assert {'type_changes': {"root[4]['b']": {'old_type': <class 'list'>, 'new_type': <class 'str'>, 'old_value': [1, 2, 3], 'new_value': 'world\n\n\nEnd'}}} == None

tests/test_serialization.py:39: AssertionError
_________________________________________________________________________ TestSerialization.test_serialization_tree __________________________________________________________________________

self = <tests.test_serialization.TestSerialization object at 0x84a71c3a0>

    def test_serialization_tree(self):
        ddiff = DeepDiff(t1, t2, view='tree')
        pickle_jsoned = ddiff.to_json_pickle()
>       assert "world" in pickle_jsoned
E       TypeError: argument of type 'NoneType' is not iterable

tests/test_serialization.py:44: TypeError
________________________________________________________________________ TestSerialization.test_deserialization_tree _________________________________________________________________________

self = <tests.test_serialization.TestSerialization object at 0x84a71c640>

    def test_deserialization_tree(self):
        ddiff = DeepDiff(t1, t2, view='tree')
        jsoned = ddiff.to_json_pickle()
        ddiff2 = DeepDiff.from_json_pickle(jsoned)
>       assert 'type_changes' in ddiff2
E       TypeError: argument of type 'NoneType' is not iterable

tests/test_serialization.py:52: TypeError
__________________________________________________________________ TestLoadContet.test_load_path_content[t1.yaml-<lambda>] ___________________________________________________________________

self = <tests.test_serialization.TestLoadContet object at 0x84a71ce80>, path1 = 't1.yaml', validate = <function TestLoadContet.<lambda> at 0x84a8f5310>

    @pytest.mark.parametrize('path1, validate', [
        ('t1.json', lambda x: x[0]['key1'] == 'value1'),
        ('t1.yaml', lambda x: x[0][0] == 'name'),
        ('t1.toml', lambda x: x['servers']['alpha']['ip'] == '10.0.0.1'),
        ('t1.csv', lambda x: x[0]['last_name'] == 'Nobody'),
        ('t1.pickle', lambda x: x[1] == 1),
    ])
    def test_load_path_content(self, path1, validate):
        path = os.path.join(FIXTURES_DIR, path1)
>       result = load_path_content(path)

tests/test_serialization.py:108: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.yaml', file_type = 'yaml'

    def load_path_content(path, file_type=None):
        """
        Loads and deserializes the content of the path.
        """
        if file_type is None:
            file_type = path.split('.')[-1]
        if file_type == 'json':
            with open(path, 'r') as the_file:
                content = json.load(the_file)
        elif file_type in {'yaml', 'yml'}:
            if yaml is None:  # pragma: no cover.
                raise ImportError('Pyyaml needs to be installed.')  # pragma: no cover.
>           with open(path, 'r') as the_file:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.yaml'

deepdiff/serialization.py:384: FileNotFoundError
__________________________________________________________________ TestLoadContet.test_load_path_content[t1.toml-<lambda>] ___________________________________________________________________

self = <tests.test_serialization.TestLoadContet object at 0x84a71cf40>, path1 = 't1.toml', validate = <function TestLoadContet.<lambda> at 0x84a8f53a0>

    @pytest.mark.parametrize('path1, validate', [
        ('t1.json', lambda x: x[0]['key1'] == 'value1'),
        ('t1.yaml', lambda x: x[0][0] == 'name'),
        ('t1.toml', lambda x: x['servers']['alpha']['ip'] == '10.0.0.1'),
        ('t1.csv', lambda x: x[0]['last_name'] == 'Nobody'),
        ('t1.pickle', lambda x: x[1] == 1),
    ])
    def test_load_path_content(self, path1, validate):
        path = os.path.join(FIXTURES_DIR, path1)
>       result = load_path_content(path)

tests/test_serialization.py:108: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.toml', file_type = 'toml'

    def load_path_content(path, file_type=None):
        """
        Loads and deserializes the content of the path.
        """
        if file_type is None:
            file_type = path.split('.')[-1]
        if file_type == 'json':
            with open(path, 'r') as the_file:
                content = json.load(the_file)
        elif file_type in {'yaml', 'yml'}:
            if yaml is None:  # pragma: no cover.
                raise ImportError('Pyyaml needs to be installed.')  # pragma: no cover.
            with open(path, 'r') as the_file:
                content = yaml.safe_load(the_file)
        elif file_type == 'toml':
            if toml is None:  # pragma: no cover.
                raise ImportError('Toml needs to be installed.')  # pragma: no cover.
>           with open(path, 'r') as the_file:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.toml'

deepdiff/serialization.py:389: FileNotFoundError
___________________________________________________________________ TestLoadContet.test_load_path_content[t1.csv-<lambda>] ___________________________________________________________________

self = <tests.test_serialization.TestLoadContet object at 0x84aa56760>, path1 = 't1.csv', validate = <function TestLoadContet.<lambda> at 0x84a8f5430>

    @pytest.mark.parametrize('path1, validate', [
        ('t1.json', lambda x: x[0]['key1'] == 'value1'),
        ('t1.yaml', lambda x: x[0][0] == 'name'),
        ('t1.toml', lambda x: x['servers']['alpha']['ip'] == '10.0.0.1'),
        ('t1.csv', lambda x: x[0]['last_name'] == 'Nobody'),
        ('t1.pickle', lambda x: x[1] == 1),
    ])
    def test_load_path_content(self, path1, validate):
        path = os.path.join(FIXTURES_DIR, path1)
>       result = load_path_content(path)

tests/test_serialization.py:108: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.csv', file_type = 'csv'

    def load_path_content(path, file_type=None):
        """
        Loads and deserializes the content of the path.
        """
        if file_type is None:
            file_type = path.split('.')[-1]
        if file_type == 'json':
            with open(path, 'r') as the_file:
                content = json.load(the_file)
        elif file_type in {'yaml', 'yml'}:
            if yaml is None:  # pragma: no cover.
                raise ImportError('Pyyaml needs to be installed.')  # pragma: no cover.
            with open(path, 'r') as the_file:
                content = yaml.safe_load(the_file)
        elif file_type == 'toml':
            if toml is None:  # pragma: no cover.
                raise ImportError('Toml needs to be installed.')  # pragma: no cover.
            with open(path, 'r') as the_file:
                content = toml.load(the_file)
        elif file_type == 'pickle':
            with open(path, 'rb') as the_file:
                content = the_file.read()
                content = pickle_load(content)
        elif file_type in {'csv', 'tsv'}:
            if clevercsv is None:  # pragma: no cover.
>               raise ImportError('CleverCSV needs to be installed.')  # pragma: no cover.
E               ImportError: CleverCSV needs to be installed.

deepdiff/serialization.py:397: ImportError
_________________________________________________________________ TestLoadContet.test_load_path_content[t1.pickle-<lambda>] __________________________________________________________________

self = <tests.test_serialization.TestLoadContet object at 0x84aa56d90>, path1 = 't1.pickle', validate = <function TestLoadContet.<lambda> at 0x84a8f54c0>

    @pytest.mark.parametrize('path1, validate', [
        ('t1.json', lambda x: x[0]['key1'] == 'value1'),
        ('t1.yaml', lambda x: x[0][0] == 'name'),
        ('t1.toml', lambda x: x['servers']['alpha']['ip'] == '10.0.0.1'),
        ('t1.csv', lambda x: x[0]['last_name'] == 'Nobody'),
        ('t1.pickle', lambda x: x[1] == 1),
    ])
    def test_load_path_content(self, path1, validate):
        path = os.path.join(FIXTURES_DIR, path1)
>       result = load_path_content(path)

tests/test_serialization.py:108: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.pickle', file_type = 'pickle'

    def load_path_content(path, file_type=None):
        """
        Loads and deserializes the content of the path.
        """
        if file_type is None:
            file_type = path.split('.')[-1]
        if file_type == 'json':
            with open(path, 'r') as the_file:
                content = json.load(the_file)
        elif file_type in {'yaml', 'yml'}:
            if yaml is None:  # pragma: no cover.
                raise ImportError('Pyyaml needs to be installed.')  # pragma: no cover.
            with open(path, 'r') as the_file:
                content = yaml.safe_load(the_file)
        elif file_type == 'toml':
            if toml is None:  # pragma: no cover.
                raise ImportError('Toml needs to be installed.')  # pragma: no cover.
            with open(path, 'r') as the_file:
                content = toml.load(the_file)
        elif file_type == 'pickle':
>           with open(path, 'rb') as the_file:
E           FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-deepdiff/work-py38/deepdiff-5.8.1/tests/fixtures/t1.pickle'

deepdiff/serialization.py:392: FileNotFoundError
====================================================================================== warnings summary ======================================================================================
../../../../../../usr/local/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191
  /usr/local/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
    config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

-- 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.json-t2_json.csv-'old_value': 'value2'-0] - assert 2 == 0
FAILED tests/test_command.py::TestCommands::test_diff_command[t2_json.csv-t1.json-'old_value': 'value3'-0] - assert 2 == 0
FAILED tests/test_command.py::TestCommands::test_diff_command[t1.csv-t2.csv-'new_value': 'James'-0] - assert 2 == 0
FAILED tests/test_command.py::TestCommands::test_diff_command[t1.toml-t2.toml-10.0.0.2-0] - assert 2 == 0
FAILED tests/test_command.py::TestCommands::test_diff_command[t1.pickle-t2.pickle-'new_value': 5, 'old_value': 1-0] - assert 2 == 0
FAILED tests/test_command.py::TestCommands::test_diff_command[t1.yaml-t2.yaml-'new_value': 61, 'old_value': 65-0] - assert 2 == 0
FAILED tests/test_command.py::TestCommands::test_deeppatch_command[t1.json-t2_json.csv-args2-0] - assert 2 == 0
FAILED tests/test_command.py::TestCommands::test_deeppatch_command[t2_json.csv-t1.json-args3-0] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/deve...
FAILED tests/test_command.py::TestCommands::test_deeppatch_command[t1.csv-t2.csv-args4-0] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py-d...
FAILED tests/test_command.py::TestCommands::test_deeppatch_command[t1.toml-t2.toml-args5-0] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py...
FAILED tests/test_command.py::TestCommands::test_deeppatch_command[t1.pickle-t2.pickle-args6-0] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/deve...
FAILED tests/test_command.py::TestCommands::test_deeppatch_command[t1.yaml-t2.yaml-args7-0] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/py...
FAILED tests/test_command.py::TestCommands::test_command_group_by - assert 0 == 2
FAILED tests/test_command.py::TestCommands::test_command_math_epsilon - assert 0 == 2
FAILED tests/test_command.py::TestCommands::test_command_grep - assert 0 == 2
FAILED tests/test_command.py::TestCommands::test_command_err_grep2 - assert 'mapping keys are not allowed here' in "Usage: grep [OPTIONS] ITEM PATH\nTry 'grep --help' for help.\n\nError: ...
FAILED tests/test_command.py::TestCommands::test_command_extract - assert 0 == 2
FAILED tests/test_serialization.py::TestSerialization::test_serialization_text - TypeError: argument of type 'NoneType' is not iterable
FAILED tests/test_serialization.py::TestSerialization::test_deserialization - assert {'type_changes': {"root[4]['b']": {'old_type': <class 'list'>, 'new_type': <class 'str'>, 'old_value':...
FAILED tests/test_serialization.py::TestSerialization::test_serialization_tree - TypeError: argument of type 'NoneType' is not iterable
FAILED tests/test_serialization.py::TestSerialization::test_deserialization_tree - TypeError: argument of type 'NoneType' is not iterable
FAILED tests/test_serialization.py::TestLoadContet::test_load_path_content[t1.yaml-<lambda>] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/p...
FAILED tests/test_serialization.py::TestLoadContet::test_load_path_content[t1.toml-<lambda>] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel/p...
FAILED tests/test_serialization.py::TestLoadContet::test_load_path_content[t1.csv-<lambda>] - ImportError: CleverCSV needs to be installed.
FAILED tests/test_serialization.py::TestLoadContet::test_load_path_content[t1.pickle-<lambda>] - FileNotFoundError: [Errno 2] No such file or directory: '/disk-samsung/freebsd-ports/devel...
==================================================================== 25 failed, 658 passed, 6 skipped, 1 warning in 8.86s ====================================================================
*** Error code 1

Version: 5.8.1
Python-3.8
FreeBSD 13.1

@seperman
Copy link
Owner

seperman commented Jun 1, 2022

Hmm, do you have all the dependencies installed?
Have you done a pip install -r requirements-dev.txt before running the tests @yurivict ?

@yurivict
Copy link
Author

@seperman

Currently many tests fail because of quotation mark differences, like this:

 def prep_str(obj, ignore_string_type_changes=True):
-    return obj if ignore_string_type_changes else 'str:{}'.format(obj)
+    return obj if ignore_string_type_changes else "str:{}".format(obj)
         

What might be causing this?

There are no specific import statement failures, so the problem isn't that some dependencies aren't present.

@seperman
Copy link
Owner

seperman commented Oct 20, 2023 via email

@yurivict
Copy link
Author

Is that a bug in your FreeBSD installed version of Python?

I am not aware of any failures with that type of symptoms.

@yurivict
Copy link
Author

We have about 5,500+ Python ports in FreeBSD, and I've never seen anything like this.

@yurivict
Copy link
Author

Version 7.0.1 has 3 tests failing:

==================================================================================== test session starts ====================================================================================
platform freebsd14 -- Python 3.9.18, pytest-7.4.4, pluggy-1.4.0
Using --randomly-seed=1314162047
rootdir: /usr/ports/devel/py-deepdiff/work-py39/deepdiff-7.0.1
configfile: pytest.ini
plugins: anyio-4.3.0, hypothesis-6.98.18, datadir-1.5.0, cov-4.1.0, flake8-1.1.1, randomly-3.12.0, timeout-2.1.0, time-machine-2.11.0, rerunfailures-11.1.2, flaky-3.7.0, forked-1.6.0, aspectlib-2.0.0, xdist-3.5.0, env-0.6.2, mock-3.10.0, subtests-0.12.1, parallel-0.1.1
collected 915 items                                                                                                                                                                         

tests/test_anyset.py .....                                                                                                                                                            [  0%]
tests/test_diff_tree.py ..............s                                                                                                                                               [  2%]
tests/test_delta.py ..F.............................................................................................................                                                  [ 14%]
tests/test_diff_math.py ....                                                                                                                                                          [ 14%]
tests/test_path.py ..................                                                                                                                                                 [ 16%]
tests/test_command.py .......................                                                                                                                                         [ 19%]
tests/test_hash.py ...................................................................................................                                                                [ 30%]
tests/test_cache.py .ss...                                                                                                                                                            [ 30%]
tests/test_model.py ......................                                                                                                                                            [ 33%]
tests/test_helper.py ................................................................................................................................................................ [ 50%]
..                                                                                                                                                                                    [ 50%]
tests/test_diff_text.py .............s..........s.......................................................................................................................s............ [ 68%]
........                                                                                                                                                                              [ 68%]
tests/test_operators.py ........                                                                                                                                                      [ 69%]
tests/test_diff_datetime.py ...                                                                                                                                                       [ 70%]
tests/test_search.py .............................................................                                                                                                    [ 76%]
tests/test_serialization.py .......................F........F............................                                                                                             [ 83%]
tests/test_distance.py ......................................                                                                                                                         [ 87%]
tests/test_diff_other.py .............                                                                                                                                                [ 89%]
tests/test_lfucache.py ....                                                                                                                                                           [ 89%]
tests/test_diff_numpy.py ..............                                                                                                                                               [ 91%]
tests/test_ignore_order.py ..............s................ss........................................s........                                                                         [100%]

========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________ TestDeltaCompareFunc.test_list_of_alphabet_and_its_delta __________________________________________________________________

self = <tests.test_delta.TestDeltaCompareFunc object at 0x1f2399a0d5b0>

    def test_list_of_alphabet_and_its_delta(self):
        l1 = "A B C D E F G D H".split()
        l2 = "B C X D H Y Z".split()
        diff = DeepDiff(l1, l2)
    
        # Problem: The index of values_changed should be either all for AFTER removals or BEFORE removals.
        # What we have here is that F & G transformation to Y and Z is not compatible with A and E removal
        # it is really meant for the removals to happen first, and then have indexes in L2 for values changing
        # rather than indexes in L1. Here what we need to have is:
        # A B C D E F G D H
        # A B C-X-E
        # B C D F G D H  # removal
    
        # What we really need is to report is as it is in difflib for delta specifically:
        # A B C D E F G D H
        # B C D E F G D H     delete    t1[0:1] --> t2[0:0]    ['A'] --> []
        # B C D E F G D H     equal     t1[1:3] --> t2[0:2] ['B', 'C'] --> ['B', 'C']
        # B C X D H           replace   t1[3:7] --> t2[2:3] ['D', 'E', 'F', 'G'] --> ['X']
        # B C X D H           equal     t1[7:9] --> t2[3:5] ['D', 'H'] --> ['D', 'H']
        # B C X D H Y Z       insert    t1[9:9] --> t2[5:7]       [] --> ['Y', 'Z']
    
        # So in this case, it needs to also include information about what stays equal in the delta
        # NOTE: the problem is that these operations need to be performed in a specific order.
        # DeepDiff removes that order and just buckets all insertions vs. replace vs. delete in their own buckets.
        # For times that we use Difflib, we may want to keep the information for the array_change key
        # just for the sake of delta, but not for reporting in deepdiff itself.
        # that way we can re-apply the changes as they were reported in delta.
    
        delta = Delta(diff)
        assert l2 == l1 + delta
        with pytest.raises(ValueError) as exc_info:
            l1 == l2 - delta
        assert "Please recreate the delta with bidirectional=True" == str(exc_info.value)
    
        delta2 = Delta(diff, bidirectional=True)
        assert l2 == l1 + delta2
        assert l1 == l2 - delta2
    
        dump = Delta(diff, bidirectional=True).dumps()
        delta3 = Delta(dump, bidirectional=True)
    
        assert l2 == l1 + delta3
        assert l1 == l2 - delta3
    
        dump4 = Delta(diff, bidirectional=True, serializer=json_dumps).dumps()
>       delta4 = Delta(dump4, bidirectional=True, deserializer=json_loads)

tests/test_delta.py:2395: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
deepdiff/delta.py:130: in __init__
    self.diff = _deserializer(diff, safe_to_import=safe_to_import)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

obj = '{"values_changed": {"root[3]": {"new_value": "X", "old_value": "D", "new_path": "root[2]"}, "root[6]": {"new_value": ...3, 7, 2, 3, ["D", "E", "F", "G"], ["X"]], ["equal", 7, 9, 3, 5, null, null], ["insert", 9, 9, 5, 7, [], ["Y", "Z"]]]}}'
safe_to_import = None

    def _deserializer(obj, safe_to_import=None):
        result = deserializer(obj)
        if result.get('_iterable_opcodes'):
            _iterable_opcodes = {}
            for path, op_codes in result['_iterable_opcodes'].items():
                _iterable_opcodes[path] = []
                for op_code in op_codes:
                    _iterable_opcodes[path].append(
>                       Opcode(
                            **op_code
                        )
                    )
E                   TypeError: deepdiff.helper.Opcode() argument after ** must be a mapping, not list

deepdiff/delta.py:102: TypeError
_____________________________________________________________________ TestDeepDiffPretty.test_namedtuple_seriazliation ______________________________________________________________________

self = <tests.test_serialization.TestDeepDiffPretty object at 0x1f2399d4a670>

    def test_namedtuple_seriazliation(self):
        op_code = Opcode(tag="replace", t1_from_index=0, t1_to_index=1, t2_from_index=10, t2_to_index=20)
        serialized = json_dumps(op_code)
        expected = '{"tag":"replace","t1_from_index":0,"t1_to_index":1,"t2_from_index":10,"t2_to_index":20,"old_values":null,"new_values":null}'
>       assert serialized == expected
E       assert '["replace", ..., null, null]' == '{"tag":"repl...values":null}'
E         - {"tag":"replace","t1_from_index":0,"t1_to_index":1,"t2_from_index":10,"t2_to_index":20,"old_values":null,"new_values":null}
E         + ["replace", 0, 1, 10, 20, null, null]

tests/test_serialization.py:362: AssertionError
______________________________________________________________ TestDeepDiffPretty.test_json_dumps_and_loads[8-value7-<lambda>] ______________________________________________________________

self = <tests.test_serialization.TestDeepDiffPretty object at 0x1f2399d4a4c0>, test_num = 8
value = SomeStats(counter=Counter({'a': 2, 'b': 1}), context_aware_counter=None, min_int=0, max_int=10), func_to_convert_back = <function TestDeepDiffPretty.<lambda> at 0x1f2399d0ca60>

    @pytest.mark.parametrize('test_num, value, func_to_convert_back', [
        (1, {'10': None}, None),
        (2, {"type_changes": {"root": {"old_type": None, "new_type": list, "new_value": ["你好", 2, 3, 5]}}}, None),
        (3, {'10': Decimal(2017)}, None),
        (4, Decimal(2017.1), None),
        (5, {1, 2, 10}, set),
        (6, datetime.datetime(2023, 10, 11), datetime.datetime.fromisoformat),
        (7, datetime.datetime.utcnow(), datetime.datetime.fromisoformat),
        (8, field_stats1, lambda x: SomeStats(**x)),
        (9, np.array([[ 101, 3533, 1998, 4532, 2024, 3415, 1012,  102]]), np.array)
    ])
    def test_json_dumps_and_loads(self, test_num, value, func_to_convert_back):
        if test_num == 8 and py_current_version < 3.8:
            print(f"Skipping test_json_dumps_and_loads #{test_num} on Python {py_current_version}")
            return
        serialized = json_dumps(value)
        back = json_loads(serialized)
        if func_to_convert_back:
>           back = func_to_convert_back(back)

tests/test_serialization.py:352: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = [{'a': 2, 'b': 1}, None, 0, 10]

>       (8, field_stats1, lambda x: SomeStats(**x)),
        (9, np.array([[ 101, 3533, 1998, 4532, 2024, 3415, 1012,  102]]), np.array)
    ])
E   TypeError: tests.test_serialization.SomeStats() argument after ** must be a mapping, not list

tests/test_serialization.py:342: TypeError
================================================================================== short test summary info ==================================================================================
FAILED tests/test_delta.py::TestDeltaCompareFunc::test_list_of_alphabet_and_its_delta - TypeError: deepdiff.helper.Opcode() argument after ** must be a mapping, not list
FAILED tests/test_serialization.py::TestDeepDiffPretty::test_namedtuple_seriazliation - assert '["replace", ..., null, null]' == '{"tag":"repl...values":null}'
FAILED tests/test_serialization.py::TestDeepDiffPretty::test_json_dumps_and_loads[8-value7-<lambda>] - TypeError: tests.test_serialization.SomeStats() argument after ** must be a mapping, not list
======================================================================== 3 failed, 902 passed, 10 skipped in 10.61s =========================================================================
*** Error code 1

@seperman
Copy link
Owner

seperman commented Apr 15, 2024

@yurivict One of the reason we stopped supporting Python 3.7 was that NamedTuple serialization in 3.7 was returning a list instead of a dictionary. That was for Python 3.7 installed on Debian via pyenv.
The error you see that says TypeError: deepdiff.helper.Opcode() argument after ** must be a mapping, not list makes me think you are using an old version of Python on FreeBSD which is returning a list for NamedTuples when serialized. Is that true?

@yurivict
Copy link
Author

We are using Python-3.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants