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

Pytest v7.1 fails to initialize on windows #162

Closed
jacksund opened this issue Apr 29, 2022 · 2 comments · Fixed by #231
Closed

Pytest v7.1 fails to initialize on windows #162

jacksund opened this issue Apr 29, 2022 · 2 comments · Fixed by #231
Labels
bug Something isn't working partial fix added A temporary fix has been merged into main

Comments

@jacksund
Copy link
Owner

jacksund commented Apr 29, 2022

While the CI is working fine, the test suite is failing to run on windows. The current quick-fix is to downgrade to pytest v7.0, but this issue should be fixed.

Example output of error:

================================================= test session starts =================================================
platform win32 -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0
django: settings: simmate.configuration.django.settings_test (from ini)
rootdir: C:\Users\jacks\Documents\GitHub\simmate, configfile: pyproject.toml
plugins: django-4.5.2, forked-1.4.0, mock-3.7.0, xdist-2.5.0
collected 0 items / 1 error

======================================================= ERRORS ========================================================
____________________________________________ ERROR collecting test session ____________________________________________
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\_pytest\runner.py:338: in from_call
    result: Optional[TResult] = func()
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\_pytest\runner.py:369: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\_pytest\main.py:723: in collect
    for x in self._collectfile(pkginit):
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\_pytest\main.py:575: in _collectfile
    ihook = self.gethookproxy(fspath)
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\_pytest\main.py:539: in gethookproxy
    my_conftestmodules = pm._getconftestmodules(
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\_pytest\config\__init__.py:575: in _getconftestmodules
    mod = self._importconftest(conftestpath, importmode, rootpath)
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\_pytest\config\__init__.py:620: in _importconftest
    assert mod not in mods
E   AssertionError
================================================== warnings summary ===================================================
..\..\..\anaconda3\envs\simmate_dev\lib\site-packages\past\builtins\misc.py:45
  C:\Users\jacks\anaconda3\envs\simmate_dev\lib\site-packages\past\builtins\misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
    from imp import reload

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================== short test summary info ===============================================
ERROR  - AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================= 1 warning, 1 error in 0.91s =============================================
@jacksund jacksund added the bug Something isn't working label Apr 29, 2022
@jacksund jacksund changed the title Pytest v7 fails to initialize on windows Pytest v7.1 fails to initialize on windows Apr 29, 2022
@jacksund
Copy link
Owner Author

This looks to be a common issue occurring in other packages and unique to v7.1

@jacksund
Copy link
Owner Author

After uninstalling/reinstalling anaconda and using conda clean this is working again... I changed nothing so maybe this issue was resolved elsewhere...? This looks to be stable in the CI so I'll close this issue with the linked PR for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working partial fix added A temporary fix has been merged into main
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant