Skip to content

Commit ba7794b

Browse files
committed
Add pytest to CI
pytest on travis initially required `sudo=required` otherwise failed. Without the sudo flag pytest wasn't being upgraded. Needed to force upgrade. pytest-dev/pytest#2240
1 parent a5d325f commit ba7794b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
sudo: false
22

3+
# language: csharp installs mono/dotnet but has limited python.
34
language: python
45
python:
56
- 2.7
@@ -29,12 +30,13 @@ addons:
2930
- ca-certificates-mono
3031

3132
install:
32-
- pip install pycparser coverage codecov
33+
- pip install --upgrade pycparser coverage codecov pytest
34+
# setup.py install works too, but need to deal w Python.test then
3335
- coverage run setup.py build_ext --inplace
3436

3537
script:
3638
- export PYTHONPATH=`pwd`:$PYTHONPATH
37-
- python src/tests/runtests.py
39+
- python -m pytest
3840
# - mono ./packages/NUnit.*/tools/nunit-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll
3941

4042
after_success:

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ init:
4848

4949
install:
5050
# install for wheels & coverage
51-
- pip install --upgrade pip wheel coverage codecov
51+
- pip install --upgrade pip wheel coverage codecov pytest
5252

5353
# Install OpenCover. Can't put on packages.config; not Linux/Mono compatible
5454
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages

ci/appveyor_run_tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $RUNTIME_DIR = ".\src\runtime\bin\"
1414
# why `2>&1 | %{ "$_" }`? see: http://stackoverflow.com/a/20950421/5208670
1515
Write-Host ("Starting Python tests") -ForegroundColor "Green"
1616
.$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:py.coverage `
17-
-target:"$PY" -targetargs:src\tests\runtests.py `
17+
-target:"$PY" -targetargs:"-m pytest" `
1818
-returntargetcode `
1919
2>&1 | %{ "$_" }
2020
$PYTHON_STATUS = $LastExitCode

0 commit comments

Comments
 (0)