/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test__static_tuple.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    static_tuple,
31
31
    tests,
32
32
    )
33
 
from breezy.sixish import (
34
 
    PY3,
35
 
    text_type,
36
 
    )
37
33
from breezy.tests import (
38
34
    features,
39
35
    )
221
217
        # But not a subclass, because subint could introduce refcycles
222
218
        self.assertRaises(TypeError, self.module.StaticTuple, subint(2))
223
219
 
224
 
    def test_holds_long(self):
225
 
        if PY3:
226
 
            self.skipTest("No long type on Python 3")
227
 
        k1 = self.module.StaticTuple(2**65)
228
 
 
229
 
        class sublong(long):
230
 
            pass
231
 
        # But not a subclass
232
 
        self.assertRaises(TypeError, self.module.StaticTuple, sublong(1))
233
 
 
234
220
    def test_holds_float(self):
235
221
        k1 = self.module.StaticTuple(1.2)
236
222
 
248
234
    def test_holds_unicode(self):
249
235
        k1 = self.module.StaticTuple(u'\xb5')
250
236
 
251
 
        class subunicode(text_type):
 
237
        class subunicode(str):
252
238
            pass
253
239
        self.assertRaises(TypeError, self.module.StaticTuple,
254
240
                          subunicode(u'\xb5'))
295
281
 
296
282
    def check_strict_compare(self, k1, k2, mismatched_types):
297
283
        """True if on Python 3 and stricter comparison semantics are used."""
298
 
        if PY3 and mismatched_types:
 
284
        if mismatched_types:
299
285
            for op in ("ge", "gt", "le", "lt"):
300
286
                self.assertRaises(TypeError, getattr(operator, op), k1, k2)
301
287
            return True