Tue Aug 1 18:48:00 2006

Ticket #79 (Closed: fixed)

ability to change the regex pattern


Priority: normal Reporter: guest
Severity: enhancement Assigned to: jpellerin
Component: nose Status: closed
Version: 0.9 Resolution: fixed
Milestone: 0.9.2 Keywords:  

Description by guest:

hello, i just started using nose and i've read the help but can't find a setting to customize the discovery regex. was hoping it would discover tests named with our standard naming system: something like 'modulename_unittest.py'. could this functionality be added?

Changelog

Fri Aug 4 22:36:35 2006: Modified by jpellerin

  • milestone set to 0.9.1
  • version set to 0.9
  • status changed from new to assigned

You can do this now in a couple of ways:

  • use the --include switch to tell nose to include the files you want
  • write a plugin that implements wantFile() to make nose include the files you want

But you're right, it should be easier to set the default test match regex. I'll try to get this feature in for version 0.9.1.

Wed Oct 4 17:35:05 2006: Modified by guest

    Also, maybe you can reconsider the default regex. I have some utility functions in a test package (for using the tests without nose) such as: check_test_files, get_tst_funcs, run_tests etc. which are all considered as tests. I think a more restricted expression like '^[T|t]est_' would be better.

    Mon Oct 9 18:09:14 2006: Modified by jpellerin

    • milestone changed from 0.9.1 to 0.9.2

    Sorry, I can't change the default without breaking an unknown number of users' test suites that depend on it.

    Tue Dec 5 15:49:26 2006: Modified by jpellerin

    • resolution set to fixed
    • status changed from assigned to closed

    This is implemented in [136]. Now you can configure the test match regular expression with the -m (--match or --testmatch) command line option or the NOSE_TESTMATCH environment variable.