Skip to content

pytest_00: initial py.test testing for tdi - #3

Open
AvdN wants to merge 1 commit into
ndparker:masterfrom
AvdN:pytest_00
Open

pytest_00: initial py.test testing for tdi#3
AvdN wants to merge 1 commit into
ndparker:masterfrom
AvdN:pytest_00

Conversation

@AvdN

@AvdN AvdN commented Oct 20, 2013

Copy link
Copy Markdown
  • 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, ttake MANIFEST out of gitignore
  • 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)
    (fixture 'pure', which adds pure python testing to a test case)
  • 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 separate, 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 53% (but of course stuff is still skipped, it was before changes
    to test_attribute_analyzer was change 74%, why this decreased is unclear to me)
  • 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

Next step:

  • remove skips -> complete coverage

- 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
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.

1 participant