-
Notifications
You must be signed in to change notification settings - Fork 20
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
Examples of use #351
Comments
@sylvain-ri maybe you don't have to use factories at the beginning? What are you trying to achieve? Hmmm.... simple example a'la docker without the use of factories might be helpful though anyway 🤔 |
I would like to add unittests to a python module with SQL queries. Is pytest-mysql designed for this goal ? |
@sylvain-ri yes Also, bear in mind, that when you connect to an external service like a database in your tests, these are no longer unit tests, but integration tests. |
@fizyk Thank you for your answer. Is there an example that i can "just run" ? It's easier (for me) to start from a template and then modify it to my need than starting from a blank page :) |
@sylvain-ri what system are you running the tests on? And have you got the MySQL installed? Plus, could you share the full FileNotFound error? I'd like to see what exactly could not be found. |
I tried to run your file example https://github.com/ClearcodeHQ/pytest-mysql/blob/main/tests/test_mysql.py Tests results
LogsThe error report is extremely verbose, I cut some parts.
...
E FileNotFoundError: [WinError 2] The system cannot find the file specified C:\Softwares\Python39\lib\subprocess.py:1420: FileNotFoundError``` |
Windows... Sorry, It doesn't run on windows. I'd need to first adjust the underlying mirakuru ( ClearcodeHQ/mirakuru#392 ) library and then figure out the way to run MySQL on windows. |
Okay... Thanks for the information. It would help other to states this somewhere ;) |
@sylvain-ri in the meantime, you could try running on docker containers or within a VM with installed Linux. Also, I haven't tried WSL but I think it should handle it as well 🤔 |
of course i can :) but it's good to know before hand to not waste time 😁 Feel free to reopen the issue. I think adding the information about the requirements would be enough as of now (Linux needed, MySQL, maybe other dependencies) |
I would like to have full working examples
Based on the documentation I found on pythonhosted.org, this library seems very easy to use. But I haven't managed to actually create a fixture and use it for my tests.
Something is missing for me to know how the
factories
, and connect to the fixture database. It looks promising though, so i would really like to use your library.The text was updated successfully, but these errors were encountered: