tests and colliding pyc

11 views
Skip to first unread message

Greg Troxel

unread,
Mar 3, 2026, 12:27:22 PMMar 3
to weewx-de...@googlegroups.com
[I sent this output to -users in a discussion about users running tests
and mysql woes.]

I hacked the bits in the destdir to remove mysql tests, to try to what
else wrong in test output. Somehow, python is loading test_config from
weecfg when weeutil's version is desired. I have no idea what's going
on with search paths.

After running, I dutifully rm'd all .pyc, but that just adjusted the
error

=> Bootstrap dependency digest>=20211023: found digest-20220214
===> Checking for vulnerabilities in py313-weewx-5.3.1
=> Test dependency py313-test-[0-9]*: found py313-test-9.0.2
===> Testing for py313-weewx-5.3.1
============================= test session starts ==============================
platform netbsd10 -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /tmp/work/wip/py-weewx/work/weewx-5.3.1
configfile: pyproject.toml
plugins: cov-7.0.0, anyio-4.12.1
collected 352 items / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/weeutil/tests/test_config.py _______________
import file mismatch:
imported module 'test_config' has this __file__ attribute:
/tmp/work/wip/py-weewx/work/weewx-5.3.1/src/weecfg/tests/test_config.py
which is not the same as the test file we want to collect:
/tmp/work/wip/py-weewx/work/weewx-5.3.1/src/weeutil/tests/test_config.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
=========================== short test summary info ============================
ERROR src/weeutil/tests/test_config.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.48s ===============================
*** Error code 2

Stop.
make[1]: stopped in /n0/gdt/pkgsrc-current/pkgsrc/wip/py-weewx
WARNING: *** Please consider adding c to USE_LANGUAGES in the package Makefile.
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/wip/py-weewx




=> Bootstrap dependency digest>=20211023: found digest-20220214
===> Checking for vulnerabilities in py313-weewx-5.3.1
=> Test dependency py313-test-[0-9]*: found py313-test-9.0.2
===> Testing for py313-weewx-5.3.1
============================= test session starts ==============================
platform netbsd10 -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /tmp/work/wip/py-weewx/work/weewx-5.3.1
configfile: pyproject.toml
plugins: cov-7.0.0, anyio-4.12.1
collected 352 items / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/weeutil/tests/test_config.py _______________
import file mismatch:
imported module 'test_config' has this __file__ attribute:
/tmp/work/wip/py-weewx/work/weewx-5.3.1/src/weecfg/tests/test_config.py
which is not the same as the test file we want to collect:
/tmp/work/wip/py-weewx/work/weewx-5.3.1/src/weeutil/tests/test_config.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
=========================== short test summary info ============================
ERROR src/weeutil/tests/test_config.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.48s ===============================
*** Error code 2

Stop.
make[1]: stopped in /n0/gdt/pkgsrc-current/pkgsrc/wip/py-weewx
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/wip/py-weewx

Tom Keffer

unread,
Mar 3, 2026, 12:32:24 PMMar 3
to Greg Troxel, weewx-de...@googlegroups.com
Yes, there are two files named "test_config.py" in the test suites. They are under different subdirectories.



--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-development/rmi1pi0n7rf.fsf%40s1.lexort.com.
Reply all
Reply to author
Forward
0 new messages