Skip to content

Wrong skipif reason for multiple markers #863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hackebrot opened this issue Jul 18, 2015 · 2 comments
Closed

Wrong skipif reason for multiple markers #863

hackebrot opened this issue Jul 18, 2015 · 2 comments
Labels
type: bug problem that needs to be addressed

Comments

@hackebrot
Copy link
Member

Hi there!

I noticed that pytest would show the reason of the very first skipif marker regardless of whose condition evaluates to True. I was able to reproduce the problem with the following snippet:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pytest

first_condition = False
second_condition = True


@pytest.mark.skipif(first_condition, reason='first_condition')
@pytest.mark.skipif(second_condition, reason='second_condition')
def test_foobar():
    assert False
(pytest)[raphael@hackebook tmp]$ py.test test_foo.py -rs
========= test session starts =========
platform darwin -- Python 2.7.6 -- py-1.4.30 -- pytest-2.7.2
rootdir: /Users/raphael/hackebrot/tmp, inifile: 
collected 1 items 

test_foo.py s
========= short test summary info =========
SKIP [1] test_foo.py:7: first_condition

========= 1 skipped in 0.00 seconds =========
(pytest)[raphael@hackebook tmp]$

This may be related to #666.

Right now I am using Mac OS X 10.10, Python 2.7.6 along with a fresh virtualenv that only has pytest. I experienced the same issue with Ubuntu 14.04 and Python 2.

py==1.4.30
pytest==2.7.2
wheel==0.24.0

Raphael

@nicoddemus nicoddemus added the type: bug problem that needs to be addressed label Jul 18, 2015
@nicoddemus
Copy link
Member

Thanks for the report Raphael! 😄

@hackebrot
Copy link
Member Author

Hrhr, no probs 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

2 participants