-
Notifications
You must be signed in to change notification settings - Fork 193
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
Migrate to pytest #584
Migrate to pytest #584
Conversation
…or for pytest compatibility
@juarezr could you give me a hand regarding failing Codacy Security Scan ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Impressive Job! The code is way better!
- Coverage stays at the same level: coverage decreased (-0.2%) to 90.871%
- Just found a few nitpicks.
- Do you think that the work is ready?
requirements-tests.txt
Outdated
@@ -1,6 +1,8 @@ | |||
wheel | |||
setuptools | |||
nose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need nose yet after this migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not 9ff3435
tox.ini
Outdated
@@ -18,7 +18,7 @@ setenv = | |||
py36,py37,py38,py39: PY_MAJOR_VERSION = py3 | |||
commands = | |||
py27,py36,py38,py39: pytest --cov=petl petl | |||
py37: nosetests -v --with-coverage --cover-package=petl --with-doctest --doctest-options=+NORMALIZE_WHITESPACE petl -I"csv_py2\.py" -I"db\.py" | |||
py37: pytest --cov=petl petl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to split py37
anymore because you solved/removed the previous hack here. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right 9ff3435
@@ -122,7 +122,7 @@ jobs: | |||
python -m pip install -r requirements-formats.txt | |||
echo "::endgroup::" | |||
echo "::group::Perform doc test execution with coverage" | |||
nosetests -v --with-coverage --cover-package=petl --with-doctest --doctest-options=+NORMALIZE_WHITESPACE petl -I"csv_py2\.py" -I"db\.py" | |||
pytest --cov=petl petl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering what would be the best approach here:
- Calling pytest directly from here as I did with nose, or...
- Calling pytest through tox as one would in command line
Not a requirement, off course. Just getting any possible opinion on the subject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, I would leave it as is, calling pytest directly. Ideally, however I would prefer to align the call as one would do it locally. I recall that in one of my previous PRs there were some slight discrepancies between calling tox
locally and how one of the functions behaved on CI.
I would even consider a Docker approach, or docker-compose with db and remote services (instead of calling docker run)
Missed your message. The failure is not related with your changes. As your code does not change runtime code, it's safe to assume that we are not spreading any security issue in the released package. Probably the check did break because of some random reason. It should be running even independently of any other changes. |
Glad to hear that, and some nice catches from you! |
Nice job! |
This PR has the objective of migrating the current nosetest runner to pytest.
Successfully ran the whole test suite against py3.8 with the exception of bcolz.
This the minimal effort and test suite code change required to use pytest.
Changes
.raises
_iter_sqlalchemy_engine
has been commitedChecklist
Checklist for for pull requests including new code and/or changes to existing code...