Skip to content

Commit 3c82ba1

Browse files
committed
Skip/mark newly added tests that are expected to fail
1 parent 6c6e35d commit 3c82ba1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from __future__ import unicode_literals
44

55
import time
6+
import unittest
67

8+
import django
79
from django.core import signals
810
from django.core.cache import caches
911
from django.db import close_old_connections
@@ -449,24 +451,30 @@ def test_set_fail_on_pickleerror(self):
449451
with self.assertRaises(pickle.PickleError):
450452
self.cache.set('unpicklable', Unpicklable())
451453

454+
@unittest.skipIf(django.VERSION < (1, 11),
455+
'get_or_set with `None` not supported (Django ticket #26792)')
452456
def test_get_or_set(self):
453457
self.assertIsNone(self.cache.get('projector'))
454458
self.assertEqual(self.cache.get_or_set('projector', 42), 42)
455459
self.assertEqual(self.cache.get('projector'), 42)
456460
self.assertEqual(self.cache.get_or_set('null', None), None)
457461

462+
@unittest.skipIf(django.VERSION < (1, 9), 'get_or_set not supported')
458463
def test_get_or_set_callable(self):
459464
def my_callable():
460465
return 'value'
461466

462467
self.assertEqual(self.cache.get_or_set('mykey', my_callable), 'value')
463468
self.assertEqual(self.cache.get_or_set('mykey', my_callable()), 'value')
464469

470+
@unittest.skipIf(django.VERSION < (1, 9), 'get_or_set not supported')
465471
def test_get_or_set_callable_returning_none(self):
466472
self.assertIsNone(self.cache.get_or_set('mykey', lambda: None))
467473
# Previous get_or_set() doesn't store None in the cache.
468474
self.assertEqual(self.cache.get('mykey', 'default'), 'default')
469475

476+
@unittest.skipIf(django.VERSION < (1, 11),
477+
'get_or_set with `None` not supported (Django ticket #26792)')
470478
def test_get_or_set_version(self):
471479
msg = (
472480
"get_or_set() missing 1 required positional argument: 'default'"
@@ -516,6 +524,8 @@ def test_memcached_deletes_key_on_failed_set(self):
516524
value = self.cache.get('small_value')
517525
self.assertTrue(value is None or value == large_value)
518526

527+
# TODO: Fix https://github.com/django-pylibmc/django-pylibmc/issues/6
528+
@unittest.expectedFailure
519529
def test_close(self):
520530
# For clients that don't manage their connections properly, the
521531
# connection is closed when the request is complete.

0 commit comments

Comments
 (0)