Skip to content

Commit

Permalink
conda: fix error on test_fromxml_url()
Browse files Browse the repository at this point in the history
  • Loading branch information
juarezr committed Dec 29, 2020
1 parent 21e3c10 commit e35d69e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions petl/test/io/test_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,16 @@ def test_fromxml_6():
def test_fromxml_url():
# check internet connection
try:
url = 'http://raw.githubusercontent.com/petl-developers/petl/master/.pydevproject'
url = 'http://raw.githubusercontent.com/petl-developers/petl/master/petl/test/resources/test.xml'
urlopen(url)
import pkg_resources
filename = pkg_resources.resource_filename('petl', 'test/resources/test.xml')
except Exception as e:
print('SKIP test_fromxml_url: %s' % e, file=sys.stderr)
else:
actual = fromxml(url, 'pydev_property', {'name': ( '.', 'name'), 'prop': '.'})
assert nrows(actual) > 0
expect = fromxml('.pydevproject', 'pydev_property', {'name': ( '.', 'name'), 'prop': '.'})
expect = fromxml(filename, 'pydev_property', {'name': ( '.', 'name'), 'prop': '.'})
ieq(expect, actual)


Expand Down
10 changes: 10 additions & 0 deletions petl/test/resources/test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>

<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/petl/src</path>
</pydev_pathproperty>
</pydev_project>

0 comments on commit e35d69e

Please sign in to comment.