Closed piermarcob closed 1 year ago
Can you please show the full output of your pytest run? Also, in your Dropbox, I can only find a debug log, not a minimal example.
Hi Florian, thanks for the quick response and sorry if i missed posting all the needed information.
Here is the output of running pytest -xvrP
.
Please note that this process works on other machines running MacOS (same version of mine or older) and Linux (ubuntu server)
test.log
Thanks again for putting effort in looking into this.
And where/how exactly is e.g. remove_all_communities
defined?
It is defined in contest.py, which is correctly loaded on other platforms.
Sorry for the delay, I dropped the ball a bit here.
So I see a /Users/piermarcobarbe/git/vylto-infrastructure/backend/tests/conftest.py
being loaded in your logs. However, the test seems to be at /Users/piermarcobarbe/git/vylto-infrastructure/test_analytics.py
. Where exactly is the conftest.py
(not contest.py
I hope?) which isn't getting loaded.
Can you perhaps share your repository or a minimal example project exhibiting the same problem? I'm afraid it's almost impossible to debug this like this.
Hi Florian,
Sorry for the typo (contest.py
-> conftest.py
), our project file was and is named correctly.
Hmm, thanks for letting me notice that a file named test_analytics.py
was found in our project root directory. That is weird as we collect tests in a specific directory and finding a test file outside of it is weird to read.
I am sorry to tell you that I had to wipe my Mac since tests were not running anymore and I couln't afford any more time on this, but i can confirm that there was actually a file named test_analytics.py
outside test directory and I think this was causing pytest to crash / not to find fixtures.
So, just to be clear, the structure was:
- vylto-infrastructure/
- test_analytics.py
as correctly reported by the pytest log.
Certainly this was a mistake on my side, do you think pytest can detect this kind of situations and maybe warn the user about it?
Thanks again for your time.
Well, if you have a test in vylto-infrastructure/test_analytics.py
, but your fixture defined in vylto-infrastructure/backend/tests/conftest.py
, that's not going to work - a conftest.py
is only valid for the directory it's in, or any subdirectories.
I don't see what pytest could detect or warn about - this is normal and valid usage of pytest.
[x] a detailed description of the bug or problem you are having I recently upgraded to MacOS Ventura (13.0.1) and tests for my project don't seem to work anymore. More precisely, pytest will fail finding fixtures, thing that was successful before the update. I collected debug details while executing pytest, i'll upload the log file right here. Before executing tests, i have to:
Optionally run
pipenv install
Run
pipenv shell
for starting a pipenv shellRun tests with
pytest -xvrP
. I tried executing this on a Linux machine and it works, so i exclude the software misconfiguration error.[x] output of
pip list
from the virtual environment you are using[x] pytest and operating system versions
pytest --version -> pytest 7.2.0
MacOS 13.0.1 (x86 architecture)[x] minimal example if possible Available from my dropbox here