Skip to content

Commit

Permalink
Simplify test_consistency logic
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Sep 11, 2018
1 parent 585d1fb commit b3a9b46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ dependencies:
- bokeh >=0.12.3
- numba
- toolz
- pytest
- pytest-pep8
- pytest-xdist
- mock
- pep8
- pycodestyle
- pylint
- coverage
- pytest-pep8
- pytest-xdist
22 changes: 6 additions & 16 deletions taxcalc/tests/test_4package.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,15 @@ def test_for_consistency(tests_path):
"""
Ensure that there is consistency between environment.yml dependencies
and conda.recipe/meta.yaml requirements.
It is OK if only environment.yml contains the development packages
included in the dev_pkgs set.
It is also OK if only conda.recipe/meta.yaml contains the run packages
included in the run_pkgs set.
"""
dev_pkgs = set([
'pytest',
'pytest-pep8',
'pytest-xdist',
'mock',
'pep8',
'pycodestyle',
'pylint',
'coverage',
'pytest-pep8',
'pytest-xdist'
])
run_pkgs = set([
'python'
'coverage'
])
# read conda.recipe/meta.yaml requirements
meta_file = os.path.join(tests_path, '..', '..',
Expand All @@ -61,9 +54,6 @@ def test_for_consistency(tests_path):
with open(envr_file, 'r') as stream:
envr = yaml.load(stream)
env = set(envr['dependencies'])
# confirm all extras in env are in dev_pkgs set
# confirm that extras in env (relative to run) equal the dev_pkgs set
extras = env - run
assert extras <= dev_pkgs
# confirm all extras in run are in run_pkgs set
extras = run - env
assert extras <= run_pkgs
assert extras == dev_pkgs

0 comments on commit b3a9b46

Please sign in to comment.