pytest_00: initial py.test testing for tdi - #3
Open
AvdN wants to merge 1 commit into
Open
Conversation
- run_tests filters out python files under tests/ that start with "test_"
- py.test (by default) only runs those files
- tox.ini file for creation of virtualenvs for testing
- initial conversion of 3 files (9 tests)
- test coverage based on py.test
Please note:
- tox needs to find Python2.5, 2.6 and 2.7 executables, it expects these in
'/usr/bin', but there is a PR to allow explicit specification (my
/usr/bin/python2.7 is 2.7.3 but with the patch I get my virtualenvs from
/opt/python/x.y.z (2.7.5, 2.6.8, 2.5.6, etc.)
- tox keeps virtualenvs (under .tox) only first time the virtualenv is
created needs installing (in addition I have a local PyPI cache, which
speeds up the initial setup).
added MANIFEST
take MANIFEST out of gitignore
fixture 'pure', which adds pure python testing to a test case
- generated test_XX.py files for all files under tests
- there is a small helper file _test_support.py under tdi. It provides
the mechanism to do both C and pure Python tests (and can
easily be adapted to skip one of those for a particular Python version)
- there are a few files that have skips in them:
find tests -name test_*.py | xargs fgrep -l pytest.skip
some of these are because things are unclear, others because
they need smart split-up in multiple tests with automation
- all test files are kept seperate, having only one test. Some should IMHO
be combined e.g. rendering/test_name_unicode*.py, so the
output of py.test becomes shorter (but wider with more dots at each filename)
- test coverage is now 74% (but of course stuff is still skipped)
- include tests for test_attribute_analyzer for which result is same for
combinations of hidden and remove
- include some of the other tests from test_attribute_analyzer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please note:
'/usr/bin', but there is a PR to allow explicit specification (my
/usr/bin/python2.7 is 2.7.3 but with the patch I get my virtualenvs from
/opt/python/x.y.z (2.7.5, 2.6.8, 2.5.6, etc.)
created needs installing (in addition I have a local PyPI cache, which
speeds up the initial setup).
the mechanism to do both C and pure Python tests (and can
easily be adapted to skip one of those for a particular Python version)
(fixture 'pure', which adds pure python testing to a test case)
find tests -name test_*.py | xargs fgrep -l pytest.skip
some of these are because things are unclear, others because
they need smart split-up in multiple tests with automation
be combined e.g. rendering/test_name_unicode*.py, so the
output of py.test becomes shorter (but wider with more dots at each filename)
to test_attribute_analyzer was change 74%, why this decreased is unclear to me)
combinations of hidden and remove
Next step: