Skip to content

replace nosetests with Pytest - #177

Merged
Kilo59 merged 6 commits into
lob:masterfrom
Kilo59:pytest
Nov 9, 2021
Merged

replace nosetests with Pytest#177
Kilo59 merged 6 commits into
lob:masterfrom
Kilo59:pytest

Conversation

@Kilo59

@Kilo59 Kilo59 commented Oct 23, 2021

Copy link
Copy Markdown
Contributor

Nosetests has been unmaintained for years.
https://nose.readthedocs.io/en/latest/#note-to-users

pytest is now the defacto standard for python testing.
https://docs.pytest.org/en/6.2.x/index.html

pytest can also execute and run unittest and nosetests tests.
https://docs.pytest.org/en/6.2.x/nose.html?highlight=nosetests
There are some usages of nose that are incompatible, but none of our tests are written that way.

  • Check for test regressions against main

add `pipenv` `tests` script
execute with`pipenv run tests`
fixes pytest discoverability issue in CI
@Kilo59 Kilo59 added the dependencies Pull requests that update a dependency file label Oct 24, 2021
@Kilo59

Kilo59 commented Oct 25, 2021

Copy link
Copy Markdown
Contributor Author

These following tests are currently failing locally.

I doubt these failures are caused by the pytest changes, but I will try running the old nosetests from main to be sure.

Edit: Confirmed, these same tests fail on main for me.

FAILED tests/test_address.py::TestAddressFunctions::test_list_address_fail - AssertionError: InvalidRequestError not raised by list
FAILED tests/test_bankaccount.py::BankAccountFunctions::test_list_bankAccounts_fail - AssertionError: InvalidRequestError not raised by list
FAILED tests/test_check.py::CheckFunctions::test_list_checks_fail - lob.error.APIError: Internal Error Occurred. Please contact [email protected].
FAILED tests/test_postcard.py::PostcardFunctions::test_list_postcards_fail - lob.error.APIError: Internal Error Occurred. Please contact [email protected].
FAILED tests/test_postcard.py::PostcardFunctions::test_list_postcards_metadata - IndexError: list index out of range
FAILED tests/test_self_mailer.py::SelfMailerFunctions::test_list_self_mailers_fail - lob.error.APIError: Internal Error Occurred. Please contact [email protected].
FAILED tests/test_self_mailer.py::SelfMailerFunctions::test_list_self_mailers_metadata - IndexError: list index out of range

Nosetest results (on main)

Ran 81 tests in 95.811s

FAILED (errors=5, failures=2)

@Kilo59
Kilo59 marked this pull request as ready for review October 25, 2021 14:33

@ross-martin ross-martin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice thanks for doing this

@ross-martin

Copy link
Copy Markdown

can you follow up with a GH Action workflow, please?

@Kilo59
Kilo59 requested a review from ShariqT October 28, 2021 00:30
@Kilo59 Kilo59 mentioned this pull request Oct 28, 2021
2 tasks
@Kilo59

Kilo59 commented Oct 28, 2021

Copy link
Copy Markdown
Contributor Author

@ross-martin will do!

Comment thread README.md Outdated
@Kilo59
Kilo59 merged commit 8d6e987 into lob:master Nov 9, 2021
@Kilo59
Kilo59 deleted the pytest branch November 9, 2021 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Development

Successfully merging this pull request may close these issues.

2 participants