• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(13)  |  Call(0)  |  Derive(0)  |  Import(13)
int(x[, base]) -> integer

Convert a string or number to an integer, if possible.  A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!)  When converting a string, use
the optional base.  It is an error to supply a base when converting a
non-string.  If base is zero, the proper base is guessed based on the
string content.  If the argument is outside the integer range a
long object will be returned instead.

src/z/o/zope.testing-3.10.0/src/zope/testing/doctest/__init__.py   zope.testing(Download)
 
# Option constants.
 
from doctest import register_optionflag, \
    OPTIONFLAGS_BY_NAME, \
    DONT_ACCEPT_TRUE_FOR_1, \
    DONT_ACCEPT_BLANKLINE, \
    def _do_a_fancy_diff(self, want, got, optionflags):
        # Not unless they asked for a fancy diff.
        if not optionflags & (REPORT_UDIFF |
                              REPORT_CDIFF |
                              REPORT_NDIFF):
            return False
 
 
        # ndiff does intraline difference marking, so can be useful even
        # for 1-line differences.
        if optionflags & REPORT_NDIFF:
            return True
 
        # The other diff types need at least a few lines to be helpful.
                diff = difflib.context_diff(want_lines, got_lines, n=2)
                diff = list(diff)[2:] # strip the diff header
                kind = 'context diff with expected followed by actual'
            elif optionflags & REPORT_NDIFF:
                engine = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK)
                diff = list(engine.compare(want_lines, got_lines))
                kind = 'ndiff with -expected +actual'

src/m/a/mailman-HEAD/trunk/mailman/Mailman/testing/test_replybot.py   mailman(Download)
 
options = (doctest.ELLIPSIS
           | doctest.NORMALIZE_WHITESPACE
           | doctest.REPORT_NDIFF)
 
 
def test_suite():

src/m/a/mailman-HEAD/trunk/mailman/Mailman/testing/test_decorate.py   mailman(Download)
 
options = (doctest.ELLIPSIS
           | doctest.NORMALIZE_WHITESPACE
           | doctest.REPORT_NDIFF)
 
 
def test_suite():

src/m/a/mailman-HEAD/mailman/Mailman/testing/test_replybot.py   mailman(Download)
 
options = (doctest.ELLIPSIS
           | doctest.NORMALIZE_WHITESPACE
           | doctest.REPORT_NDIFF)
 
 
def test_suite():

src/m/a/mailman-HEAD/mailman/Mailman/testing/test_decorate.py   mailman(Download)
 
options = (doctest.ELLIPSIS
           | doctest.NORMALIZE_WHITESPACE
           | doctest.REPORT_NDIFF)
 
 
def test_suite():

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/_doctest.py   zope.testrunner(Download)
 
        reporting_flags = 0
        if options.ndiff:
            reporting_flags = doctest.REPORT_NDIFF
        if options.udiff:
            if reporting_flags:
                output.error("Can only give one of --ndiff, --udiff, or --cdiff")

src/z/o/zope.formlib-4.0.5/src/zope/formlib/tests/test_sequencewidget.py   zope.formlib(Download)
def test_suite():
    return unittest.TestSuite((
        unittest.makeSuite(SequenceWidgetTest),
        doctest.DocTestSuite(setUp=setUp, tearDown=tearDown,
                             optionflags=doctest.ELLIPSIS
                             |doctest.NORMALIZE_WHITESPACE
                             |doctest.REPORT_NDIFF),

src/z/o/zope.component-3.10.0/src/zope/component/tests.py   zope.component(Download)
        doctest.DocFileSuite('testlayer.txt',
                             optionflags=(doctest.ELLIPSIS +
                                          doctest.NORMALIZE_WHITESPACE +
                                          doctest.REPORT_NDIFF)),
        zcml_conditional,
        hooks_conditional,
        unittest.makeSuite(StandaloneTests),

src/z/o/zope.app.testing-3.8.0/src/zope/app/testing/functional.py   zope.app.testing(Download)
        doctest.set_unittest_reportflags(old)
        kw['optionflags'] = (old
                             | doctest.ELLIPSIS
                             | doctest.REPORT_NDIFF
                             | doctest.NORMALIZE_WHITESPACE)
 

src/z/o/zope.app.appsetup-3.15.0/src/zope/app/appsetup/tests.py   zope.app.appsetup(Download)
        'testlayer.txt',
         optionflags=(doctest.ELLIPSIS +
                      doctest.NORMALIZE_WHITESPACE +
                      doctest.REPORT_NDIFF)))
 
    return suite
 

  1 | 2 | 3 | 4 | 5  Next