From a15acb3e4e254d58d01d61f97bb96f41a925ec4f Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 17 May 2020 17:55:24 +0000 Subject: [PATCH] Rename testX.py to test_X.py to make py.test work out of the box (#181) 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 --- CONTRIBUTING.md | 2 +- Makefile | 6 +++--- testcss.py => test_css.py | 0 testscour.py => test_scour.py | 2 +- tox.ini | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename testcss.py => test_css.py (100%) rename testscour.py => test_scour.py (99%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b239cc..b34dbf1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ In order to check functionality of Scour and prevent any regressions in existing 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 diff --git a/Makefile b/Makefile index 52323c1..09389b5 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ check: test flake8 test: - python testscour.py + python test_scour.py test_version: PYTHONPATH=. python -m scour.scour --version @@ -34,6 +34,6 @@ flake8: flake8 --max-line-length=119 coverage: - coverage run --source=scour testscour.py + coverage run --source=scour test_scour.py coverage html - coverage report \ No newline at end of file + coverage report diff --git a/testcss.py b/test_css.py similarity index 100% rename from testcss.py rename to test_css.py diff --git a/testscour.py b/test_scour.py similarity index 99% rename from testscour.py rename to test_scour.py index d9a460b..6c4c7ce 100755 --- a/testscour.py +++ b/test_scour.py @@ -2774,7 +2774,7 @@ class ViewBox(unittest.TestCase): # TODO: write tests for --keep-editor-data if __name__ == '__main__': - testcss = __import__('testcss') + testcss = __import__('test_css') scour = __import__('__main__') suite = unittest.TestSuite(list(map(unittest.defaultTestLoader.loadTestsFromModule, [testcss, scour]))) unittest.main(defaultTest="suite") diff --git a/tox.ini b/tox.ini index b1b36b0..238864d 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = commands = scour --version - coverage run --parallel-mode --source=scour testscour.py + coverage run --parallel-mode --source=scour test_scour.py [testenv:flake8]