Skip to content

TST: attempt to make test_load_refcount deterministic - #6576

Merged
charris merged 1 commit into
numpy:masterfrom
njsmith:test_load_refcount-fix
Oct 29, 2015
Merged

charris merged 1 commit into
numpy:masterfrom
njsmith:test_load_refcount-fix

Conversation

@njsmith

@njsmith njsmith commented Oct 28, 2015

Copy link
Copy Markdown
Member

Use a different strategy to detect whether np.load creates cycles.

Fixes gh-6571, I hope.

Comment thread numpy/lib/tests/test_io.py Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be we can disable/enable gc to prevent automatic call, something like:

    gc.disable()
    try:
        gc.collect()
        np.load(f)
        nobj=gc.collect()
    finally:
        gc.enable()
    assert_equal(nobj, 0)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, why not :-). Updated.

Use a different strategy to detect whether np.load creates cycles.

Fixes numpygh-6571, I hope.
@njsmith
njsmith force-pushed the test_load_refcount-fix branch from 60efeb0 to 0befb0b Compare October 29, 2015 04:02
@charris

charris commented Oct 29, 2015

Copy link
Copy Markdown
Member

Guess the only way to be sure is put it in and wait ;) Thanks Nathaniel.

charris added a commit that referenced this pull request Oct 29, 2015
TST: attempt to make test_load_refcount deterministic
@charris
charris merged commit 85ec8d9 into numpy:master Oct 29, 2015
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