[Git][reproducible-builds/diffoscope][master] 2 commits: Update XML test for Python 3.8+.

Chris Lamb gitlab at salsa.debian.org
Wed Nov 13 13:07:01 UTC 2019



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
06d11ddb by Chris Lamb at 2019-11-13T13:06:44Z
Update XML test for Python 3.8+.

- - - - -
b1054fcc by Chris Lamb at 2019-11-13T13:06:44Z
Don't use line-base dbuffering when communucating with subprocesses in binary mode. (Closes: reproducible-builds/diffoscope#75)

- - - - -


3 changed files:

- diffoscope/diff.py
- tests/comparators/test_xml.py
- tests/data/test_xml_expected_diff


Changes:

=====================================
diffoscope/diff.py
=====================================
@@ -175,9 +175,7 @@ def run_diff(fifo1, fifo2, end_nl_q1, end_nl_q2):
 
     logger.debug("Running %s", ' '.join(cmd))
 
-    p = subprocess.run(
-        cmd, bufsize=1, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
-    )
+    p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 
     parser = DiffParser(p.stdout, end_nl_q1, end_nl_q2)
     parser.parse()


=====================================
tests/comparators/test_xml.py
=====================================
@@ -17,6 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
+import sys
 import pytest
 
 from diffoscope.comparators.xml import XMLFile
@@ -46,6 +47,7 @@ def differences(xml_a, xml_b):
     return xml_a.compare(xml_b).details
 
 
+ at pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
 def test_diff(differences):
     expected_diff = get_data('test_xml_expected_diff')
     assert differences[0].unified_diff == expected_diff


=====================================
tests/data/test_xml_expected_diff
=====================================
@@ -1,8 +1,8 @@
 @@ -1,9 +1,9 @@
  <?xml version="1.0" encoding="utf-8"?>
  <note>
-   <style id="night-mode-pro-style" type="text/css"/>
-   <link id="night-mode-pro-link" rel="stylesheet" type="text/css"/>
+   <style type="text/css" id="night-mode-pro-style"/>
+   <link type="text/css" rel="stylesheet" id="night-mode-pro-link"/>
 -  <to>Tove</to>
 -  <from>Jani</from>
 -  <heading>Reminder</heading>



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/4a003697b57539c763b92fd48295dbdaec16960f...b1054fccffeabae4237f619bc8c94e570674eac8

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/4a003697b57539c763b92fd48295dbdaec16960f...b1054fccffeabae4237f619bc8c94e570674eac8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20191113/c94065d5/attachment.htm>


More information about the rb-commits mailing list