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

Fix various warnings when running pytest #46

Merged
merged 15 commits into from
Dec 17, 2018

Conversation

florisla
Copy link
Collaborator

@florisla florisla commented Nov 22, 2018

This fixes #44 and silences various warnings and errors related to deprecated methods and text encoding.

It's checked against 2.7, 3.4 and 3.6. Will leave the other versions to CI to check.

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I do wonder if we should be making vcs a fixture instead.

@florisla
Copy link
Collaborator Author

I didn't know fixtures could be parametrized as well. It works nicely and I like how much decorators this saves.

Do let me know if the PEP8 cleanup introduces too many changes.

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do see a lot xpassed tests in Travis, but don't see exactly which ones. That does worry me cause on Travis they should pass because we have both git and mercurial available.

tests/test_cli.py Outdated Show resolved Hide resolved
@florisla
Copy link
Collaborator Author

florisla commented Nov 23, 2018

It's xpassing the exact same tests as when I run 'notgit' instead of 'git' to check for git's presence. Might be related to d7efe91.

@florisla
Copy link
Collaborator Author

florisla commented Nov 23, 2018

Still xpassing on git in Travis. I have no clue at this point.

@florisla
Copy link
Collaborator Author

florisla commented Nov 25, 2018

I still don't understand why git was reacting differently from hg, but the xpasses are fixed.

This is a bit faster, but above all produces less verbose output on stdout.
Doing it the old way is deprecated in pytest 4.0 and will produce
errors from pytest >= 4.1.
Only when it's available.
It is not available on Python2, if 'configparser' is not installed
(only the stdlib 'ConfigParser').
This producing warnings, in particular for '\d'.
Instead of 'files=file,names'.
This avoids multiple PendingDeprecationWarning when running pytest.
This was failing in my local Python 2.
Proof that this is useful: I found a bug.
Unit test 'test_non_existing_file' was defined twice so
one of both versions was not being run!

The second one is now called test_non_existing_second_file.
Unit test count went from 140 to 141.
This saves quite some parametrize() decorators.
This includes xpassed tests.
Mainly useful for seeing what went wrong in Travis CI.
@florisla
Copy link
Collaborator Author

I squashed some commits and in f33c91e made pytest a bit more verbose on xpassed / xfailed tests.

@florisla
Copy link
Collaborator Author

florisla commented Dec 6, 2018

@c4urself Did you have a chance to look at this?

Currently the Travis badge on https://github.com/c4urself/bump2version is showing "build: failing". Also, new contributors will face Travis failures on their merge requests like in #47.

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Unless @c4urself objects I don't mind merging this.

@ekohl
Copy link
Collaborator

ekohl commented Dec 17, 2018

Thanks!

@florisla florisla added this to the v1.0.0 milestone Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix deprecation errors on pytest v4.0.x
2 participants