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 test instructions, and refactor tests for consistency #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

adamserafini
Copy link

There are a couple of problems with the instructions for running tests in the current project README:

  1. pyxl_tests.py was renamed tests\test_basic.py
  2. Since then, many more tests have been added and the README does not address how to run them all as a complete test suite.

It seems the newer tests have a different 'style' to the original pyxl_tests.py: the new tests use pytest-style, ie. plain asserts in functions rather than the unittest2-style consisting of assertEqual etc.

This suggests that the intended way of running the full test suite is with pytest.

This PR does the following:

a. Makes the test suite consistent with itself: changes any use of unittest2 style testing to pytest style testing comprised of asserts in functions and removes any unittest2 dependencies.

b. Adds instructions to the README for running the full test suite.

This commit makes tests/test_basic.py more similar to the other
test files in the test directory. Ie. instead of using unittest,
tests are just asserts in functions that can be run by pytest.
Refactor test_rss.py to be more similar to the other tests,
ie. the tests are asserts in functions.
Running test_errors.py with pytest generates the complaint that
using yield in tests is deprecated. On closer inspection,
test_errors.py can be simplified by embedding a multiline string
with the error case in each test function.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

2 participants