Skip to content

Commit ef6a962

Browse files
authored
Fix template in GHA (#57)
1 parent 8d0a32f commit ef6a962

7 files changed

Lines changed: 29 additions & 77 deletions

File tree

.github/workflows/main.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
os: [ubuntu-latest]
1616
include:
1717
- python: "2.7"
18-
tox_env: "py27"
18+
tox_env: "py27-pytestlatest"
1919
- python: "3.5"
20-
tox_env: "py35"
20+
tox_env: "py35-pytestlatest"
2121
- python: "3.6"
22-
tox_env: "py36"
22+
tox_env: "py36-pytestlatest"
2323
- python: "3.7"
24-
tox_env: "py37"
24+
tox_env: "py37-pytestlatest"
2525
- python: "3.8"
26-
tox_env: "py38"
26+
tox_env: "py38-pytestlatest py38-pytest53"
2727

2828
steps:
2929
- uses: actions/checkout@v1
@@ -33,21 +33,24 @@ jobs:
3333
python-version: ${{ matrix.python }}
3434
- name: Install GoogleTest
3535
run: |
36-
wget https://github.com/google/googletest/archive/release-{{ matrix.gtest_ver }}.tar.gz
37-
tar -zxvf release-{{ matrix.gtest_ver }}.tar.gz
38-
cd googletest-release-{{ matrix.gtest_ver }}/googletest
39-
cmake .
40-
sudo make install
36+
wget https://github.com/google/googletest/archive/release-${{ matrix.gtest_ver }}.tar.gz
37+
tar -zxvf release-${{ matrix.gtest_ver }}.tar.gz
38+
cd googletest-release-${{ matrix.gtest_ver }}/googletest
39+
cmake .
40+
sudo make install
4141
- name: Install Boost.Test
4242
run: |
43-
sudo apt-get install libboost-test-dev valgrind
44-
- name: Install Python Deps
43+
sudo apt-get install libboost-test-dev valgrind
44+
- name: Compile
4545
run: |
4646
python -m pip install --upgrade pip
47-
pip install tox scons
47+
pip install scons
48+
scons -j4 -C tests
49+
- name: Install Tox
50+
run: |
51+
pip install tox
4852
- name: Test
4953
run: |
50-
scons -j4 -C tests
5154
tox -e ${{ matrix.tox_env }}
5255
5356
linting:

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Supports both `Google Test <https://code.google.com/p/googletest>`_ and
1717
.. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-cpp.svg
1818
:target: https://anaconda.org/conda-forge/pytest-cpp
1919

20-
.. |ci| image:: http://img.shields.io/travis/pytest-dev/pytest-cpp.png
21-
:target: https://travis-ci.org/pytest-dev/pytest-cpp
20+
.. |ci| image:: https://github.com/pytest-dev/pytest-cpp/workflows/build/badge.svg
21+
:target: https://github.com/pytest-dev/pytest-cpp/actions
2222

2323
.. |coverage| image:: http://img.shields.io/coveralls/pytest-dev/pytest-cpp.png
2424
:target: https://coveralls.io/r/pytest-dev/pytest-cpp

tests/acceptance/boosttest-samples/unit_test_example_09_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct MyConfig {
2020
};
2121

2222
// structure MyConfig is used as a global fixture - it's invoked pre and post any testing is performed
23-
BOOST_GLOBAL_FIXTURE( MyConfig )
23+
BOOST_TEST_GLOBAL_FIXTURE( MyConfig );
2424

2525
//____________________________________________________________________________//
2626

tests/acceptance/boosttest-samples/unit_test_example_09_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct MyConfig2 {
2121
};
2222

2323
// structure MyConfig2 is used as a global fixture. You could have any number of global fxtures
24-
BOOST_GLOBAL_FIXTURE( MyConfig2 )
24+
BOOST_TEST_GLOBAL_FIXTURE( MyConfig2 );
2525

2626
//____________________________________________________________________________//
2727

tests/test_pytest_cpp.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ def test_boost_failure(exes):
129129

130130
fail1, fail2 = failures
131131
colors = ("red", "bold")
132-
assert fail1.get_lines() == [("check 2 * 3 == 5 failed", colors)]
132+
assert fail1.get_lines() == [("check 2 * 3 == 5 has failed", colors)]
133133
assert fail1.get_file_reference() == ("boost_failure.cpp", 9)
134134

135-
assert fail2.get_lines() == [("check 2 - 1 == 0 failed", colors)]
135+
assert fail2.get_lines() == [("check 2 - 1 == 0 has failed", colors)]
136136
assert fail2.get_file_reference() == ("boost_failure.cpp", 15)
137137

138138

@@ -143,7 +143,7 @@ def test_boost_fatal_error(exes):
143143

144144
(fail1,) = failures
145145
colors = ("red", "bold")
146-
assert fail1.get_lines() == [("critical check 2 * 3 == 5 failed", colors)]
146+
assert fail1.get_lines() == [("critical check 2 * 3 == 5 has failed", colors)]
147147
assert fail1.get_file_reference() == ("boost_fatal_error.cpp", 8)
148148

149149

@@ -170,12 +170,9 @@ def test_boost_fixture_setup_error(exes):
170170

171171
fail1 = failures[0]
172172
colors = ("red", "bold")
173-
assert fail1.get_lines() == [
174-
(
175-
"Test setup error: std::runtime_error: This is a global fixture init failure",
176-
colors,
177-
)
178-
]
173+
((line, obtained_colors),) = fail1.get_lines()
174+
assert line.startswith("Test setup error")
175+
assert obtained_colors == colors
179176
assert fail1.get_file_reference() == ("unknown location", 0)
180177

181178

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,35,36,37,38,38}-pytestlatest,py38-pytest53
2+
envlist = py{27,35,36,37,38}-pytestlatest,py38-pytest53
33

44
[testenv]
55
deps=
@@ -10,7 +10,7 @@ deps=
1010
pytest-mock
1111
coverage
1212
commands=
13-
coverage run --source=pytest_cpp -m pytest tests
13+
pytest tests
1414
pytest -n8 tests
1515

1616
[testenv:linting]

0 commit comments

Comments
 (0)