Git Product home page Git Product logo

Comments (1)

tyhoff avatar tyhoff commented on August 19, 2024

Played a little with this:

$ python3.5 -m nose
.................F.....................................
======================================================================
FAIL: test_enhance_file_elements (tests.test_collector.TestCollector)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/tyler/dev/junk/puncover/tests/test_collector.py", line 415, in test_enhance_file_elements
    self.assertListEqual([aa, ab, b], crf)
AssertionError: Lists differ: [{'co[18 chars]s': [], 'name': 'a', 'collapsed_name': 'a/a', [6996 chars]'b'}] != [{'co[18 chars]s': [{'collapsed_sub_folders': [], 'name': 'a'[6996 chars]/b'}]

First differing element 0:
{'col[17 chars]s': [], 'name': 'a', 'collapsed_name': 'a/a', [2565 chars]a/a'}
{'col[17 chars]s': [{'collapsed_sub_folders': [], 'name': 'a'[1715 chars] 'b'}

Diff is 28182 characters long. Set self.maxDiff to None to see it.

----------------------------------------------------------------------
Ran 55 tests in 0.196s

This only happens for my with a 3.5.10 installation of Python, not a 3.5.5.

The two lists contain the same elements, just not in the same order. I assume in future versions, Python did something around sorting that enable these tests to pass.

One thing to consider would be to change assertListEqual to assertCountEqual if the order doesn't matter.

https://docs.python.org/3.2/library/unittest.html#unittest.TestCase.assertCountEqual

But, at the end of the day, most people are deprecating support for 3.5. 🤷

from puncover.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.