Skip to content

Commit b7475e4

Browse files
authoredJun 18, 2020
chore: Moving from nose to pytest (#274)
1 parent 93689b9 commit b7475e4

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed
 

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ python:
99
- "pypy"
1010
- "pypy3"
1111
install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt"
12-
script: "nosetests --with-coverage --cover-package=optimizely"
12+
script: "pytest --cov=optimizely"
1313
after_success:
1414
- coveralls
1515

‎README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -163,41 +163,41 @@ install command:
163163

164164
You can run all unit tests with:
165165

166-
nosetests
166+
pytest
167167

168168
#### Running all tests in a file
169169

170170
To run all tests under a particular test file you can use the following
171171
command:
172172

173-
nosetests tests.<file_name_without_extension>
173+
pytest tests.<file_name_without_extension>
174174

175-
For example, to run all tests under `test_event`, the command would be:
175+
For example, to run all tests under `test_event_builder`, the command would be:
176176

177-
nosetests tests.test_event
177+
pytest tests/test_event_builder.py
178178

179179
#### Running all tests under a class
180180

181181
To run all tests under a particular class of tests you can use the
182182
following command:
183183

184-
nosetests tests.<file_name_without_extension>:ClassName
184+
pytest tests/<file_name_with_extension>::ClassName
185185

186-
For example, to run all tests under `test_event.EventTest`, the command
186+
For example, to run all tests under `test_event_builder.EventTest`, the command
187187
would be:
188188

189-
nosetests tests.test_event:EventTest
189+
pytest tests/test_event_builder.py::EventTest
190190

191191
#### Running a single test
192192

193193
To run a single test you can use the following command:
194194

195-
nosetests tests.<file_name_without_extension>:ClassName.test_name
195+
pytest tests/<file_name_with_extension>::ClassName::test_name
196196

197-
For example, to run `test_event.EventTest.test_dispatch`, the command
197+
For example, to run `test_event_builder.EventTest.test_init`, the command
198198
would be:
199199

200-
nosetests tests.test_event:EventTest.test_dispatch
200+
pytest tests/test_event_builder.py::EventTest::test_init
201201

202202
### Contributing
203203

‎requirements/test.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
coverage>=4.0.3
1+
coverage
22
flake8==3.6.0
33
funcsigs==0.4
44
mock==1.3.0
5-
nose==1.3.7
5+
pytest>=4.6.0
6+
pytest-cov
7+
python-coveralls
68
pyyaml==5.2
7-
python-coveralls==2.7.0
8-
tabulate==0.7.5

0 commit comments

Comments
 (0)