Regression in 7.1 ? Windows CI started to fail with "assert mod not in mods" since 7.1
See original GitHub issueNow sorry I know this is not a minimal reproducer, but I just want to log this here, and will investigate later:
You can see one Failure here
ERROR collecting test session
C:\hostedtoolcache\windows\Python\3.9.10\x64\lib\site-packages\_pytest\runner.py:338: in from_call
result: Optional[TResult] = func()
C:\hostedtoolcache\windows\Python\3.9.10\x64\lib\site-packages\_pytest\runner.py:369: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
C:\hostedtoolcache\windows\Python\3.9.10\x64\lib\site-packages\_pytest\main.py:7[23](https://github.com/ipython/ipython/runs/5535021197?check_suite_focus=true#step:8:23): in collect
for x in self._collectfile(pkginit):
C:\hostedtoolcache\windows\Python\3.9.10\x64\lib\site-packages\_pytest\main.py:575: in _collectfile
ihook = self.gethookproxy(fspath)
C:\hostedtoolcache\windows\Python\3.9.10\x64\lib\site-packages\_pytest\main.py:539: in gethookproxy
my_conftestmodules = pm._getconftestmodules(
C:\hostedtoolcache\windows\Python\3.9.10\x64\lib\site-packages\_pytest\config\__init__.py:579: in _getconftestmodules
mod = self._importconftest(conftestpath, importmode, rootpath)
C:\hostedtoolcache\windows\Python\3.9.10\x64\lib\site-packages\_pytest\config\__init__.py:6[24](https://github.com/ipython/ipython/runs/5535021197?check_suite_focus=true#step:8:24): in _importconftest
assert mod not in mods
E AssertionError
Now I’m not sure what this does, but my quick understanding is that it checks whether conftest.py itself is not in the list of collected modules ? We might definitely do something wrong on IPython side, but it’s strange as other non-windows CI are passing and regardless of whether this is something I did wrong, can the assert get an explanation messages as second argument ?
Downgrading to <7.1 fixes the issue.
Again I’ll try to get a MVP/small example, but it may take me some time, and I guessed maybe one of you will immediately know why this is happening.
- a detailed description of the bug or problem you are having
- output of
pip listfrom the virtual environment you are using - pytest and operating system versions
- minimal example if possible
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Bug listing with status CONFIRMED as at 2022/12/20 18:46:38
status:CONFIRMED resolution: severity:enhancement · Bug:21509 - "[PATCH] [IDEA] Ability to cleanly stop emerging multiple packages after the current jobs ...
Read more >Untitled
New upstream release - Notify systemd when beginning to shutdown - Fix ... Dracut errors encountered during boot after Anaconda starts (jkonecny) Resolves: ......
Read more >other - Go Issues
Compilation fails in OpenBSD 7.1OS-OpenBSDWaitingForInfocompiler/runtime ... modules: go mod vendor does not vendor command packages expectedly.
Read more >Untitled
Starting with %gopath [1.2.1-1] - Update to latest upstream [1.2-7] ... rhel6 compatibility) [7.1+7.0.z]) This update is available via the Unbreakable Linux ...
Read more >homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter
aacgain 1.8 AAC‑supporting version of mp3gain
aalib 1.4rc5 Portable ASCII art graphics library
aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve got the same error, but on linux! Can’t run any test on 7.1.x, reverting back to 7.0.x fixes the issue:
For our case, the issue was in symlinks which we created inside
site-packagesdirectory. We switched to--pyargs(python -m pytest --pyargs nextgiswebinstead ofpython -m pytest package/nextgisweb/nextgisweb) and now everything works well.