~ubuntu-branches/ubuntu/utopic/python3.3/utopic

« back to all changes in this revision

Viewing changes to Lib/test/string_tests.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-01-27 12:13:57 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20140127121357-60ennw934dn1qirz
Tags: 3.3.4~rc1-1
Python 3.3.4 release candidate 1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
663
663
        self.checkraises(TypeError, 'hello', 'replace', 42, 'h')
664
664
        self.checkraises(TypeError, 'hello', 'replace', 'h', 42)
665
665
 
 
666
    @unittest.skipIf(sys.maxsize > (1 << 32) or struct.calcsize('P') != 4,
 
667
                     'only applies to 32-bit platforms')
666
668
    def test_replace_overflow(self):
667
669
        # Check for overflow checking on 32 bit machines
668
 
        if sys.maxsize != 2147483647 or struct.calcsize("P") > 4:
669
 
            return
670
670
        A2_16 = "A" * (2**16)
671
671
        self.checkraises(OverflowError, A2_16, "replace", "", A2_16)
672
672
        self.checkraises(OverflowError, A2_16, "replace", "A", A2_16)