Skip to content

Commit

Permalink
Merge pull request #101 from launchdarkly/eb/ch34481/pyyaml-py3.3
Browse files Browse the repository at this point in the history
don't load test dependencies in Python 3.3 that don't work in Python 3.3
  • Loading branch information
eli-darkly authored Mar 26, 2019
2 parents 7738c99 + b3dc4c4 commit bd4daf7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ test-template: &test-template
command: |
sudo pip install --upgrade pip virtualenv;
sudo pip install -r test-requirements.txt;
if [[ "$CIRCLE_JOB" != "test-3.3" ]]; then
sudo pip install -r test-filesource-optional-requirements.txt;
fi;
if [[ "$CIRCLE_JOB" != "test-3.3" ]] && [[ "$CIRCLE_JOB" != "test-3.4" ]]; then
sudo pip install -r consul-requirements.txt;
fi;
Expand Down
2 changes: 2 additions & 0 deletions test-filesource-optional-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyyaml>=3.0
watchdog>=0.9
2 changes: 0 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ jsonpickle==0.9.3
pytest-capturelog>=0.7
pytest-cov>=2.4.0
codeclimate-test-reporter>=0.2.1
pyyaml>=3.0
watchdog>=0.9
9 changes: 9 additions & 0 deletions testing/test_file_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
from ldclient.integrations import Files
from ldclient.versioned_data_kind import FEATURES, SEGMENTS

have_yaml = False
try:
import yaml
have_yaml = True
except ImportError:
pass


all_flag_keys = [ 'flag1', 'flag2' ]
all_properties_json = '''
Expand Down Expand Up @@ -128,6 +135,8 @@ def test_loads_flags_on_start_from_json():
os.remove(path)

def test_loads_flags_on_start_from_yaml():
if not have_yaml:
pytest.skip("skipping file source test with YAML because pyyaml isn't available")
path = make_temp_file(all_properties_yaml)
try:
source = make_data_source(paths = path)
Expand Down

0 comments on commit bd4daf7

Please sign in to comment.