Rename testX.py to test_X.py to make py.test work out of the box
This rename makes py.test/py.test-3 find the test suite out of the
box. Example command lines:
# Running the test suite (optionally include "-v")
$ py.test-3
# Running the test suite with coverage enabled (and branch
# coverage).
$ py.test-3 --cov=scour --cov-report=html --cov-branch
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
dd2155e576
commit
7abb6af7b5
5 changed files with 6 additions and 6 deletions
|
|
@ -23,7 +23,7 @@ In order to check functionality of Scour and prevent any regressions in existing
|
||||||
make test
|
make test
|
||||||
```
|
```
|
||||||
|
|
||||||
These tests are run automatically on all PRs using [TravisCI](https://travis-ci.org/scour-project/scour) and have to pass at all times! When you add new functionality you should always include suitable tests with your PR (see [`testscour.py`](https://github.com/scour-project/scour/blob/master/testscour.py)).
|
These tests are run automatically on all PRs using [TravisCI](https://travis-ci.org/scour-project/scour) and have to pass at all times! When you add new functionality you should always include suitable tests with your PR (see [`test_scour.py`](https://github.com/scour-project/scour/blob/master/test_scour.py)).
|
||||||
|
|
||||||
### Coverage
|
### Coverage
|
||||||
|
|
||||||
|
|
|
||||||
6
Makefile
6
Makefile
|
|
@ -22,7 +22,7 @@ check: test flake8
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
python testscour.py
|
python test_scour.py
|
||||||
|
|
||||||
test_version:
|
test_version:
|
||||||
PYTHONPATH=. python -m scour.scour --version
|
PYTHONPATH=. python -m scour.scour --version
|
||||||
|
|
@ -34,6 +34,6 @@ flake8:
|
||||||
flake8 --max-line-length=119
|
flake8 --max-line-length=119
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
coverage run --source=scour testscour.py
|
coverage run --source=scour test_scour.py
|
||||||
coverage html
|
coverage html
|
||||||
coverage report
|
coverage report
|
||||||
|
|
|
||||||
|
|
@ -2774,7 +2774,7 @@ class ViewBox(unittest.TestCase):
|
||||||
# TODO: write tests for --keep-editor-data
|
# TODO: write tests for --keep-editor-data
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
testcss = __import__('testcss')
|
testcss = __import__('test_css')
|
||||||
scour = __import__('__main__')
|
scour = __import__('__main__')
|
||||||
suite = unittest.TestSuite(list(map(unittest.defaultTestLoader.loadTestsFromModule, [testcss, scour])))
|
suite = unittest.TestSuite(list(map(unittest.defaultTestLoader.loadTestsFromModule, [testcss, scour])))
|
||||||
unittest.main(defaultTest="suite")
|
unittest.main(defaultTest="suite")
|
||||||
2
tox.ini
2
tox.ini
|
|
@ -18,7 +18,7 @@ deps =
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
scour --version
|
scour --version
|
||||||
coverage run --parallel-mode --source=scour testscour.py
|
coverage run --parallel-mode --source=scour test_scour.py
|
||||||
|
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue