Skip to content
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

skipif reason must be a string #16

Closed
wants to merge 1 commit into from
Closed

skipif reason must be a string #16

wants to merge 1 commit into from

Conversation

lafrech
Copy link
Collaborator

@lafrech lafrech commented Jul 7, 2016

On my setup, this fixes a lot of errors while running py.test:

_______________________________________ ERROR at setup of TestPymongo.test_auto_instance ________________________________________
Error evaluating 'skipif' expression
    False
Failed: you need to specify reason=STRING when using booleans as conditions.

Passing skipif reason=None generates an error:
"Failed: you need to specify reason=STRING when using booleans as conditions."
@coveralls
Copy link

coveralls commented Jul 7, 2016

Coverage Status

Coverage decreased (-7.03%) to 86.719% when pulling 37f08e9 on Nobatek:skipif_reason_str into 3c5a9cf on Scille:master.

@lafrech
Copy link
Collaborator Author

lafrech commented Jul 7, 2016

(I don't understand the coverage decrease.)

The error does not happen when running tox but when running Debian Jessie's py.test.

@lafrech
Copy link
Collaborator Author

lafrech commented Jul 7, 2016

I can't explain it, but this change makes the tox report go from

tests/test_data_proxy.py ..............
tests/test_document.py ...................
tests/test_fields.py ....x......
tests/test_i18n.py ...
tests/test_indexes.py .....
tests/test_inheritance.py ....
tests/test_instance.py .........
tests/test_query_mapper.py ..
tests/frameworks/test_mongomock.py s
tests/frameworks/test_motor_asyncio.py ssssssssssssssssssssss
tests/frameworks/test_pymongo.py ..................x..
tests/frameworks/test_txmongo.py ssssssssssssssssssssss

----------- coverage: platform linux, python 3.4.2-final-0 -----------
Name                                 Stmts   Miss  Cover
--------------------------------------------------------
umongo/__init__.py                      13      0   100%
umongo/abstract.py                      72      9    88%
umongo/builder.py                      143      0   100%
umongo/data_objects.py                  54      1    98%
umongo/data_proxy.py                   148     11    93%
umongo/document.py                      89      4    96%
umongo/embedded_document.py             52      0   100%
umongo/exceptions.py                    29      0   100%
umongo/fields.py                       208     17    92%
umongo/frameworks/__init__.py           55     14    75%
umongo/frameworks/mongomock.py           5      3    40%
umongo/frameworks/motor_asyncio.py     199    197     1%
umongo/frameworks/motor_tornado.py       0      0   100%
umongo/frameworks/pymongo.py           187     29    84%
umongo/frameworks/tools.py               9      0   100%
umongo/frameworks/txmongo.py           184    183     1%
umongo/i18n.py                           5      0   100%
umongo/indexes.py                       44      9    80%
umongo/instance.py                      64      1    98%
umongo/query_mapper.py                  24      0   100%
umongo/schema.py                        21      0   100%
umongo/template.py                      22      0   100%
umongo/validate.py                      22      0   100%
--------------------------------------------------------
TOTAL                                 1649    478    71%

to

tests/test_data_proxy.py ..............
tests/test_document.py ...................
tests/test_fields.py ....x......
tests/test_i18n.py ...
tests/test_indexes.py .....
tests/test_inheritance.py ....
tests/test_instance.py .........
tests/test_query_mapper.py ..
tests/frameworks/test_mongomock.py s
tests/frameworks/test_motor_asyncio.py ssssssssssssssssssssss
tests/frameworks/test_pymongo.py sssssssssssssssssssss
tests/frameworks/test_txmongo.py ssssssssssssssssssssss

----------- coverage: platform linux, python 3.4.2-final-0 -----------
Name                                 Stmts   Miss  Cover
--------------------------------------------------------
umongo/__init__.py                      13      0   100%
umongo/abstract.py                      72      9    88%
umongo/builder.py                      143      6    96%
umongo/data_objects.py                  54      1    98%
umongo/data_proxy.py                   148     17    89%
umongo/document.py                      89      4    96%
umongo/embedded_document.py             52      0   100%
umongo/exceptions.py                    29      0   100%
umongo/fields.py                       208     18    91%
umongo/frameworks/__init__.py           55     16    71%
umongo/frameworks/mongomock.py           5      3    40%
umongo/frameworks/motor_asyncio.py     199    197     1%
umongo/frameworks/motor_tornado.py       0      0   100%
umongo/frameworks/pymongo.py           187    144    23%
umongo/frameworks/tools.py               9      7    22%
umongo/frameworks/txmongo.py           184    183     1%
umongo/i18n.py                           5      0   100%
umongo/indexes.py                       44      9    80%
umongo/instance.py                      64      1    98%
umongo/query_mapper.py                  24      0   100%
umongo/schema.py                        21      0   100%
umongo/template.py                      22      0   100%
umongo/validate.py                      22      0   100%
--------------------------------------------------------
TOTAL                                 1649    615    63%

which probably explains the coverage issue.

@lafrech
Copy link
Collaborator Author

lafrech commented Jul 11, 2016

This affects other MongoDB frameworks. I can complete the PR if needed.

@touilleMan
Copy link
Member

The trouble is only present for pytest<2.8, so I prefer to let it this way.

I've documented the trouble both in doc and in tox.ini

@touilleMan touilleMan closed this Jul 16, 2016
@lafrech lafrech deleted the skipif_reason_str branch August 1, 2016 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants