aboutsummaryrefslogtreecommitdiff
path: root/tests/test_bind_interface.py
diff options
context:
space:
mode:
authorMarco Poletti <poletti.marco@gmail.com>2017-04-09 09:51:17 +0100
committerMarco Poletti <poletti.marco@gmail.com>2017-04-09 09:56:56 +0100
commitcb5c60fed6432804f874a46c6ccb08ecb3802e7b (patch)
treef5a61ba1e3514b3d8c7fcc9a64e428f1007cb82c /tests/test_bind_interface.py
parentbe745726d2df7449eafb8b9031a4596551915ba5 (diff)
downloadgoogle-fruit-cb5c60fed6432804f874a46c6ccb08ecb3802e7b.tar.gz
Migrate Fruit's end-to-end tests from nose2 to pytest, improving parallelization.
Diffstat (limited to 'tests/test_bind_interface.py')
-rwxr-xr-xtests/test_bind_interface.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/test_bind_interface.py b/tests/test_bind_interface.py
index fe0e6dd..ed303fb 100755
--- a/tests/test_bind_interface.py
+++ b/tests/test_bind_interface.py
@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from nose2.tools import params
+import pytest
from fruit_test_common import *
@@ -23,9 +23,10 @@ COMMON_DEFINITIONS = '''
struct Annotation2 {};
'''
-@params(
+@pytest.mark.parametrize('XAnnot,intAnnot', [
('X', 'int'),
- ('fruit::Annotated<Annotation1, X>', 'fruit::Annotated<Annotation2, int>'))
+ ('fruit::Annotated<Annotation1, X>', 'fruit::Annotated<Annotation2, int>'),
+])
def test_error_not_base(XAnnot, intAnnot):
source = '''
struct X {};
@@ -43,7 +44,10 @@ def test_error_not_base(XAnnot, intAnnot):
locals())
# TODO: maybe the error should include the annotation here.
-@params('X', 'fruit::Annotated<Annotation1, X>')
+@pytest.mark.parametrize('XAnnot', [
+ 'X',
+ 'fruit::Annotated<Annotation1, X>',
+])
def test_error_bound_to_itself(XAnnot):
source = '''
struct X {};
@@ -263,6 +267,6 @@ def test_bind_factory_2_arg():
'''
expect_success(COMMON_DEFINITIONS, source)
-if __name__ == '__main__':
- import nose2
- nose2.main()
+if __name__== '__main__':
+ code = pytest.main(args=[os.path.realpath(__file__)])
+ exit(code)