Tests use obsolete modules and do online operations
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- build-system, testing-qa
Research direction
Start with fxa/tests/utils.py, fxa/tests/test_core.py, fxa/tests/mock_utilities.py, and fxa/tests/test_requests_auth_plugin.py, then inspect the existing test command and dependency imports. Done means tests no longer require obsolete modules unnecessarily, Python 3 imports work, online tests can be excluded, and the suite runs through the chosen test command without those failures.
Written by the indexing model from the issue text.
Description
I am trying to update and run tests on openSUSE and following things are bit pita:
unittest2 are slowly phased out also they are only imported on py2.6 based on fxa/tests/utils.py thus there is no reason to import/require it every time (those requires should be limited every time, ie to pull in the unittest2 it should be done like unittest2;python_version<"2.7"'
Instead of nose executor it is good idea to use working python setup.py test or switch to pytest (simple swap from nose should be mostly enough).
Grequests should be replaced by py3 compatible requests-threads or requests-futures in test_monkey_patch_for_gevent.
For the online tests they should be skipped ie if you switch to pytest you can use @pytest.mark.online and we can later use pytest -m 'not online' for following tests:
[ 3s] fxa/tests/test_core.py::TestCoreClient::test_account_creation_with_key_fetch FAILED [ 5%]
[ 3s] fxa/tests/test_core.py::TestCoreClient::test_account_login FAILED [ 6%]
[ 4s] fxa/tests/test_core.py::TestCoreClient::test_email_code_verification FAILED [ 7%]
[ 4s] fxa/tests/test_core.py::TestCoreClient::test_forgot_password_flow FAILED [ 8%]
[ 4s] fxa/tests/test_core.py::TestCoreClient::test_get_random_bytes FAILED [ 9%]
[ 4s] fxa/tests/test_core.py::TestCoreClient::test_resend_verify_code FAILED [ 10%]
[ 4s] fxa/tests/test_core.py::TestCoreClient::test_send_unblock_code FAILED [ 11%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_change_password FAILED [ 12%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_email_status FAILED [ 13%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_get_identity_assertion FAILED [ 14%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_get_identity_assertion_accepts_service FAILED [ 15%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_get_identity_assertion_handles_duration FAILED [ 16%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_get_random_bytes FAILED [ 16%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_session_status FAILED [ 17%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_sign_certificate FAILED [ 18%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_sign_certificate_handles_duration FAILED [ 19%]
[ 4s] fxa/tests/test_core.py::TestCoreClientSession::test_totp FAILED [ 20%]
You should not import mock on python3 as there it is regular part of the unittest:
[ 4s] fxa/tests/test_requests_auth_plugin.py:5: in <module>
[ 4s] from fxa.tests.mock_utilities import (
[ 4s] fxa/tests/mock_utilities.py:1: in <module>
[ 4s] import mock
[ 4s] E ModuleNotFoundError: No module named 'mock'
In some parts of the tests you already check for it but here it is hardcoded.
- Dominant language
- Python
- Stars
- 36
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/PyFxA
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100