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

Failure in test suite #33

Closed
fabaff opened this issue Feb 6, 2020 · 4 comments
Closed

Failure in test suite #33

fabaff opened this issue Feb 6, 2020 · 4 comments

Comments

@fabaff
Copy link

fabaff commented Feb 6, 2020

In 0.9.0 is a failure which now prevents the RPM package for Fedora to be build.

$ python3 setup.py test
running test
running egg_info
writing json5.egg-info/PKG-INFO
writing dependency_links to json5.egg-info/dependency_links.txt
writing entry points to json5.egg-info/entry_points.txt
writing top-level names to json5.egg-info/top_level.txt
reading manifest file 'json5.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'json5.egg-info/SOURCES.txt'
running build_ext
test_basic (tests.lib_test.TestDump) ... ok
[...]
test_unknown_switch (tests.tool_test.ToolTest) ... ok
test_version (tests.tool_test.ToolTest) ... ok

======================================================================
FAIL: test_skip_keys (tests.lib_test.TestDumps)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fab/Documents/repos/pyjson5/tests/lib_test.py", line 379, in test_skip_keys
    '{foo: 1}')
AssertionError: '{foo: 1, }' != '{foo: 1}'
- {foo: 1, }
?        --
+ {foo: 1}


----------------------------------------------------------------------
Ran 61 tests in 0.121s

FAILED (failures=1)
Test failed: <unittest.runner.TextTestResult run=61 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=61 errors=0 failures=1>

Would be nice if you could fix it and release 0.9.1. Thanks.

@dpranke
Copy link
Owner

dpranke commented Feb 8, 2020

Thanks for the bug report! I've verified that I see it, too. I'll get on this ASAP, and see if I can also get a better test infra in place using tox et al (which I've been meaning to do for quite some time) to keep this from happening again.

dpranke added a commit that referenced this issue Feb 9, 2020
json5.dumps({"foo": 1, (1, 2): 2}, skip_keys=true) would incorrectly print
a trailing comma if the `(1, 2)` item was found as the second item in
the list.

This was reported in #33. This
only showed up in Python3 and not Python2, because of differences in the
ordering of the dictionary keys. This change also rewrites the test for
this to use OrderedDicts() to address that, and adds a test for a dict
with only invalid keys as well, for comprehensiveness.
@dpranke
Copy link
Owner

dpranke commented Feb 9, 2020

This is now fixed in 2ed8a4a; I've tagged and released v0.9.1 on PyPI as well.

I've not yet added better tox support or anything else like that to do better release checking, though.

@fabaff
Copy link
Author

fabaff commented Feb 9, 2020

Thanks for the quick reaction.

@fabaff
Copy link
Author

fabaff commented Feb 9, 2020

@fabaff fabaff closed this as completed Feb 9, 2020
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