Skip to content

Commit

Permalink
testing tox
Browse files Browse the repository at this point in the history
  • Loading branch information
manuphatak committed May 18, 2015
1 parent a7b62ba commit c3ed990
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ install:
- pip install coveralls

env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py32
- TOXENV=py33
- TOXENV=py34
- TOXENV=pypy
script:
- tox
- tox -e $TOXENV
- coverage run --source=json_config setup.py test
after_success:
coveralls
7 changes: 5 additions & 2 deletions test/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_config_file_fixture(sample_config_file):
def test_loads_json_file_returns_dict_like_obj(config):
assert config['test'] == 'success'


@pytest.mark.skipif
def test_abc_magic_methods_length():
# assert len(config) == 10
Expand Down Expand Up @@ -162,18 +163,19 @@ def test_throws_error_if_nesting_lists_and_dicts(config):
pass


def test_multiple_configs(tmpdir):
def test_multiple_configs(tmpdir, empty_config):
import json_config

a = json_config.connect(tmpdir.join('unique_file_a.json').strpath)
b = json_config.connect(tmpdir.join('unique_file_b.json').strpath)

a['test'] = 'A success'
b['test'] = 'B success'
empty_config['unique'] = 'empty_config success'

assert a['test'] == 'A success'
assert b['test'] == 'B success'
assert not a == b
assert a is not b

a_actual = json.load(open(tmpdir.join('unique_file_a.json').strpath))
b_actual = json.load(open(tmpdir.join('unique_file_b.json').strpath))
Expand All @@ -188,6 +190,7 @@ def test_save_config_is_only_called_once(config, mock_write):

assert mock_write.call_count == 1


@pytest.mark.xfail
def test_save_config_is_only_called_once_for_nested_set(config, mock_write):
assert mock_write.call_count == 0
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py34, pypy, docs
envlist = py26, py27, py32, py33, py34, pypy, docs
basepython=python2.7

[testenv]
Expand Down

0 comments on commit c3ed990

Please sign in to comment.