Skip to content
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

How do you test this? #180

Open
myarcana opened this issue Nov 20, 2022 · 2 comments
Open

How do you test this? #180

myarcana opened this issue Nov 20, 2022 · 2 comments

Comments

@myarcana
Copy link

myarcana commented Nov 20, 2022

Both python tests/test_simple.py and python -m unittest discover throw errors because of the import

  File "sampleproject/tests/test_simple.py", line 7, in <module>
    from sample.simple import add_one
ModuleNotFoundError: No module named 'sample'

So what's the correct way to test this package and other packages while in development?

@dmtucker
Copy link
Contributor

This project has a tox.ini file to automate running the tests: https://tox.wiki/en/latest/index.html

tox

To run manually, you must install the project before it can be tested:

python3 -m venv myvenv
myvenv/bin/python -m pip install .
myvenv/bin/python -m unittest discover

@pwihmag
Copy link

pwihmag commented Jan 31, 2024

I have installed tox, but that gave a lot of errors:
./.venv/lib/python3.10/site-packages/virtualenv/seed/wheels/util.py:68:52: E203 whitespace before ':'
./.venv/lib/python3.10/site-packages/virtualenv/seed/wheels/util.py:69:80: E501 line too long (100 > 79 characters)
./.venv/lib/python3.10/site-packages/virtualenv/seed/wheels/util.py:88:13: W503 line break before binary operator
./.venv/lib/python3.10/site-packages/virtualenv/seed/wheels/util.py:89:13: W503 line break before binary operator
./.venv/lib/python3.10/site-packages/virtualenv/seed/wheels/util.py:90:13: W503 line break before binary operator
./.venv/lib/python3.10/site-packages/virtualenv/seed/wheels/util.py:93:80: E501 line too long (88 > 79 characters)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants