[PATCH 14 of 16 eac] [py3] Use print function in doctests

Denis Laxalde denis.laxalde at logilab.fr
Tue Oct 1 12:36:40 CEST 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1569924686 -7200
#      Tue Oct 01 12:11:26 2019 +0200
# Node ID fdc62496878a3eccff45757983ff5da96d3d0ba1
# Parent  0ab9d4761a6736621e1d360bc649c712e5f5ee3b
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r fdc62496878a
[py3] Use print function in doctests

diff --git a/test/export-roundtrip.rst b/test/export-roundtrip.rst
index b9936b3..22aac2f 100644
--- a/test/export-roundtrip.rst
+++ b/test/export-roundtrip.rst
@@ -3,11 +3,12 @@ A roundtrip export test case
 
 .. code-block:: python
 
+    >>> from __future__ import print_function
     >>> fpath = self.datapath('FRAD033_EAC_00001_simplified_export.xml')
     >>> created, updated = testutils.eac_import(cnx, fpath)
     >>> record = cnx.find('AuthorityRecord', isni=u'22330001300016').one()
     >>> generated_eac = record.cw_adapt_to('EAC-CPF').dump()
-    >>> print generated_eac
+    >>> print(generated_eac)
     <?xml version='1.0' encoding='utf-8'?>
     <eac-cpf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="urn:isbn:1-931666-33-4" xsi:schemaLocation="urn:isbn:1-931666-33-4 http://eac.staatsbibliothek-berlin.de/schema/cpf.xsd">
       <control>
diff --git a/test/export-simple.rst b/test/export-simple.rst
index 8e6eec0..5a81efc 100644
--- a/test/export-simple.rst
+++ b/test/export-simple.rst
@@ -3,6 +3,7 @@ A simple export test case
 
 .. code-block:: python
 
+    >>> from __future__ import print_function
     >>> from cubicweb import Binary
     >>> record = testutils.authority_record(cnx, u'Charlie', record_id=u'666')
     >>> home_addr = cnx.create_entity(
@@ -30,7 +31,7 @@ A simple export test case
     ...     chronological_predecessor=record2, chronological_successor=record,
     ...     xml_wrap=Binary(b'<plip>plop</plip>'))
     >>> cnx.commit()
-    >>> print record.cw_adapt_to('EAC-CPF').dump()
+    >>> print(record.cw_adapt_to('EAC-CPF').dump())
     <?xml version='1.0' encoding='utf-8'?>
     <eac-cpf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="urn:isbn:1-931666-33-4" xsi:schemaLocation="urn:isbn:1-931666-33-4 http://eac.staatsbibliothek-berlin.de/schema/cpf.xsd">
       <control>



More information about the saem-devel mailing list