Skip to content

AssertionError not showing diff (even with -vv) #8767

Closed

Description

@carygravel
  • a detailed description of the bug or problem you are having

In creating conda environments on a new machine, I have one project where

a = 1
b = 2
assert a == b

does not show the diff output. The diff works fine an another copy of the environment.

  • output of pip list from the virtual environment you are using
Package               Version
--------------------- -------------------
absl-py               0.12.0
astroid               2.3.3
atomicwrites          1.4.0
attrs                 20.3.0
certifi               2020.6.20
click                 7.1.2
colorama              0.4.4
deepdiff              5.5.0
Flask                 1.1.1
hypothesis            5.41.0
importlib-metadata    2.0.0
isort                 4.3.21
itsdangerous          1.1.0
Jinja2                2.11.2
lazy-object-proxy     1.5.1
MarkupSafe            1.1.1
mccabe                0.6.1
mkl-fft               1.2.0
mkl-random            1.1.1
mkl-service           2.3.0
more-itertools        8.5.0
multipledispatch      0.6.0
numpy                 1.19.2
ordered-set           4.0.2
ortools               8.2.8710
packaging             20.4
pandas                1.0.3
pip                   20.2.4
pluggy                0.13.1
pprintpp              0.4.0
protobuf              3.17.3
psutil                5.7.2
py                    1.9.0
pylint                2.4.4
pyparsing             2.4.7
pytest                5.4.1
pytest-arraydiff      0.3
pytest-astropy        0.8.0
pytest-astropy-header 0.1.2
pytest-diff           0.1.14
pytest-doctestplus    0.8.0
pytest-openfiles      0.5.0
pytest-remotedata     0.3.2
pytest-runner         5.2
python-dateutil       2.8.1
python-dotenv         0.13.0
pytz                  2020.1
setuptools            50.3.1.post20201107
six                   1.15.0
sortedcontainers      2.2.2
wcwidth               0.2.5
Werkzeug              1.0.1
wheel                 0.35.1
wincertstore          0.2
wrapt                 1.12.1
zipp                  3.4.0
  • pytest and operating system versions

pytest 5.4.1, Win10, whereby, as I said I have another Win10 machine with pytest 5.4.1 where this all works fine, so I assume this is a subtle problem somewhere else.

  • minimal example if possible

Activity

  1. The-Compiler commented on Jun 15, 2021

    @The-Compiler
    Member

    In which file is the code? Can you show the full output?

  2. added
    status: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivity
    on Jun 15, 2021
  3. carygravel commented on Jun 15, 2021

    @carygravel
    Author
    (D:\myproj\env) D:\myproj>pytest src\test.py -vv -k test_build_jobs
    =========================================================================================================== test session starts ============================================================================================================
    platform win32 -- Python 3.7.1, pytest-5.4.1, py-1.9.0, pluggy-0.13.1 -- D:\myproj\env\python.exe
    cachedir: .pytest_cache
    rootdir: D:\myproj
    plugins: arraydiff-0.3
    collected 7 items / 6 deselected / 1 selected
     
    src/test.py::test_build_jobs FAILED                                                                                                                                                                                                   [100%]
     
    ================================================================================================================= FAILURES =================================================================================================================
    _____________________________________________________________________________________________________________ test_build_jobs ______________________________________________________________________________________________________________
     
        def test_build_jobs():
            """ basic tests for build_features.build_jobs """
            a = 1
            b = 2
    >       assert a == b
    E       AssertionError
     
    src\test.py:90: AssertionError
    ========================================================================================================= short test summary info ==========================================================================================================
    FAILED src/test.py::test_build_jobs - AssertionError
    ===================================================================================================== 1 failed, 6 deselected in 0.76s ======================================================================================================
    
  4. The-Compiler commented on Jun 15, 2021

    @The-Compiler
    Member

    does anything change if you name your file test_something.py? What about -p no:arraydiff? Finally, please test with a newer pytest version - 5.4.1 is over a year old and not supported anymore.

  5. carygravel commented on Jun 15, 2021

    @carygravel
    Author

    does anything change if you name your file test_something.py?

    Yup. That fixed it. The weird thing is that in the old environment with the same versions, it all worked fine as just test.py.

    Thanks for the help.

  6. locked and limited conversation to collaborators on Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions