Web developer. Lover of Typescript. Also comfortable with a bunch of other shiny languages and "big-brain tech tools" to flex about at parties! ( ´・・)ノ(._.`)
Can you help me with that? By the way this is a great tutorial Kinyanjui, can't thank you enough.
(P.S: Also just since it might matter, I'm on Windows and I activated the env using ".\env\Scripts\activate.bat" instead of the one you did in your terminal. I tested pytest --version and it's installed successfully.)
P.S #2: Sorry, I fixed it. I had a typo. But the error was scary and unreadable! Thanks anyways I enjoyed it very much when the test passed! :) I didn't delete the error so if someone else bumps into the same error can see my comment.
P.S #3: How about writing the test functions in a separate file? How should we run them? Should we use globs in that case? e.g: pytest test_*.py?
Hey @aderchox
. If the test is in a different file, still just running pytest while in the project directory should discover the test files, as long as they're named in the format test_*.py.
You can read more about test discovery here.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I receive an error which begins like this(I've called my python file "main.py" instead of "hello.py"):
ERRORS =================================================================
_______________________________________________________ ERROR collecting main.py ________________________________________________________
env\lib\site-packages_pytest\python.py:493: in _importtestmodule
...
Can you help me with that? By the way this is a great tutorial Kinyanjui, can't thank you enough.
(P.S: Also just since it might matter, I'm on Windows and I activated the env using ".\env\Scripts\activate.bat" instead of the one you did in your terminal. I tested pytest --version and it's installed successfully.)
P.S #2: Sorry, I fixed it. I had a typo. But the error was scary and unreadable! Thanks anyways I enjoyed it very much when the test passed! :) I didn't delete the error so if someone else bumps into the same error can see my comment.
P.S #3: How about writing the test functions in a separate file? How should we run them? Should we use globs in that case? e.g:
pytest test_*.py
?Hey @aderchox . If the test is in a different file, still just running
pytest
while in the project directory should discover the test files, as long as they're named in the formattest_*.py
.You can read more about test discovery here.