Skip to content

Commit

Permalink
Fix tests for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca authored and kalefranz committed Sep 3, 2018
1 parent 5eab884 commit e6f953e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
6 changes: 5 additions & 1 deletion conda/core/python_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import csv
import email.parser
import fnmatch
import io
import os
import re
import warnings
Expand Down Expand Up @@ -277,7 +278,9 @@ def _read_metadata(cls, fpath):
if fpath and isfile(fpath):
parser = email.parser.HeaderParser()

with open(fpath, 'r') as fp:
# FIXME: Is this a correct assumption for the encoding?
# This was needed due to some errors on windows
with io.open(fpath, 'r', encoding='utf-8') as fp:
data = parser.parse(fp)

return cls._message_to_dict(data)
Expand Down Expand Up @@ -1014,6 +1017,7 @@ def get_python_distribution_info(anchor_file, prefix_path):

# An egg-link might reference a folder where egg-info is not available
if dist_file is not None:
pydist = dist_cls(dist_file)
try:
pydist = dist_cls(dist_file)
except Exception as error:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# `python setup.py install`
PATH_TEST_ENV_1 = os.path.join(HERE, 'envpy27osx')
PATH_TEST_ENV_2 = os.path.join(HERE, 'envpy37osx_whl')
PATH_TEST_ENV_3 = os.path.join(HERE, 'envpy27win')
PATH_TEST_ENV_4 = os.path.join(HERE, 'envpy37win_whl')
PATH_TEST_ENV_3 = os.path.join(HERE, 'envpy37win')
PATH_TEST_ENV_4 = os.path.join(HERE, 'envpy27win_whl')

METADATA_241_PATH = os.path.join(HERE, 'metadata', 'pep241', 'PKG-INFO')
METADATA_314_PATH = os.path.join(HERE, 'metadata', 'pep314', 'PKG-INFO')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 17 additions & 2 deletions tests/core/test_python_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,25 @@ def test_pip_interop():
),
# Windows
(PATH_TEST_ENV_3,
()
('babel', 'backports-functools-lru-cache', 'chardet', 'cheroot', 'cherrypy',
'cssselect', 'dask', 'django', 'django-phonenumber-field', 'django-twilio',
'entrypoints', 'h5py', 'idna', 'jaraco-functools', 'lxml', 'more-itertools',
'numpy', 'parsel', 'phonenumberslite', 'pluggy', 'portend', 'py', 'pyjwt',
'pyopenssl', 'pytz', 'pywin32', 'pywin32-ctypes', 'queuelib', 'requests',
'scrapy', 'service-identity', 'six', 'tempora', 'tox', 'urllib3', 'virtualenv',
'w3lib')
),
(PATH_TEST_ENV_4,
()
('asn1crypto', 'attrs', 'automat', 'babel', 'backports-functools-lru-cache',
'cffi', 'chardet', 'cheroot', 'cherrypy', 'configparser', 'constantly',
'cryptography', 'cssselect', 'dask', 'django', 'django-phonenumber-field',
'django-twilio', 'entrypoints', 'enum34', 'functools32', 'h5py', 'hdf5storage',
'hyperlink', 'idna', 'incremental', 'ipaddress', 'jaraco-functools', 'keyring',
'lxml', 'more-itertools', 'numpy', 'parsel', 'phonenumberslite', 'pluggy',
'portend', 'py', 'pyasn1', 'pyasn1-modules', 'pycparser', 'pydispatcher',
'pyhamcrest', 'pyjwt', 'pyopenssl', 'pytz', 'pywin32', 'pywin32-ctypes',
'queuelib', 'requests', 'scrapy', 'service-identity', 'six', 'tempora', 'tox',
'twilio', 'twisted', 'urllib3', 'virtualenv', 'w3lib', 'zope-interface')
),
)

Expand Down

0 comments on commit e6f953e

Please sign in to comment.