Skip to content

Attempt to fix flaky test on Python 2#3452

Merged
RonnyPfannschmidt merged 1 commit intopytest-dev:masterfrom
nicoddemus:fix-flaky-xdist-test
May 5, 2018
Merged

Attempt to fix flaky test on Python 2#3452
RonnyPfannschmidt merged 1 commit intopytest-dev:masterfrom
nicoddemus:fix-flaky-xdist-test

Conversation

@nicoddemus
Copy link
Member

This test sometimes fails on AppVeyor with:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <listiterator object at 0x0549DC50>
    leaked_types = sum(1 for _ in gc.garbage
>                   if 'PseudoFixtureDef' in str(_))
E   UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 23: ordinal not in range(128)
test_request_garbage.py:19: UnicodeEncodeError
====================== 1 passed, 1 error in 1.39 seconds ======================

Use our internal "safe_repr" function to handle Encode errors: who knows
what objects are in garbage after all.

Example of a recent failure: https://ci.appveyor.com/project/pytestbot/pytest/build/1.0.4327/job/yfunwupo1bo3rvdc

This test sometimes fails on AppVeyor with:

```
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <listiterator object at 0x0549DC50>
    leaked_types = sum(1 for _ in gc.garbage
>                   if 'PseudoFixtureDef' in str(_))
E   UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 23: ordinal not in range(128)
test_request_garbage.py:19: UnicodeEncodeError
====================== 1 passed, 1 error in 1.39 seconds ======================
```

Use our internal "safe_repr" function to handle Encode errors: who knows
what objects are in garbage after all.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 92.821% when pulling fa76a5c on nicoddemus:fix-flaky-xdist-test into 27651f4 on pytest-dev:master.

@RonnyPfannschmidt RonnyPfannschmidt merged commit 84b37e1 into pytest-dev:master May 5, 2018
@nicoddemus nicoddemus deleted the fix-flaky-xdist-test branch May 5, 2018 19:05
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

Successfully merging this pull request may close these issues.

3 participants