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

recursive and unhashable closure #90

Merged
merged 14 commits into from
May 30, 2017
Prev Previous commit
Next Next commit
test the expected failure for pypy
  • Loading branch information
Joe Jevnik committed May 25, 2017
commit 4b251a062be28dfc8cdb2639285d37e50c9c6fb3
13 changes: 13 additions & 0 deletions tests/cloudpickle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ def g(n):
g2 = pickle_depickle(f2(2))
self.assertEqual(g2(5), 240)

@pytest.mark.skipif(
Copy link
Member

Choose a reason for hiding this comment

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

This test actually should succeed on PyPy, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this is a mistake

supports_recursive_closure,
reason="Recursive closures shouldn't raise an exception if supported"
)
@pytest.mark.xfail
Copy link
Member

Choose a reason for hiding this comment

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

Rather than a xfail, I'd like to see the specific exception tested for inside the test, so that we don't miss it failing for other reasons...

def test_recursive_closure_unsupported(self):
def f1():
def g():
return g
return g

pickle_depickle(f1())

def test_unhashable_closure(self):
def f():
s = set((1, 2)) # mutable set is unhashable
Expand Down