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

Why my pytest-deadfixtures is running outside indicated folder #33

Closed
tamercuba opened this issue May 22, 2021 · 1 comment
Closed

Why my pytest-deadfixtures is running outside indicated folder #33

tamercuba opened this issue May 22, 2021 · 1 comment

Comments

@tamercuba
Copy link

I have a python app with the following folder structure:

├── src
└── tests
    ├── __pycache__
    ├── application
    └── integration

and im trying to run pytest-fixtures only inside the tests/application folder.

When I run pytest --dead-fixtures tests/application/ I get this output:

╰─$ pytest --dead-fixtures tests/application/                                                                                                                                                                                                                                      2 ↵

Cool, every declared fixture is being used.

============================================================================================================================ warnings summary ============================================================================================================================
../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:434
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:434: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def wait(self, skip=0):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:448
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:448: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def wait_next(self, skip=0):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:468
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:468: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def wait_for(self, predicate):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:489
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/mock.py:489: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def _notify(self):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:357
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:357: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def doCleanups(self):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:381
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:381: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def assertAsyncRaises(self, exception, awaitable):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:392
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:392: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def assertAsyncRaisesRegex(self, exception, regex, awaitable):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:403
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:403: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def assertAsyncWarns(self, warning, awaitable):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:414
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:414: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def assertAsyncWarnsRegex(self, warning, regex, awaitable):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:445
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:445: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def advance(self, seconds):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:487
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/case.py:487: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def _drain_loop(self):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/helpers.py:13
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/asynctest/helpers.py:13: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def exhaust_callbacks(loop):

../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/requests_toolbelt/_compat.py:11
../../.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/requests_toolbelt/_compat.py:11
  /Users/tamer/.pyenv/versions/3.9.4/envs/carrim/lib/python3.9/site-packages/requests_toolbelt/_compat.py:11: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
    from collections import Mapping, MutableMapping

-- Docs: https://docs.pytest.org/en/stable/warnings.html
14 warnings in 0.48s

What am i doing wrong so that pytest runs this check on my .pyenv folder?

My project is in ~/Documents/project_name and my pyenv root is ~/.pyenv

@tamercuba tamercuba changed the title Check running in indicated folder + pyenv folder Why my pytest-deadfixtures is running outside indicated folder May 22, 2021
@jllorencetti
Copy link
Owner

I'm not exactly sure what do you mean by "runs this check on pyenv folder."
The warnings are related to Python packages in your environment. None of those warnings are related to pytest-deadfixtures.
No matter what folder is the target, it will be executed using the Python environment available/active at the moment.

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

No branches or pull requests

2 participants