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

Remove extra function call from context manger API #10

Merged
merged 2 commits into from
Feb 24, 2019

Conversation

ionelmc
Copy link
Contributor

@ionelmc ionelmc commented Feb 23, 2019

As mentioned in #9 (comment)

So I still use python 2.7 🙄

PS. How come you're not using pytest-cov?

@ionelmc ionelmc changed the title Remove extra function call from constext manger API Remove extra function call from context manger API Feb 23, 2019
@okken
Copy link
Owner

okken commented Feb 24, 2019

Thanks Ionel.

@okken okken merged commit 5ff8d8e into okken:master Feb 24, 2019
@okken
Copy link
Owner

okken commented Feb 24, 2019

With coverage running pytest

(pytest-check) $ coverage erase
(pytest-check) $ coverage run --source=src -m pytest
=================== test session starts ===================
platform darwin -- Python 3.7.0, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
rootdir: /Users/okken/projects/pytest-check, inifile:
plugins: cov-2.6.1, check-0.3.4
collected 27 items                                        

tests/test_check.py .....................           [ 77%]
tests/test_check_context_manager.py ...             [ 88%]
tests/test_check_fixture.py .                       [ 92%]
tests/test_check_func_decorator.py ..               [100%]

================ 27 passed in 1.21 seconds ================
(pytest-check) $ coverage report
Name                                Stmts   Miss  Cover
-------------------------------------------------------
src/pytest_check/__init__.py            3      0   100%
src/pytest_check/check_methods.py     101      0   100%
src/pytest_check/plugin.py             22      0   100%
-------------------------------------------------------
TOTAL                                 126      0   100%

@okken
Copy link
Owner

okken commented Feb 24, 2019

I usually use pytest-cov for non-plugin work and straight coverage for plugin work.
I am at 100% test coverage now with launching pytest from coverage.
But with pytest-cov, I only get 55% coverage.

(pytest-check) $ pytest --cov=src
=================== test session starts ===================
platform darwin -- Python 3.7.0, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
rootdir: /Users/okken/projects/pytest-check, inifile:
plugins: cov-2.6.1, check-0.3.4
collected 27 items                                        

tests/test_check.py .....................           [ 77%]
tests/test_check_context_manager.py ...             [ 88%]
tests/test_check_fixture.py .                       [ 92%]
tests/test_check_func_decorator.py ..               [100%]

---------- coverage: platform darwin, python 3.7.0-final-0 -----------
Name                                Stmts   Miss  Cover
-------------------------------------------------------
src/pytest_check/__init__.py            3      3     0%
src/pytest_check/check_methods.py     101     49    51%
src/pytest_check/plugin.py             22      5    77%
-------------------------------------------------------
TOTAL                                 126     57    55%


================ 27 passed in 1.37 seconds ================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants