Skip to content

Commit

Permalink
Split tests for os
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca authored and kalefranz committed Sep 3, 2018
1 parent ce7346d commit 345684f
Showing 1 changed file with 45 additions and 24 deletions.
69 changes: 45 additions & 24 deletions tests/core/test_python_dist.py
Original file line number Diff line number Diff line change
@@ -676,31 +676,9 @@ def test_python_dist_egg_fpath():

# Prefix Data
# -----------------------------------------------------------------------------
def test_pip_interop():
@pytest.mark.skipif(os.name != 'nt', reason="Windows tests")
def test_pip_interop_windows():
test_cases = (
# OSX
(PATH_TEST_ENV_1,
('asn1crypto', 'babel', 'backports-functools-lru-cache', 'cffi', 'chardet',
'cheroot', 'cherrypy', 'configparser', 'cryptography', 'cssselect', 'dask',
'django', 'django-phonenumber-field', 'django-twilio', 'entrypoints',
'enum34', 'h5py', 'idna', 'ipaddress', 'jaraco-functools', 'lxml',
'more-itertools', 'numpy', 'parsel', 'phonenumberslite', 'pip', 'pluggy',
'portend', 'py', 'pycparser', 'pyjwt', 'pyopenssl', 'pytz', 'queuelib',
'requests', 'scrapy', 'service-identity', 'six', 'tempora', 'tox', 'twisted',
'urllib3', 'virtualenv', 'w3lib')
),
(PATH_TEST_ENV_2,
('asn1crypto', 'attrs', 'automat', 'babel', 'backports-functools-lru-cache',
'cffi', 'chardet', 'cheroot', 'cherrypy', 'constantly', 'cryptography',
'cssselect', 'dask', 'django', 'django-phonenumber-field', 'django-twilio',
'entrypoints', 'h5py', 'hdf5storage', 'hyperlink', 'idna', 'incremental',
'jaraco-functools', 'keyring', 'lxml', 'more-itertools', 'numpy', 'parsel',
'phonenumberslite', 'pip', 'pluggy', 'portend', 'py', 'pyasn1', 'pyasn1-modules',
'pycparser', 'pydispatcher', 'pyhamcrest', 'pyjwt', 'pyopenssl', 'pysocks', 'pytz',
'queuelib', 'requests', 'scrapy', 'service-identity', 'six', 'tempora', 'tox',
'twilio', 'twisted', 'urllib3', 'virtualenv', 'w3lib', 'zope-interface')
),
# Windows
(PATH_TEST_ENV_3,
('babel', 'backports-functools-lru-cache', 'chardet', 'cheroot', 'cherrypy',
'cssselect', 'dask', 'django', 'django-phonenumber-field', 'django-twilio',
@@ -739,3 +717,46 @@ def test_pip_interop():
for record_name in expected_output:
_print_output(record_name)
assert record_name in record_names


@pytest.mark.skipif(os.name == 'nt', reason="Windows tests")
def test_pip_interop_osx():
test_cases = (
(PATH_TEST_ENV_1,
('asn1crypto', 'babel', 'backports-functools-lru-cache', 'cffi', 'chardet',
'cheroot', 'cherrypy', 'configparser', 'cryptography', 'cssselect', 'dask',
'django', 'django-phonenumber-field', 'django-twilio', 'entrypoints',
'enum34', 'h5py', 'idna', 'ipaddress', 'jaraco-functools', 'lxml',
'more-itertools', 'numpy', 'parsel', 'phonenumberslite', 'pip', 'pluggy',
'portend', 'py', 'pycparser', 'pyjwt', 'pyopenssl', 'pytz', 'queuelib',
'requests', 'scrapy', 'service-identity', 'six', 'tempora', 'tox', 'twisted',
'urllib3', 'virtualenv', 'w3lib')
),
(PATH_TEST_ENV_2,
('asn1crypto', 'attrs', 'automat', 'babel', 'backports-functools-lru-cache',
'cffi', 'chardet', 'cheroot', 'cherrypy', 'constantly', 'cryptography',
'cssselect', 'dask', 'django', 'django-phonenumber-field', 'django-twilio',
'entrypoints', 'h5py', 'hdf5storage', 'hyperlink', 'idna', 'incremental',
'jaraco-functools', 'keyring', 'lxml', 'more-itertools', 'numpy', 'parsel',
'phonenumberslite', 'pip', 'pluggy', 'portend', 'py', 'pyasn1', 'pyasn1-modules',
'pycparser', 'pydispatcher', 'pyhamcrest', 'pyjwt', 'pyopenssl', 'pysocks', 'pytz',
'queuelib', 'requests', 'scrapy', 'service-identity', 'six', 'tempora', 'tox',
'twilio', 'twisted', 'urllib3', 'virtualenv', 'w3lib', 'zope-interface')
),
)

for path, expected_output in test_cases:
if os.path.isdir(path):
prefixdata = PrefixData(path, pip_interop_enabled=True)
prefixdata.load()
records = prefixdata._load_site_packages()
record_names = tuple(sorted(records.keys()))
print('RECORDS', record_names)
assert len(record_names), len(expected_output)
_print_output(expected_output, record_names)
for record_name in record_names:
_print_output(record_name)
assert record_name in expected_output
for record_name in expected_output:
_print_output(record_name)
assert record_name in record_names

0 comments on commit 345684f

Please sign in to comment.