diff --git a/.travis.yml b/.travis.yml index 8ae93ba2..c45faaf8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ python: - "pypy" - "pypy3" install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt" -script: "nosetests --with-coverage --cover-package=optimizely" +script: "pytest --cov=optimizely" after_success: - coveralls diff --git a/README.md b/README.md index 0bd1d87b..ab4db393 100644 --- a/README.md +++ b/README.md @@ -163,41 +163,41 @@ install command: You can run all unit tests with: - nosetests + pytest #### Running all tests in a file To run all tests under a particular test file you can use the following command: - nosetests tests. + pytest tests. -For example, to run all tests under `test_event`, the command would be: +For example, to run all tests under `test_event_builder`, the command would be: - nosetests tests.test_event + pytest tests/test_event_builder.py #### Running all tests under a class To run all tests under a particular class of tests you can use the following command: - nosetests tests.:ClassName + pytest tests/::ClassName -For example, to run all tests under `test_event.EventTest`, the command +For example, to run all tests under `test_event_builder.EventTest`, the command would be: - nosetests tests.test_event:EventTest + pytest tests/test_event_builder.py::EventTest #### Running a single test To run a single test you can use the following command: - nosetests tests.:ClassName.test_name + pytest tests/::ClassName::test_name -For example, to run `test_event.EventTest.test_dispatch`, the command +For example, to run `test_event_builder.EventTest.test_init`, the command would be: - nosetests tests.test_event:EventTest.test_dispatch + pytest tests/test_event_builder.py::EventTest::test_init ### Contributing diff --git a/requirements/test.txt b/requirements/test.txt index 9b3e780f..e56cf624 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,8 +1,8 @@ -coverage>=4.0.3 +coverage flake8==3.6.0 funcsigs==0.4 mock==1.3.0 -nose==1.3.7 +pytest>=4.6.0 +pytest-cov +python-coveralls pyyaml==5.2 -python-coveralls==2.7.0 -tabulate==0.7.5