Skip to content

Commit

Permalink
Add functional tests for new files
Browse files Browse the repository at this point in the history
  • Loading branch information
drasmuss committed May 7, 2019
1 parent f126ea8 commit 7ffe9dc
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 6 deletions.
36 changes: 32 additions & 4 deletions .nengobones.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ travis_yml:
env:
TEST_LOCAL_VAR: test local var val
test_args: --test-arg
- script: test
- script: test-nengo
env:
TEST_LOCAL_VAR: test local var val
test_args: --test-arg
test_args: --test-arg -p nengo.tests.options
python: 3.7
dist: xenial
pypi_user: drasmuss
Expand All @@ -49,13 +49,25 @@ ci_scripts:
post_commands:
- export TEST_POST_COMMANDS=True
- template: test
output_name: test-coverage
coverage: true
pre_commands:
- cat .ci/test-coverage.sh
- export TEST_PRE_COMMANDS=True
post_commands:
- export TEST_POST_COMMANDS=True
coverage: true
output_name: test-coverage
- template: test
output_name: test-nengo
nengo_tests: true
pip_install:
# TODO: update this to release version once there is one with the
# nengo_test_unsupported config
- git+https://github.com/nengo/nengo#egg=nengo[tests]
pre_commands:
- cat .ci/test-nengo.sh
- export TEST_PRE_COMMANDS=True
post_commands:
- export TEST_POST_COMMANDS=True
- template: docs
pre_commands:
- cat .ci/docs.sh
Expand Down Expand Up @@ -108,11 +120,27 @@ setup_py:
setup_cfg:
pytest:
addopts: []
norecursedirs:
- tests/ignoreme
markers:
test-marker:
Not a real
marker
nengo_test_unsupported:
nengo/tests/*:
All nengo tests are
unsupported
coverage:
exclude_lines:
- "if __name__ == .__main__.:"
omit_files:
- tests/utils.py
flake8:
exclude:
- nengo_bones/tests/ignoreme
pylint:
ignore:
- nengo_bones/tests/ignoreme

docs_conf_py:
exclude_patterns:
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
-
env:
TEST_LOCAL_VAR="test local var val"
SCRIPT="test"
TEST_ARGS="--test-arg"
SCRIPT="test-nengo"
TEST_ARGS="--test-arg -p nengo.tests.options"
python: 3.7
dist: xenial
- stage: deploy
Expand Down
Empty file.
8 changes: 8 additions & 0 deletions nengo_bones/tests/ignoreme/ignoreme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# this will trigger a pylint unused-import error
import nengo_bones

# this will trigger a flake8 whitespace end of line error
str = """
abc
de
"""
5 changes: 5 additions & 0 deletions nengo_bones/tests/ignoreme/test_norecurse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def test_norecurse():
# if the setup.cfg norecursedirs option is working properly, then this
# test should never be run

assert False
5 changes: 5 additions & 0 deletions nengo_bones/tests/test_generate_bones.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,11 @@ def test_setup_cfg_valueerror(tmpdir):
assert_exit(result, 1)


def test_setup_cfg_custom_marker(pytestconfig):
# this marker is added in the setup.cfg file
assert "test-marker: Not a real marker" in pytestconfig.getini("markers")


def test_docs_conf_py(tmpdir):
write_file(tmpdir, ".nengobones.yml", """
project_name: Dummy
Expand Down
9 changes: 9 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ omit =
[flake8]
exclude =
__init__.py
nengo_bones/tests/ignoreme
ignore =
E123
E133
Expand All @@ -53,10 +54,18 @@ norecursedirs =
build
dist
docs
tests/ignoreme
markers =
test-marker: Not a real marker
nengo_test_unsupported =
nengo/tests/*
"All nengo tests are unsupported"

[pylint]
# note: pylint doesn't look in setup.cfg by default, need to call it with
# `pylint ... --rcfile=setup.cfg`
ignore =
nengo_bones/tests/ignoreme,
disable =
arguments-differ,
assignment-from-no-return,
Expand Down

0 comments on commit 7ffe9dc

Please sign in to comment.